#💻・modding-dev
1 messages · Page 566 of 1
can you copy paste the code
SMODS.Atlas{
key = 'Jokers',
path = 'Jokers.png',
px = 71,
py = 95
}
SMODS.current_mod.optional_features = function()
return {
retrigger_joker = true
}
end
SMODS.Joker {
key = 'Doofed',
loc_txt = {
name = 'Doofenshmirtz',
text = {
'Each played {C:purple}5{},',
'gives {X:red,C:white}X1.5{} Mult when scored.',
'{C:green}1 in 5{} chance to Retrigger{}',
'{s:0.6}"its weird that it happened twice..."'
} },
atlas = 'Jokers',
rarity = 3,
cost = 6,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
unlocked = true,
discovered = true,
pos = {x = 0, y = 0},
config = { extra = { Xmult = 1.5, repetitions = 1, odds = 5 } },
loc_vars = function(self,info_queue,card)
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'Doofed')
return {vars = {card.ability.extra.Xmult, numerator, denominator,}}
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
if context.other_card:get_id() == 5 then
return { Xmult = card.ability.extra.Xmult }
end
end
if context.mod_probability and not context.blueprint then
return { numerator = card.ability.extra.numerator * 2 }
end
if context.retrigger_joker_check and context.other_card == card and
SMODS.pseudorandom_probability(card, 'Doofed', 1, card.ability.extra.odds) then
return {
message = 'Again!',
repetitions = card.ability.extra.repetitions,
card = context.other_card }
end
}
send a screenshot (I hate being on mobile)
just install vscode with this plugin https://marketplace.visualstudio.com/items?itemName=sumneko.lua
I can not read this with the atrocious formatting 🙏
...that's for VSCode - and that's Notepad++, you silly.
just install vscode ...
i already had vs
somehow formating in VS fixed the OG bug, but now we got a new one!
it was as the hand was played, it was fine without a 5 in it but when i played a 5 it went kaput
how can i use has_enhancement() to check for any enhancement?
if next(SMODS.get_enhancements(card)) then ... end
could work?
did i do everything right here
asking since G.P_CENTER_POOLS.BSRRelic is empty rn
oh the atlas is fucked up
is there a context for when money is earned?
Yes i think it came with the latest smods version
do you know when that came out and if the docs have been updated?
👍
where do i find info about pools
the last time i asked i ended up procrastinating so hard i never actually used pools
Hello, is there a simple way I can give different cards different overlay sprites without using UndiscoveredSprite?
I managed with the basic sprite but no luck the overlay
would you happen to know if the ox triggers context.money_altered once or many times
It would trigger for every hand you play that is your most played poker hand.
shit i meant the tooth
It would trigger for every card in the played hand.
ok thanks
#💻・modding-dev message
-# Deja vu, eh?
is it possible to award money like when discarding but in other contexts
why wouldnt it be
because intellisense is lying to me
what the fuck is intellisense
vs code autocomplete or some shit i dont really know
it says dollars is undefined so thats fun
thx
i mean thats not an issue with the context then
<@&1133519078540185692>
why do i get this crash when viewing my deck? card definitely does exist
looks like card here is nil for some reason
well yeah the crash says that
add a nil check there then
is blueprint_compat just for ui
yeah
How do we do an error check for nil to skip something?
{
path = 'helluvasleeves.png',
},
true
)
SMODS.Atlases['casl_sleeve_atlas'].mod = SMODS.current_mod``` I have this bit of code to put card sleeves but if a user doesn't have the card sleeves mod it gives a nil error.
why are you using take ownership on atlases instead of just using malverk anyway..
anyway the check would be if CardSleeves then since that checks for the global table that cardsleeves creates
Oh funny you guys are already discussing nil checks xD
{
path = 'helluvasleeves.png',
},
true
)
if casl_sleeve_atlas == nil then
else
SMODS.Atlases['casl_sleeve_atlas'].mod = SMODS.current_mod
end``` I changed it to this and I'm not sure if it's right but the error left so, I think it's working?
Nope
okay what am i even doing wrong here, im trying to make a sleeve but it always does the default effect regardless of what deck i have. i did the exact same check for another sleeve but it works there
{
path = 'helluvasleeves.png',
},
true
)
if casl_sleeve_atlas then
else
SMODS.Atlases['casl_sleeve_atlas'].mod = SMODS.current_mod
end``` This still doesn't work right OTL
dont do the else
currently youre just effectively doing a wierd way of if not casl_sleeve_atlas
Without the else instead it crashes if the mod is present
okay im just fucking stupid
Hi Something
this may sound like the stupidest thing ever but how do i put in the image for a blind 😭
balatro crashes every time i try to do the same thing as for the jokers with the atlas and such
You'll want to use Malverk
theres really no way to do it using smods .. ?
Malverk uses smods
yeah well like base smods is what i meant
It also allows for texture swapping to be more modular so you can mix and match
hmme
oh wait i think i found whats up
okay lol i was using atlas instead of atlas_table
why does this just straight up close my game? lovely log doesnt even have a crash message. previously i just had v instead of table[k] but those should just be the same value right??
also when i used v it just didnt do anything at all
other_ret can contain cards.
For anyone else with my issue. You can check if a mod is loaded with this https://github.com/nh6574/VanillaRemade/wiki#how-do-i-get-if-another-mod-is-loaded
if next(SMODS.find_mod("VanillaRemade")) then -- Uses the mod's ID
-- do code
end```
all i did was add ruina decks card sleeves and 3 other mods now i cant figure out whats causing the discoverymanager error
i wanted to use whatver mod added sleeves and stuff
okay i fixed this but now i still have the issue that the joker just. does nothing at all
the fuck
then how N do this
if not changing the ret
i did just change the ret yes
🤷
ok
How hard is it to make a balatro mod as a beginner
i did only check for other_context.individual it might not work in all contexts?
idk the joker i tested with used context.individual
i would say depends on how much coding knowledge you have in general (or just really any related knowledge)
lua is definitely one of the easier languages to learn in general though
Any way to have my "Overlays" in a seperate category?
i was able to get away with just computer science python knowledge and ive made some stuff
Oof I dont really have coding knowledge, i'll look into lua when I get home from school though
Cause I know Paperback does the same sticker shenanigans and they have a seperate category
yeah this works
also theres a ton of helpful resources for modding in #1349064230825103441 message
isnt the second variable in (i)pairs the value and not the key?
oh wait
nvm
im oupid
Gotcha, thanks!
its this
i guess ill try doing table[k] instead of v in some places and see if it works
ok so the issue was cardsleeves but how else am i gonna use card sleeves if the mod gives me a error
Is there any way to call G.FUNCS.reroll_boss() without losing money?
it works fuck yeah
okay somehow i managed to make every instance of the colour red completely white but uhhh who cares
oh
wait
im probably changing the colours when they appear i just realized
type shit
It's not working.
I hate coding.
Back
Back
cryptid i beg
i just enabled you
like i understand lua, but not this much
this is line 44
what do you want me to do
what's the function
i think this might be a wrong cryptid install
0.5.12a
it's not able to load a file so either the files are missing or there's an extra file there
dunno i dont play cryptid
ok it is its from last week
which wants me to use steammodded 0827c which i am
my dumbass didnt look at the rest
yeah like i said there's an extra file
yeah mb i misunderstood, i dont know what the right install would be or the extra file, im not knowledgeable at all in coding stuff like this
remove the .lovelyignore from the items folder
idk if they accidentally included it in cryptid
is there a .lua file for vanilla jokers?
there technically is in the vanilla game but its VERY different from how smods jokers work (it basically all goes via a single function with hardcoded effects for each joker)
vanillaremade has every single vanilla item (including jokers) remade with smods https://github.com/nh6574/VanillaRemade/blob/main/VanillaRemade.lua
also vanillaremade is like the best thing ever made
why when I try instance my custom boss blind this error appears?
You need to define G.GAME.current_round.SM_the_variable
Also card.base.value is the key of the rank, not a table.
what I wanna do is that this boss blind, debuffs one random rank of the full deck.
after you play a hand the blind changes what rank should it debuff.
What should I do in order to get the avaiable rank in the full deck to pass it to the blind to debuff it?
I tried by doing card.base.rank but it does nothing.
You mean a hand?
oh yeah, my bad
so what should I do is define a table of the random rank chosen in order to debuff all cards of said rank?
No, you would use calculate and in context.after you would store the rank in blind.effect also, you would use context.debuff_card
how would i go to fetch info from a wiki page
heya, so i changed the chance value to 10 but it still shows 15. anyone knows how i can fix that?
(yes, i did change lucky cards to use a config value)
Code?
SMODS takes ownership of lucky cards loc_vars
sooooo...
Your last patch does nothing.
how do i go about changing the loc_var now?
patch the smods take_ownership instead i would imagine
uhm, yea- how do i do that?
all the lovely patches i did affect the game, not the mods
target = '=[SMODS _ "src/game_object.lua"]'
alright
is it cfg.extra or _c.extra?
cause cfg crashes
right, it's card.ability.
duh
oh, hey, it's working
thank you
how would I make a sound effect just keep on looping until the condition isn't true?
is that sound a part of a joker?
consumeable, it has a counter assigned to it and once it goes below a certain value it should start playing a heartbeat sound effect on loop
i started saying consumeable instead of consumable, thank you thunk i love you
ok i see that consumables have an 'update' property. you can may be use that
like such
you are welcome
this crash log shows up after trying to open the game with my mod (the joker mentioned there is made by me)
I put everything inside the calculate functions and put the respective contexts but now it gives me this different error.
could it be because I haven't specified the blind effect in loc_vars?
first of all, config is missing a '='
second, your loc_vars use center instead of card
third, that's how you do loc_txt (at least in my case)
like a ton of your joker parameters are just outside of SMODS.Joker
fourth, your context.remove is in context.joker_main which cannot happen normally
also, instead of check_for_unlock you can just do unlocked = true
which you did
yeah, and display_size and everything after that is just outside the joker
so i have to remove that? when the joker was created it was arleady there
no, you need to move that over there
and also i have 2 config (which i shouldn't) but if i try to delete either of them it will effect the rest of the code
you only need 1
wasnt this already solved a few days ago
or yesterday
alright you know what? lemme fix that
honestly the primary issue rn is that you do need to know how to work with lua first 😭
i would highly recommend starting with the basics before jumping straight into modding
yeah but this is a different file and that problem from a few days ago was solved just by deleting one of the config but now if i try to delete one of them it will cause to show errors in the rest of the code
yeah no you definitely removed it wrong again
yeah i should prob do that
trying it out and it seems to just keep spamming because I don't have a proper check for it. I'm wondering if there's something that would let you check when the sound stops playing but that's rather obscure
built in sound effect looping one day
sorry to jump in, does anyone happen to know if there's a context for the time when gold cards give their money? Honestly I'm just trying to do what is essentially a gold quantum enhancement but I've been encountering weird issues with death interacting with quantum enhancements that seem to be encountered by other people as well
I've got this right now in my joker's calculate which doesn't work.
if context.individual and context.cardarea == G.hand and context.end_of_round and SMODS.get_enhancements(context.other_card)["m_steel"] == true then
if not context.other_card.debuff then
return {
dollars = card.ability.extra.dollars,
card = context.other_card
}
end
end
end
why are you checking for steel?
@strong terrace here you go. here's how your joker should look like
oh sorry, this is for steel cards to give the money. I'm just redoing alloy from extra credit bc it's buggy and the devs say its bc of quantum enhancements
ah
you didn't need to do that, i should probably inform myself more about lua, but thanks
try something similar to this
np
👉 👈 🥺
sorry, I'm sure this is in the wiki somehwere but I cant find it for the life of me
its not particularly easy to navigate
you gonna need to use context.individual and context.end_of_round with context.cardarea == G.hand
and see if the card scoring is a gold card
sorry I might be misunderstanding, is this different from that?
if context.individual and context.cardarea == G.hand and context.end_of_round and SMODS.get_enhancements(context.other_card)["m_steel"] == true then
this is what I have now but it doesnt work :(
try SMODS.has_enhancement(context.other_card, "m_gold")
also, if you need gold cards why are you looking for steel?
Sorry, I'm trying to make steel cards give money like they're gold, without just doing a quantum enhancement
it's a joker right?
Alloy from extra credit is buggy and the devs say it's bc of quantum enhancements so I thought I'd just do this
yea
then you can have a joker give money if a steel card is scored
True but then it would give every hand, not just at the end
and tbh I was hoping it would be able to happen at the same time and in order with the gold cards
try getting rid of the cardarea check since it only ever happens in 1 area anyway
this might just work
I'm starting to feel a lil stupid
you were supposed to replace those values
it was only a template
i imagine
i know
so wait are you saying the money adding is the problem?
yeah
its dollars, not money
right
i can double check but I belive it works if I don't include the end of round check
that's how i would do that effect
wdym, sorry
sorry to be asking about this again but what would that roughly look like?
SMODS.Sticker:take_ownership("eternal", {
should_apply = function(self, card, center, area, bypass_roll)
-- ?
end
})
oh wait maybe you're right, I removed the end of round check and its not working
i swear it was earlier
i'm not confirming nor denying that money adding is the problem. i'm just saying that's how i would do that
oh got it
i was just copying the way the extra credit mod did it
ill try that though
im lost on this one, is the code
local new_card = create_card('Joker', G.jokers, nil, nil, nil, nil, 'TBC_middlelittlesibling')
new_card:add_to_deck()
G.jokers:emplace(new_card)
not correct for adding a joker to the joker area?
TBC_middlelittlesibling is the joker im trying to add to the joker area
youre missing the j_ in the key
ah
also you should probably just use SMODS.add_card if youre adding the card immediately anyway
j_TBC_middlelittlesibling ?
yea
you should use SMODS.add_card
like that
i tried using add_card, couldn't understand it
didn't work unfortunately
Because I don't trust myself that I definately did it right heres what I have lol
what happens? does it just not give you anything?
yeah, steel cards just do normal steel things
replace get_enchancement with my has_enchancement
oh I missed that
I used that wording for the gold acts as steel part of the joker and that worked but I did try changing it the way you said
didnt work though :(
alright give me a sec
thanks for helping by the way, I really appreciate it
bump
wdym "its scoring suit"
check vanillaremade
have you tried looking at vanillaremade
how so
like if i just copy and paste yeah sure it works
but if change like anything like the name of the card or smth like that
it crashes
if you change the name of the variable you gotta change it everywhere
yeah i tried doing that
what does the code look like?
well i deleted it cuz it didnt work in any way i tried
thats why i was asking how to do it
oh shoot I think I'm stupid, gimme one second but I think I might've been wasting your time I'm sorry
it's fine. we are all stupid sometimes
well seeing how you were trying to do it before would probably help
can i genuinely get away with this and not be flintlocked by basic lua.
yeaah i uh, had the entire code block I sent you in the if for the gold check...
whats cfp and current_hand_mult
thanks for helping! I've got it working now
np
How can I make it so the description of a joker updates with the Xmult / odds
cfp is the cutoff point, aka. a constant of 1 which basically just prevents the variable from going under itself.
do you have your loc_vars set up already
what im saying is can i get away with [math function] and [math function] ~= result without getting fried
yeah that looks like a correct if statement there
i think so
SMODS.Joker {
key = "galaxy",
blueprint_compat = true,
rarity = 3,
cost = 8,
pos = { x = 1, y = 4 },
config = { extra = { xmult = 1.5 } },
loc_vars = function(self, info_queue, card) nebula_galaxy
local suit = (G.GAME.current_round.nebula_galaxy_card or {}).suit or 'Spades'
return { vars = { card.ability.extra.xmult, localize(suit, 'suits_singular'), colours = { G.C.SUITS[suit] } } }
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and context.other_card:is_suit(G.GAME.current_round.nebula_galaxy_card.suit) then
return {
xmult = card.ability.extra.xmult
}
end
end
}
--- This changes vremade_ancient_card every round so every instance of Ancient Joker shares the same card.
--- You could replace this with a context.end_of_round reset instead if you want the variables to be local.
--- See SMODS.current_mod.reset_game_globals at the bottom of this file for when this function is called.
local function reset_nebula_galaxy_card()
G.GAME.current_round.nebula_galaxy_card = G.GAME.current_round.nebula_galaxy_card or { suit = 'Spades' }
local galaxy_suits = {}
for k, v in ipairs({ 'Spades', 'Hearts', 'Clubs', 'Diamonds' }) do
if v ~= G.GAME.current_round.nebula_galaxy_card.suit then galaxy_suits[#galaxy_suits + 1] = v end
end
local galaxy_card = pseudorandom_element(galaxy_suits, 'nebula_galaxy' .. G.GAME.round_resets.ante)
G.GAME.current_round.nebula_galaxy_card.suit = galaxy_card
end
function SMODS.current_mod.reset_game_globals(run_start)
reset_nebula_galaxy_card() -- See Ancient Joker
end
``` i believe it was like this? basically just renamed all the ``vremade_ancient``/``ancient`` with ``nebula_galaxy``/``galaxy``
can someone confirm or deny this for me?
If i were to use the code
if context.final_scoreing_step and context.cardarea == G.play then
would the effect after this be played after everything else, but before Mult and Chips combine?
noice
context.final_scoring_step
this looks correct
im making a joker that does both Xmult and ^mult, but i want the power to happen last since it's... strong.
yeah i have no clue how to set up the timer, it just plays the sound whenever i play a card and that's it 
{
emult = ...
extra = {
xmult = ...
}
}
any idea why it would crash then?
well i cant really tell why it crashes without seeing a crash log because thats what tells you why it crashed
fair
line 399 being local suit = (G.GAME.current_round.nebula_galaxy_card or {}).suit or 'Spades'
omfg how did i not see that
nebula galaxy
i put that there so i could ctrl c
nebula galaxy
lmaoo
hi gusy
will my joker work
ofc
insert dont ask to ask website stuff
no the red underlining and vscode screaming doesnt mean anything dw about it im sure tis fine
but yeah what is it
sure the crash is also a part of the experience too right
i made a seal and it gives +6$ and retriggers card, I want to balance it
it's too good
yeah no shit its red seal + gold seal and still better somehow
i mean you cant really balance 1 retrigger and without the money its just a red seal
😭
LMAO
and with the money its just better red seal
it's like a double gold seal red seal
yeah
make it expire after x rounds
that'd be cool
debuff the card after x rounds would be cool yeah
i was thinking just remove the seal from the card
still feels a bit too strong imo
I also made negative planets
i feel like straight up debuffing the card would balance it out better
so they remove planet levels
oooh
like you can get to lvl 0 hands
make it eat all of your money after each blind that would balance it just fine 
you get a really strong card for both scoring and econ, but you will have a dead card after a few rounds
no more interest if you have
it was a joke
oh
this seems balanced
every time i try to code one of these cards i feel like it's gonna instantly crash the game
entering the shop with $0 everytime 🔥
it is
(seal name): +6$ and Retrigger the card, BUT after x rounds, -3 level to recently played hand
i will do it and I will make other seals too
burnt joker kinda negates the downside if you can get it to retrigger...
how do u retrigger a joker with a seal lmao
🤷
-# unless u have seals on everything i guess
also make it take away 6 dollars instead of giving 6 dollars because that's funny
hi! im super new to this so im sorry if its just a silly mistake but im trying to make a tarot card that changes cards to a modded enhancement i have. ive gotten it to work but for some reason when it changes enhancements it like flashes another card or flashes transparent first before showing the new enhanced card? does anyone know why that may be? again so sorry if this is a question that is obvious lol
ok so i made everything work after removing the nebula_galaxy
how could i make it sync up with the vanilla ancient joker tho
does anyone have a joker image template i have to do something
like this?
if you just wanted to make it be the same suit as ancient at all times you shouldve just used the same variable as ancient
cool.. and what does that mean..
use the same variable as the one that ancient joker uses in vanilla
what variable where
idfk i dont know what variable the vanilla ancient suit is from memory
but it is what you have to use
what in my code do i replace with the vanilla ancient joker thing tho
like the last part where it changes the suit?
the suit in the joker
you wont need the entire suit changing thing if copying the ancient suit since it already changes
ok so the resetting thing is gone, the fuck do i do now
do you possibly have a higher res image for booster packs? ive been having trouble making them because i cant find a high resolution template or image!
go find the ancient card variable
and use that where it is
not for booster packs no
its prolly somewhere in round resets
no worries thanks anyways! 🙂
did i hook this correctly?
my custom G.GAME value
youre amazing for that!! thank you so much!!!!!
probably... by... making start_run not even work...
mightve found it hold on
if not saveTable then
G.GAME.current_round.discards_left = G.GAME.round_resets.discards
G.GAME.current_round.hands_left = G.GAME.round_resets.hands
self.deck:shuffle()
self.deck:hard_set_T()
reset_idol_card()
reset_mail_rank()
self.GAME.current_round.ancient_card.suit = nil
reset_ancient_card()
reset_castle_card()
end
self.GAME.current_round.ancient_card.suit
i assume self is G in this case
yeah
ok so thats easy
local suit = (G.GAME.current_round.ancient_card.suit or {}).suit or 'Spades'
yea
makes sense to me
uhhhh
oh i didnt change it on the other lines
it is not synced.
show code?
remove the .suit from inside the parentheses
.suit.suit ...
also im sure {}.suit will not cause any 'trying to access nil value' errors in the future
🤔
does anyone know why the cursed cards lay on smooth and the other ones dont??? im so confused as to why its flashing at me before applying lmao
alr thats working perfectly thanks yall 🙏
ok yeah lua doesnt require value to exist when doing dot access
so (... or {}).suit or "Spades" is valid
issues only arise when you index that value further
local timer1, timer2 = 0, 0
local old_update = Game.update
function Game:update(card, dt)
old_update(self, card, dt)
dt = dt or 1/60
if G.GAME.FervencyCounter then
if G.GAME.FervencyCounter <= 50 and G.GAME.FervencyCounter > 30 then
timer1 = timer1 + dt
if timer1 >= 1 then
play_sound('tdec_hbeat1')
timer1 = 0
end
end
if G.GAME.FervencyCounter <= 30 and G.GAME.FervencyCounter > 15 then
timer2 = timer2 + dt
if timer2 >= 0.4 then
play_sound('tdec_hbeat2')
timer2 = 0
end
end
end
end
alt tabbing speeds up the rate at which the sound effects are repeated, any way to get around this or is it just not fixable? Besides that this works just fine
My guess is the dt = dt or 1/60 is defaulting to 1/60 when alt tabbed
No real reason to have a backup for dt anyways
didn't really find a better way to deal with it because it would just result in a nil value
dt shouldn't ever be a nil value 
not sure why it is 
I suppose instead of doing a fallback you could just wrap everything in an if dt then
interesting
nvm i think i know what's going on
i assume when you alt-tab out of the game, some stuff freezes and so dt becomes 0 because no time is passing
nvm i thought i was calling old_update too early
Nah your old_update is in the right spot
Can I see the crashlog with the nil value error?
oh i
i fixed it
i'm stupid
function Game:update(card, dt)
old_update(self, card, dt)
I forgot to ditch card from these
the more you know
Using context.destroy_card, how would I destroy all cards in my full hand aside from the first?
if context.destroy_card and context.cardarea == G.play and not context.blueprint then
local should_remove = false
for i, hand_card in ipairs(context.full_hand) do
if i > 1 then
should_remove = true
end
end
if should_remove then
return { remove = true }
end
end
this currently destroys all of them
context.destroy_card is like context.individual, it runs once on every card. don't loop through the full hand, just check if context.destroy_card ~= context.full_hand[1]
how do i make it so that some jokers spawn with a config toggle
because im just getting hit with this now
is there a thing to make a card undebuffable ?
return prevent_debuff = true in context.debuff_card
you should check if context.debuff_card == card
is what i assume you want
also individual and debuff_card are never called at the same time
or during context.before
debuff_card is only calculated when calculating card debuffs
like that ?
individual and debuff_card are never called at the same time
yeah but its an enhancement that prevent the debuff for him and card in the same card area
the point is that you don't need context.individual at all. debuff_card is called on every card like individual is
debuff_card is called on a card whenever something attempts to debuff that card
so if my card is held in hand, every card held in hand will be prevent from debuff?
you should do if context.cardarea == card.area
i think
and context.cardarea ~= G.deck
G.discard i guess but thats an optional feature
if you only want to have it work in held hand, then it should be if context.cardarea == G.hand and context.cardarea == card.area. having both G.play and G.hand let through means that it'll have a similar effect if your card is in played hand
im pretty sure its intended to allow both
also
debuffs might not recalculate for this card
so you would probably need to do recalc_debuff stuff
or whatever the method is called
is there a way to make a joker pinned to the right side of the joker area?
Yeah I want both
vanilla pinned uses a hardcoded thing in Cardareas:align or smth so you'd probably have to patch that
but ive seen mods make cards not draggable
so you could also do stuff with that maybe]
try looping over G.playing_card (i think that contains every playing card) and calling :recalc_debuff or whatever its called on every card
in some context, probably like hand_drawn
eh screw it ill just flip the joker's effect to right joker so i can pin it normally
like this
no do it in a different context
this is infinite loop
once debuffs get calculated
hand_drawn is probably a good timing for it
yea
and why was it an infinite loop
recalculate debuffs > context.debuff_card gets calculated > recalculate debuffs > context.debuff_card gets calculated > ...
oh yeah
also this only works on the card that has the enhancement currently because of the context.debuff_card == card check
no just remove that check
yeah i think this would work
lets try
though probably put the for loop inside the event
so that you arent calling 52+ events with a 0.15 second delay each
i dont think you need to
but itll probably look nicer
you can probably remove the trigger and delay though
uhhh
hold on
you should also probably set up your balatro/smods lsp lmao
oh its
SMODS.recalc_debuff(<card>)
that explains
oh
but what do you mean about that
i still havent done that lmao
also if you dont have a .vscode folder yet you probably want to add that to gitignore
is there someone that already does that so I can copy it and just modify it so it work in my mod
i mean you can just copy the thing in the link
and then replace the paths with the absolute or relative path to your smods and lovely dump
and also if you dont have it yet
make a .gitignore file and then put .vscode in it
like in text
so it doesnt get pushed to github or tracked
if G.GAME.FervencyCounter <= 0 then
G.E_MANAGER:add_event(Event({
blockable = false,
trigger = 'after',
func = function()
G.STATE = G.STATES.GAME_OVER
return true
end
}))
end
I'm trying to make it so you just instantly lose once the counter on my card reaches 0. Normally it works fine but when the counter gets reduced at the end of the round and hits 0 the music will slow down but from there you won't be shown the loss screen and will be allowed to go on with the run. I tried slotting it into an event but I seem to be getting the same result. This is definitely a timing issue which idk how to fix
idk i just copied a .gitignored idk from where
you can probably just
delete everything except for the .vscode
.gitignore is just a list of file/folder names to ignore
where do i put no_collection in Jokers code
yeah ik
I was just knowing that I alway need a gitignore in every project or it will fuckup the repo
btw the path for the smods is from where do I need to put like %appdata%/Balatro/...
you can do relative to the vscode settings file or just the absolute path (as in from the drive)
i just use absolute path because i cant be bothered to figure out the relative path
ig its like that than
oh
so like C:/Users/<user>/%appdata%/balatro...
thats why i recommended gitignoring it lmao
yeah
because i have like my actual name in my users thing
/ because other slash makes json file kill you in real life
oh
i love file types that go fucking insane over the slightest minor things
also gotta love how json doesnt have comments at all for no reason
json is actually so fucking stupid 😭
its like the only language ever that doesnt support comments
you can do a librairy in python i think but yeah fucking stupid
nvm i figured it out
oh for my Joker it doesnt do actually what I want but I kinda like the effect
now thats the effect
but thats what I want at start
ohhh
actually i think i know
why its not doing the thing
because debuffs dont get updated when you play it so the cards in hand just stay not debuffed
is there an easy way to fix it or ...
just recalculate the debuffs in context.before as well
i think that would work
though
that might like make the played hand wierd
because like the poker hand has already been calculated by then
actually no because the cards in hand will be undebuffed anyway nvm
why is it doing this in the collection
is that going to work
i think
could you show us the localization file
im assuming you mean "Slots Used"?
probably remove the context.cardarea == G.play thpo
yeah but if its stay in hand its the card held in hand that are undebuff
yea
the "Slots Used" is the generic infobox that pops up on any card that takes up extra slots (i'm using the new extra_slots_used feature from smods 0827), i want it to read "Gigantic" and "Takes up an extra slot" like other stickers do
first screenshot is in descriptions -> Other, second is misc -> labels
i think the best way to go about this is just to not apply the extra_slots_used adjustment if it's being applied to a fake card
but idk how to detect if a card is a fake card during the apply function
yeah i thought "fake" (base) cards would have like only a few parameters but they have a lot
idk what i would do either
yo chat, cant remember if i asked already but does anyone know how to check for "any" enhancement? i tried has_enhnacement() by itself but it applies to every card
if <card>.config.center.key ~= "c_base"
the problem ive been finding out about stickers is that should_apply and apply run before the card gets all its abilities, so if you tried to do a check like if card.ability.eternal return false end in should_apply, it would just fail and apply ur sticker anyway
i really wish it were as simple as "oh, lets just check if this card has/is this!"
yea lol i ran into that with the patches i'm working on for starspace (i wanted them to only apply if the card doesn't have the counterpart sticker, e.g. the generous patch can't be on a card at the same time as rental)
what im doing right now is dynamically changing values with an Event in apply
it's so fucking ugly and awful
I test it out in some way and it doesnt work
anyway i think i figured it out, fake cards count as playing cards but card.children.front is nil for fake cards and not regular playing cards
even stone cards have something in card.children.front
thats sick
why did you remove the context.hand_drawn recalc
does anyone know of a mod that uses SMODS.Gradient
cause I make it context before
but it will undebuff card when its draw, isnt it?
it works 🔥
But I might do the thing that remove the debuff when drawn since wild card are never going to be good
So like you just want it to be drawn
And discard it after
you could also just make a global mod calculate
so its not every card with the enhancement recalculating the debuffs
and then have it recalculate debuffs in any context where a card changes areas
Yeah I was thinking of that but I am not that advance in coding in lua\Smods
i mean you could just let the enhancement be jank for now
and thenfix later or smth
its really late for me now but i could maybe do a quick PR to fix it tomorrow
how can i save a config to future cards
im trying to make a consumable do something diffrent every time its used
Use set_ability to run code when the card is created
1, how do i test out new additions without having to wait 4500 yars for rng to fall into my favor.
and 2, is there anything to help me for notepad ++
-
Get debugplus
-
Stop using notepad++ and start using vscode :3
but oficur my c drive doesnt look like it can handle it
Surely vim
--Twice In A Blue Moon
SMODS.Joker {
key = "bluemoon",
blueprint_compat = true,
rarity = 2,
cost = 6,
atlas = 'nebula_atlas',
pos = {x=1,y=2},
config = {extra = {repetitions = 1}},
loc_vars = function(self, info_queue, card)
return {}
end,
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play and not context.blueprint then
return {
repetitions = card.ability.extra.repetitions
}
end
if context.individual and context.repetition and context.cardarea == G.play and context.other_card.lucky_trigger and not context.blueprint then
return {
repetitions = card.ability.extra.repetitions + 1
}
end
end
}
im tryna make this retrigger all lucky cards played, and then retrigger again if the lucky card hits
kinda struggling
i was given Missing required parameter for Joker declaration: key even though i clearly had key in joker decleration.
o
here's an example of a joker if you need it
(ignore atlas for now if you dont have any joker sprites)
anyone know how to check what deck is selected?
G.GAME.selected_back.effect.center.key
tyy
can i even use vanilla atlases as placeholder sprites
it'll default to jimbo (normal joker) if you dont have an atlas
now im pretty sure it's haunted.
its still complaining about missing a key
when its right there
can i see the code for the joker
Double curly brackets
im starting to think my machine's cursed.
first it suddenly aborted a shutdown
then it randomly assasinated both of my .json files i really liked
use loc_txt for name and text
key = 'joker',
loc_txt = {
name = 'joker',
text = '+4 mult'
}
now this
what the fuck are you making
said json files had export data from some bot
and they both randomly turned into null bytes
entirely.
okay im no expert but im pretty sure you have malware or something
a balatro mod does NOT cause json files to die 😭
i dont even think it's win11's fault anymore
quantum ranks with automatic code replacement W.I.P
now time to make Schrodinger's cat
"Ace's count as a Ace and 5 at the same time"
Y'all said it was hard but it was easy asf ngl
got bored decided to try took like 10 mins
this will be nuts if you finish it.
I just need some testing to make sure it works fine
and... it doesnt do anything
and by it, i meant the open as archive
what's open as archive
joker im trying to make.
😭leave this dude for one month he’s gonna invent smods 2.0
do you know a mod that this is implemented in that I can look at? I'm trying to check for a specific deck but I can't figure out what this returns exactly
the key of the deck
and yeah https://discord.com/channels/1116389027176787968/1385061686200762488 uses this for cardsleeves
I made this and checked G.GAME.selected_back.effect.center.key == "partnerdeck" but it doesn't do anything :(
I also tried with the b_partnerdeck
you're missing the mod prefix then
oh got it, uh I'm new to this where does that get put
b_modprefix_partnerdeck
(replace "modprefix" with your mod's prefix)
got it, I'll see if that works
sweet that worked thank you
I'm routinely shocked at how crazy helpful this chat is
Chat I'm gonna be honest with y'all idk what a self is
I think I know what a card is though
its usually the center itself
what do i do to make Oops! affect the odds
i got it working at the 50% rate but after i fixed it up now oops doesnt work
how do i detect when the ui box is open
context.mod_probability isn't for letting your probability values get modified, it's for cards that modify probabilities (i.e. something like oops all 6s itself)
check the release notes for 0711a for documentation on how to use the new probability api
https://github.com/Steamodded/smods/releases/tag/1.0.0-beta-0711a
it also won't visually update the probability until you interact with the probability api in loc_vars too. that's also documented in the link i posted
don't mind me, just posting this here in the case someone has a solution whilst i try to work it out myself
unrelated to your issue but you shoould probably use the new smods probability api
oh oke
oh i see the problem
you are checking context.other_card in smods.has_enhancement inside of context.joker_main
context.other_card does not exist because joker_main is for joker scoring effects usually
additionally you are checking if val (a card) is equal to a boolean (other_card having steel/lucky)
how do i get what mod a joker is from?
[center].original_mod
note that would return the whole mod table but that's also a good thing anyway
i got the odds to change by changing " local odds = (cfg and tonumber(cfg.odds)) or 2" to " local odds = SMODS.get_probability_vars(cfg and tonumber(cfg.odds)) or 2"
but now i gotta figure out how to change its desc odds
read this
tells you everything about probability api usage
and it is relatively simple its just a bit tedious
get_probability_vars is supposed to be for the description
nevermind, i forgot two things
as per the link that's been posted twice now:
(to be clear that's how to do the probability check itself properly)
thats what i have basically, just a little changed
for some reason it doesnt like putting numerator in that section
ok you said you were using SMODS.get_probability_vars, which is the function meant to be used for the loc_vars
"numerator" and "denominator" are placeholder names for your actual base numerator and denominator
how do i get the center from an actual joker
card.config.center
use debug plus, eval dp.hovered while hovering over a joker, and dig through the tables there for a bit. please
yes do this always i love scrolling through massive tables and finding new information
oh lets go its fully working now
nice
so which context should i ideally use when marking cards to destroy?
me trying to figure out why my sticker is showing up alongside rental stickers even though it's supposed to be incompatible (it's card.ability.rental, not card.rental)
tbh not sure ive never done a joker that destroys cards like that
maybe context.before?
though i also think that joker_main could work as long as you use val and not context.other_card
since other_card is the card thats being looped over by the contexts, and you're already looping over the scoring hand's cards
it depends on the timing you want tbh
i can just mark em as i go along, allow them to score and then destroy them after the hand's been scored or whatever
sorta like how glass cards break
does anyone happen to know if I'm on the right track here? I'm trying to start with a simple skip tag for a dumb mod I have in mind, but my lack of coding knowledge is making things difficult and just winging it is crashing the game. The error code says something about an unexpected symbol near a ']' if that helps
Oh boy
i'mma use vanillaremade's Immolate for reference cuz it also picks random cards to destroy
First just an advice
Use a code editor like vscode
It’s so cheap (it’s free l)
And it will make your life so much easier )
Second : your syntax is all messed up
Tho your code looks fine
It’s hard to tell without syntax highlighting
yeahh I don't really know what I'm doing? It's basically just vanilla remade mashed together 
but every time I try to actually learn coding I experience Brain Explode(tm) and give up
As long as you’re using stuff that ate available
Trust me it’s easy you just need to take it step by step
What i always tell new beginners is just code a joker that give +1 mult and then x2 mult and then make it scale and make a joker that creates card then other stuff like leveling up hands etc
Like this you learn how everything works
From events to returns to context checks to modifying game variables
Like money / handsize /etc
hmmm yeah I'll try? not sure where to start, a lot of my ideas are very different to the main game (so I wouldn't be able to copy/reference anything) and might be too hard lol
Yeah you can’t climb a mountain with one step
Just start by copying the jokers ingame
Copy a one of every kind
By this you also get better at fixing bugs and errors
wouldn't copying the code mean I wouldn't learn anything? or am I misunderstanding
Like mult /xmult/scaling/money
Not copying code
Copying effect
oh yeah, duh
I mean try creating “banner” on your own
Find out your mistakes and when you see the code you’ll go “oh so this is how it’s made”
do you guys like my skip
tag
Ok, I'll give that a shot. Thank you for pointing me in the right direction!
I love compression.mp4 to .ogv
its 2 hours btw
Good luck and if you had any issue ask here
Unskippable ?
new skip tag that extracts your soul from your body and uses it to create a legendary joker
yeah you have to watch all of it for the joker
is this mfing parkour civilization
yes because its on youtube and easy to download
Bro honestly i wouldn’t have minded if the quality was good
i was gonna use like something else but i couldnt think of anything
bee movie tag when
my friend has horrible wifi and the file is too large
i honestly think its funnier if its lower quality
but yeah for 2 hrs would not be pleasant
10 hours of mommy asmr would’ve been more torturous
for a whole TWO legendary jokers
speak for yourself
31.9 mb mp4 to ogv
Bro this is not balanced
I am not downloading this mod
i will be reporting back in 2 hours
good theres like 500 inside jokes and 500 bugs
i would say i second this but i actually dont
hi how difficult is it to make a mod without knowing anything about programming?
honestly its just a shitty mod im sending to my friends to get better at lua
we're gonna use it in multiplayer
Somehow less jokers
you need to know lua
No
very
the real question is how difficult is it to learn programming as you go
which, considering it's lua, just try your best & ask questions as you go and you should do alright
I love python
i made a discord bot for fun but it has like no features
Bro i am not learning how to code to make a joker in balatro to play my mode and make inside jokes with friends
shrug
If people wanted to make more complex jokers then they can start coding
programming is a useful skill
Not for most people
smodded docs are a bit confusing for me
Vanilla remade wiki has some explanation of a variety of stuff
I like it
It even tells you how patches work
alright ill make sure to look into it
ty
Np
The way N made it was so clever
He gathered some questions people mostly ask and answered them
Yeah
is it possible to make a joker change its description? basically just trying to make it go from this to this
does anyone know how rendering in main_end works
wait that's literally what's being asked already
joining in on this question hi
does anyone know how shuffle works
depends what the question is
wdym
as in how does one call the function to shuffle a cardarea correctly
let's take this description for example
i want it to only render like this when i currently possess the joker
otherwise itll look like the second image
it's easier to do this
but if you want main end you can look at invis
in vanillaremade
[2;32m>skip tag
>2 hour long video for a legendary joker
>looks inside
>Chicot[0m
yeah but this is for the ijiraq jokers
their descriptions have to match in localization for the engine to work
oh ok
update
amazing
I thought you were joking 😭
hi
hey
Have fun watching it on 144p
there's like an hour left
i mean who doesn't love random audios in the background
because here in balatro civilization, nobody goes for the
no one goes for the wheel
is there a .lovelyignore in the cryptid items folder
also #⚙・modding-general is for troubleshooting mods that you're playing
ah ok
then idk that's what i saw cause this crash before
im getting a ui crash whenever i try to hover over the card in the shop
and this crash happens when it's in the shop, so it shouldnt even be trying to render it right
is there something i missed setting it up maybe?
wait brain blast
ok no that didnt work
smh
dawg what does this mean
is this a my mod issue or what im confused
cause its crashing when i hover my joker when in a run, but not when in the main menu
show code
cause VS put itself on auto save and it wouldnt let me redo cause i was messing with a different joker, but i went too far back and i think i got it back to what it was before (when it was working fine) but I could have missed something
im trying to get it so that "recluseblind" spawns after defeating "spkblind"
but after defeating spk it doesn't spawn, even after rerolling dozens of times
and also opening recluseblind crashes the game
figured it out
What kind of blind checking is that 💔
god awful one it seems
I don’t blame tbh there are no examples anywhere
okay, theres some weird things youve gone for, but lets start with loc_vars. do something like the following:
loc_vars = function(self, info_queue, card)
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, "doofed")
return {
vars = {card.ability.extra.Xmult, numerator, denominator}
}
end,
for text do something like this:
text = {
'Each played {C:purple}5 gives',
'{X:mult,C:white}X#1#{} Mult when scored',
'',
'{C:green}#2# in #3#{} chance to retrigger',
'{s:0.6}its weird that it happened twice...',
}
see if it still crashes when you hover over it after doing this
we generally recommend formatting your text table like this because it somewhat resembles what it will look like in-game
would i replace the loc_vars as a whole?
yeah
well sadly it crashed on hover even on the main menu then
could you show what the code looks like now?
thats not suppossed to be happening
ah wait i see what i did wrong
its the lack of cfg.odds is my guess my code relies on that for the math
loc_vars = function(self, info_queue, card)
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, "doofed")
return {
vars = {
card.ability.extra.Xmult, numerator, denominator
}
}
end,
could you try this?
i lied
i was doing it from memory and missed some steps lol

i never tried main_end with localize, i would need to test to tell you
does the crash log help
the crash log tells me that the ui is nested too much
im guessing i also have to replace the cfg.odds with the card.ability.extra.odds
but idk how to solve that in this situation
yeah
not sure if i am doing this right
like the ui itself or the way its being loaded in the loc vars
