#💻・modding-dev
1 messages · Page 171 of 1
I found it
I'll fix this on the smods end I think
eremel probably already fixed it four seconds ago
literally wait a couple of minutes for me to test it works properly and merge it
is there a way that simple custom enhancements are done, like basic +mult, xmult and other stuff
am I able to recusively calculate a joker?
Anyone got examples of booster packs offering enhancements
in what sense? playing cards with enhancements?
Yep
Looked through the documentation but couldn't really figure out how to use create_card
need to use create_playing_card I think
Ah
what do i need to change to make the message appear by the joker instead of the card?
try card=card?
in the return
message_card = card
ty i'll try it
aint no way my laptop cant run balatro again 😭
bruhhh
gg
not the first time this happened so im not even surprised at this point
download more RAM.meme
Lovely 0.6.0, wondering if a newer version might help 
its really just my ram lol
had to close my opera for it to run again
my laptop is just not built to have aseprite, balatro, visual studio code + 2 tabs of file explorer opening at the same time
hiya! going back to what i was doing last night, what's the fix here?
ah oh well haha
can you show me your code rq?
also, i think the "resources" folder should be named "assets" instead, not sure if it has any impact on the code execution itself
oh it is called that
huh
so i have this:
SMODS.Sound({
key = "fling",
path = "bfdi_fling.ogg",
replace = true
})```
yeah i never tried adding sounds before so im just shooting blind here
hmm
and then this line should play the sound:
play_sound("fling", 1, 0.5)
and i assume the "bfdi_fling.ogg" is in assets/sounds?
ayup
im pretty confused honestly
try play_sound("bfdi_fling", 1, 0.5) to see if it works, i have no clue how sounds work currently 💀
wait fr? 😭
You need to have the mod prefix before the name
But it's not required on the file
oh i see!!
miku.ogg in folder
vcld_miku.ogg in code
With vcld being the prefix
For example
The game is otherwise looking not in the mod folder
Yeah
right now, it considers Joker to be a contestant because i haven't made any contestant jokers yet :}
is it me or the vid turns black at most parts
oh lol
obs hates me, it seems =w=
sometimes videos i watch do have that happen too (hardware issues, probably), so i gotta ask to make sure
is it possible to add another line in loc_vars.text? (through code)
basically, what i want to do is that another line is added below the "Bonus Set Effects:...", and uh, i tried using "\n" at first and i shouldve expected that it wont work
How do I make it so that a booster pack only offers a select few enhanced playing cards?
hmm, encountered a bug in Speaker Box that i'd like to work around
how can i have an attribute on a joker, similar to Cryptid's Food Jokers?
you could add a variable in your jokers' config and loc_var, then check them through codes, like "if card.ability.extra.IsFromMyMod then"
np :D
ooookay problem, it threw this exception on Blackboard
extra wasn't null, but it also wasn't indexable
oh, i know what it is
it's 3
okay lemme try adding one more condition
type(G.jokers.cards[i].ability.extra) == "table"
oh hey, that worked! :D
I'm still not sure how to make my booster packs spawn Enhanced cards from a pool of my modded Enhancements
create_card = function(self, card, i)
local rng = pseudorandom('void_pack')
if rng > 0.9 then
return {set = "Enhanced", area = G.pack_cards, skip_materialize = true, enhancement = "fm_transcendent"}
else
return {set = "Enhanced", area = G.pack_cards, skip_materialize = true, enhancement = "fm_overshield"}
end
end
This one gave me a crash message of attempt to index local 'center' (a nil value)
what line is "attempt to index local 'center'" error refers to?
I forgot and I couldn't really go back since I just fixed it lmao
I just forgot the enhancement prefix m at the enhancement parameter
oh
I suggest only run them when you need those numbers.
(Unless you're going to always need it, like displaying a in-game clock or something.)
^ it runs every second or smth
I was at 7 lines in a joker when I decided to make MultiTextBox but Oh My God you've needed the mod way more than I have.
oh trust me, thats not even the longest joker's description in my mod 😭
bro is close to writing dostoevsky 🥀
the fact i didnt even add the last two equipment slots and its already that long is kinda concerning
I think I have a more elegant way of doing multi text boxes
and i thought my 4 liner joker was
Big.
this is what one of my jokers looks like rn, a whole wikipedia in here if i say so myself
I would've suggested putting Bonus Set Effects in info_queue if I knew how to do so.
i mean just making a Other description and passing it by set and key should work
actually, should i just add another button under "Sell" which cycles through the equipment list and the joker's description?
u can have 2 sets of text in loc_vars?
though again, i still dont know how to change loc_txt through code so idk
like 1 for description and other for effects?
should there be like a simple soft update function?
that only calls on calculate and locvars
technically, there is
just add whatever you want in calculate without a context
yeah but then you have to retype it in locvars
absolutely horrendous
i want my money back
you have to do that?
i thought it will change that too
but anyway could just like, take ownership of the vanilla jokers and stuff to use this instead
idk if quantum enhancement lag is still a problem
create_card = function(self, card, i)
local rng = pseudorandom('void_pack')
if rng > 0.9 then
return {
set = "Enhanced",
area = G.pack_cards,
skip_materialize = true,
no_edition = false,
enhancement = "m_fm_transcendent"
}
else
local void_enhancements = {
"m_fm_overshield",
"m_fm_volatile",
"m_fm_devour"
}
local selected_enhancement = void_enhancements[math.random(#void_enhancements)]
return {
set = "Enhanced",
area = G.pack_cards,
skip_materialize = true,
no_edition = false,
enhancement = selected_enhancement
}
end
end
Well I managed to spawn my mod-specific Enhancements for my mod-specific booster, but for some reason they don't come with random Editions or Seals, anything I'm missing?
it will always work but it may display the wrong value
so you just call the function when displaying
sometimes i wonder if i can somehow make all of those stats work in balatro context
💀
The fact that I can use os.date in lua means I can make a joker doing extra things during specific days like Christmas or New Year or someone's Birthday.
jolly jimbo actually being jolly
someone should make a mod where a joker can be eternal and perishable
That's just an un-sell-able perishable.
yes
I tried to start_dissolve() some cards and they got shuffled away despite being destroyed
\
they aren’t dead unless you observe them
this is basic quantum knowledge
dang
i would tell you but i’m not a quantum physicist
we r graduating harvard with this one 🗣️
Remove = true in the event or the return?
i graduated from mental institute
try return first
then in Event
average mod testing experience at this point
i did 😭
Hmmm still doesn't work
bro got that 0.4% chance 🙏🏿
how can I modify all probablilitys like dice?
0.004 CHANCE
i keep getting blueprint/brainstorm for my first shop whenever im testing 💀
nope, just 0.4444444444%
you forgot to multiply that by 100
i suggest u read the oops all 6 card source code since idk
^ i concur with the guy above me
oh fun fact
i played a 5 lucky cards hand once and got $20 four times in a row
my friend legit started beating me up for that
😭
I know how to get the source code, but how do I find that specific part? If I search "oops all 6" 202u3094273047234 things pop up
impossible
which is 0.001975308642%
lol
i didnt even have oops, all 6 joker
search "doubles all "
thx
it will point you to loc_var ig
nah but his luck lowkey sucks
😭
saw him breaking a hand full of glass cards before
1/4^5
0.09765625
who is playing 5 glass cards tho
if u could why Not
gotta be hella deep in endless
my friend, he got sock & bussin + photochad
more chances to break
better to play the minimum required to beat the blind

I checked in all main files 😭
All 0 results
the exe*
the exe file?
yeah
oh alr
shouldve been more specific, my bad
lemme find rq
I got 10 min before school 🙏
oh WTF IT WORKED
Just tryna get started
this is truly magic
its G.GAME.probabilites, thats so obvious 😭
nah i get you 😭
don't even need to extract the game - iirc Lovely dumps all game lua files inside its folder?
local table = {
["mama"] = "yo"
}
for i,v in pairs(table) do
--i in this case is "mama"
end
oh yeah, true
didnt even know u can js
NONCHALANTLY EXTRACT ALL FILES
FROM AN EXE
atleast from a love(englne) game
Not all exes, yea
yh it wont work in other cases
so if I set G.GAME.probabilities = 100 
it will work, yes
Joker idea 
you basically did the cryptid mod
🙏🏿
but more op
wouldn't that fuck up the table though
yap yap yap
a lot, but its funny
aint no way bro just did that 💀
safely would be go through the probabilities and set them to 100
But I aint doing allat
Oops! All Errors!
see you in 5 minutes when you can't fix game crashes 
"if balatro crashes, you won" 🗣️
i remember seeing that from somewhere
he indeed confirmed in a talk tuah episode
i hope i'm not interrupting, haha, but I've been bumping my head against this for an hour. Does calculate_joker also work if it's called on a card that isn't a joker, like a playing card with a custom enhancement?
im pretty sure not

:(
]:
:¦
what the fuck is that anime mouth, john smods 😭
:x
:ж
bro not again 😭
even more snitched mouth, crazy :^
i feel like im the only person here with a pc whose ram is not sufficient to even run balatro 💀
how much u got
8 gb ram
yikes
surely aseprite cant eat that much ram
I mean Balatro will never use more than 2
it physically can't, at least in lua land
So it's technically capped?
As in, capped by technological sense.
metamorphically capped
lol
asesprite is also capped at 2, as far as i know
probably my opera gx then, my bane of existence
i keep getting an error saying card:juice_up() isn't a thing even though i keep seeing things use it??
You might had called the juice_up function on a non-card object?
That's my first thought.
should i be concerned if my jokers.lua is almost 2k lines now
how much Jokers in there
this is probably enough to feed everyone in italy ngl
287 lines per jimbo
Some vanilla file got 3k. You're fine.
LobotomyCorp's localization file is 3000 lines still got a long way to go
dang
it shouldn't be,, it should only be called by the joker
i copied a lot of my code from the example mod's gros michel copy
check if the card even Exist or smth or if its an table/array with cards
instead of cards themselves
As always, show your code here.
(preferably by screenshots)
what is this code trying to do
think when card is destroyed it eats it
destroy the first hand if it's only 1 card?
yea like dna but it destroys the card after scoring
holy crap my eyes 😭
probable
Notepad++ gang
it'll also add a x0.25 mult to the joker when you do it
np++ has dark themes smh
nah but honestly i used to code on visual studio (not code) so probably fine ❤️
i did get it all working but now i'm rewriting things trying to add juice
did u make mods for unity games
nope
this should work
if context.destroying_card and #context.full_hand == 1 and G.GAME.current_rounds.hands_played == 0 then
card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.gain
return {
remove = true,
message = 'blablabla'
}
end```
just that i had visual studio installed on my pc
so, then why the visual Studio
don't know why you're trying to do it all manually
so i started using it
the problem is adding the juice, not the functionality
not even bothering to check its not even vsc to begin with
man
the reason why every single line in my file is misaligned actually 💀
had to manually space them out
what do yo want to juice?
this was the code before i tried adding juice
-# (spoilered bc light mode)
visual studio kinda goated tbh..
in fact, just do message_card = card in the return table
that's what i've been trying,,
nah fr
which card do you want to juice?
Maaaybe show us your error message as well?
i appreciate the thought behind the spoilering honestly 😭
only bc you made a big deal out of it before,, ,
nah don't spoiler, let them suffer
i code in Microsoft Word
crazy work
your ass just copied that code inside word
nah let him cook
custom syntax highlighting
make it authentic
what card do you want to juic
what does this exception mean?
for i = 1, a do
that "a" probably isnt a number
it means that the end condition for a loop should be a number
means you incorrectly returned a value in your jokers
the joker
at what timing?
timing?
oh dang
yeah, when do you want it to shake
as it destroys the card
nah but rq, this surely cant be the only way to do this right 💀
"feetEffect"
x0.1 mult, too smelly
no event jank is going to make that work
At this point you should just build a table in loc_vars before returning it.
can u technically put wait XDDDDDDDDDDDDDDDDDDDDDDDDDDD
true
?
bro is out here creating an Exodia set 
you would be surprised by how close i am to achieving that
The event queue will go calculate which cards to destroy>evaluate effects returned by jokers here>destroy cards
in fact there's a step inbetween there still
make it so it turns them glitched or some other weird effects if you create it with 2 left arms or something haha
What would the effect of the actual Exodia be in Balatro, though?
well, it only destroys a card when one's played in the first hand, like dna
it turns the game into a yugioh match going forward
naninf naninf
this chunk of code is being run repeatedly, what am i missing?
if context.end_of_round and not context.blueprint and not context.repetition then
card.ability.extra.current_mult = card.ability.extra.current_mult + card.ability.extra.mult_scale
card.ability.extra.mult_scale = card.ability.extra.mult_scale + 1
card_eval_status_text(context.blueprint_card or card, 'extra', nil, nil, nil, {message = localize('k_upgrade_ex')})
end```
wins the run
❤️
theres an exodia card which eats up pieces to increases its attack
"Wins every round from now on" Yeah but kinda boring.
ye, but it makes the most sense
the pieces disappear and you do a 2 hour long bossfight with jimbo
oh wait that's my mod
brother this is NOT apoc bird 😭
i would open my browser to search for that card
but
unfortunately, everything will crash if i do
(not even joking at this point, send help)
im trying to return hand_chips as chips given by a joker but it crashes when using talisman. How can i make it compatible with talisman?
error?
What about "Sacrifice random one of five pieces to save you from death"?
where?
Ah, yes, classic talisman behaviour, changing numbers into tables to break the technical limit.
oh yh mb
Yeah, who the hell codes on that stuff 
wait
could u technically
write code in roblox studio then port it to .lua balatro mod
probably?
better than microsoft word
better than notepad++
get a useless code and a bunch of error suggestions since ur doing smod.joker {} and not smod.joker = {}
oh wait, it actually works
much different Lua version
thats gonna save a lot of my time
something that would be syntactically correct in luau could fail on luajit
and vice versa
for instance, a += 1
screenshot's mostly just for some context. Trying to figure out a way for a joker to trigger the calculate function on enhancements. At least, in a somewhat simple way. I'm not really making headway in trying to think of alternative ways to do this in a way that's not going to result in me writing some truly terrible code
yup
that was my first crash, genuinely thought that worked 😭
i wish it did
wait += doesnt work?
i keep doing this and sighing when balatro crashes
😭
In lua, unfortunately, no.
it doesnt
this is so sad
alexa turn on despasito
lua developers writing variable = variable + 1 instead of variable++
why do you need the enhancement's calculate function?
instead of variable = variable + 10, why not do:
variable++
end
would save so much time smh
so true
js add 10 and set the variable to be a constant smh
man I wish += was a thing in lua
the sci-fi enhancement upgrades it's chips and mult when played. That all works. That joker, when triggered, upgrades all sci-fi cards in hand.
(bump)
instead of using math, just use math.random, let god decides the number instead ❤️
and it's set up to use your custom context?
ur joker is running in all other context when they are in end of the round ig
I'd just add a bool check if it's run already
probably context.individual?
idk
im bad at guessing contexts 💀
will try that :D
(wait what is context.individual for again 🗣️)
each card scoring
update your smods and use if context.end_of_round and context.main_eval
oh damn
as in, that card should recognize my custom context? as far as I know, yes, though regardless, even if I check and give it other context, it doesn't trigger at all
can you show the enhancement calculate?
wifi crashed
Unrelated to your question, you don't need to check context.repetition when context.end_of_round is already true.
trying this now
(gotcha :D)
was just grabbing it!
print("TESTING - ")
if (context.cardarea == G.play and not context.repetition) or context.sci_fi_upgrade then
-- Sets values, as upgrade should happen after scoring
card.ability.times_upgraded = card.ability.times_upgraded + 1
card.ability.mult = card.ability.mult + card.ability.a_mult
card.ability.bonus = card.ability.bonus + card.ability.a_chips
card_eval_status_text(card, 'extra', nil, nil, nil,
{ message = localize('k_upgrade_ex'), colour = G.C.CHIPS })
end
end```
its the same without it i was jst trying stuff
and bignum is a way of having numbers bigger than 1e308
no what does it do, like does it modify chips?
is it a built-in function?
okay cool, just drop a SMODS.calculate_context({sci_fi_upgrade = true}) instead of the loops in if is_same then1
its originally like this
i used it as a way to store hand_chips
this happened after attempting to update SMODS
start a new run
fair ^^"
aight, gonna try that out, thanks! I knew I should've looked deeper into the other calculate variations, haha
oh uh. Talisman works, but i can't access my other mods
what does mod_chips do tho
if it expects a number then it will not work with talisman
mod_chips is a vanilla function
what im saying the code does not containt mod_chips in the first place. The first image was me trying things
does storedchips appear in the loc_vars?
bcuz it expects a string or a number not a bignum(a way to store huge numbers using tables)
yeah
xx in vanilla and xx.00 in talisman
yh i think u might have a problem with that
i dunno how to get arround it though
talisman converts numbers into bignum's which are tables
well how would i fix the issue
found my problem ^^"
don't use talisman 🙃
uhhhh
ig u can check the uhhh
talisman source code
to see how it converts the score
to a bignum/string that u can read
nah talisman has some functions to make the score readable
do you need talisman though?
yh and apply it to storedchips
so taht u can read the chips 🧠
i mean otherwise the mod would be incompatible with mods that require talisman
I'm just trying to get mods not to require talisman
js dont get chips bigger than e308 🧠
hmm, now Train Station is broken
local igo = Game.init_game_object
function Game:init_game_object()
local ret = igo(self)
ret.current_round.train_station_card = { rank = 2 }
ret.current_round.fainfol_card = { suit = 'Spades' }
return ret
end
function SMODS.current_mod.reset_game_globals(run_start)
G.GAME.current_round.fainfol_card = { suit = 'Spades' }
local valid_cards = {}
for i, j in ipairs(G.playing_cards) do
if not SMODS.has_no_suit(j) then
valid_cards[#valid_cards + 1] = j
end
end
if valid_cards[1] then
local chosen_card = pseudorandom_element(valid_cards, pseudoseed('fainfol'..G.GAME.round_resets.ante))
G.GAME.current_round.fainfol_card.suit = chosen_card.base.suit
end
if G.GAME.current_round.train_station_card.rank == 14 then
G.GAME.current_round.train_station_card.rank = 2
else
G.GAME.current_round.train_station_card.rank = G.GAME.current_round.train_station_card.rank + 1
end
end```
crashes because calculate_context is nil, but I do think that's a good lead to make this work, haha. I'll try and look around in the code to see how calculate_context is properly used another time, when I'm not feeling my brain turn off, haha
what smods versiion are you running?
1.0.0~ALPHA-1304a-STEAMODDED
We're already at like fourteen hundreds right now, iirc.
do yourself a favour and don't develop on oldcalc
old calc sucks
haha, damn, i don't even know how i'm so behind. I think I may have accidentally swapped the version out when switching between mods for developing and playing, haha
whats the difference between oldcalc and newcalc
the calc function?
almost everything to do with calculation
i have no clue how I did that, haha, I'm quite impressed with myself there, honestly. The version that I got from the github page is definitely the most recent one. That's good to call out, though, I wouldn't have even considered being out of date because of that
anyway, that should work fine on newest versions
just tried it, definitely does! thanks so much, haha
means I can finally properly use this guy, instead of just having him stare at me in tarot packs
hey, im new to modding and im kind of lost, im unsure of what folders to add and how to order them, like a jokers and cosumables folder and a basic layout would be nice thx
any way to get the current scoring card without going in a loop ?
well, it kind of does what I want it to do , but not quite;
I want to make it so that every scoring heart is turned into a wild card, but for feedback sake I want it to be only when the card score (when it scores the chips) but it just instantly turn every heart card into a wild card the moment I play them
and for some reason it always happen, even in a loop, I might just be stupid
is there a way to make the use button not appear when you click on a card
I don't really have any reason for the use button for these cards specifically
also just noticed it's behind the other number lmao
On a joker, is it possible to get G.GAME fields outside of the calculate function? Like if I wanted to set the xmult based off of the number of times a specific hand is played instead of a basic increment? Or am I going about that wrong?
you can check how many times a hand has been played inside your calc function, yeah
Behold, my version of Exodia. (just background) (if you know, you know)
ooh love that colour scheme
is that a jojo reference
No, this is Patrick.
No, this is hololive 2nd generation.
oof, the first and second backgrounds lowkey remind me of soft and wet & sticky fingers lol
How do I spawn vanilla jokers? SMODS.add_card() gives me a attempt to index local 'center' [a nil value] error
SMODS.add_card({
set = "Joker",
key = "j_showman",
area = G.jokers,
})
It's j_ring_master
how do i stop a joker from appearing in the shop?
Should probably look at the code for Gros Michel and Cavendish for that
use the event manager (https://github.com/Steamodded/smods/wiki/Guide-‐-Event-Manager) to sync with the game properly
add an in_pool function to the center that returns true if you want it to be in shop and false otherwise
the center?
@hardy viper are you on Windows by any chance?
set_ability actually has a delay_sprites arg that should do all the timing automatically
@wintry solar after using the new select_card thing for packs, after picking the first card out of the pack, the other ones go back to saying use
You wanna try the mod manager?
im down yeah i won't be at home for several hours though
Huh, will do some experimenting on my end
So you're currently not at home?
yeah
Ahh hit me up when you're home and I'm gonna send you a copy
also, whenever I select something it adds two, but one isn't actually there
that might be something on my end tho
the scuffed stuff is still there lmao
Oh definitely get rid of the scuffed stuff
Does anyone have suggestions for good mods to look at for help with coding, mods that are more up to date? I keep trying to look at mods only to find out that the code on them hasn't been updated in forever and thus is only barely supported by steammodded
yeah that was it lmao
the use thing still happens tho
debugplus
it helps with debugging
are you asking about mods for helping to write code or mods to look at for examples?
not cryptid
Yeah I think I know why the use button comes back, should be an easy fix
huge
Oh he meant example mods
I would recommend ortalab but I am biased
Examplejokers still needs properly updating to new calc
the most recent mod I can think of is Maximus (https://github.com/the-Astra/Maximus), I have some I wrote not too long ago as well (https://github.com/rae-vyn/calling_cards)
so, i shouldn’t be using oldcalc to develop mods?
no, not really
i really wanted my mod to be able to work alongside cryptid
i meant more mods to look at for examples
i keep going "maybe i should look at this mod that could be interesting" and then seeing whoopsthat mod was made for smod 9.8.7 or whatever
cryptid is one of the main reasons why i wanted to get into modding balala
balala the sequel of balatro, that mobile game?? 😭
Then download the refactor branch of cryptid
no, that’s joker poker - balala
I've been trying to find balala since I need to see what that could possibly even look like
it's so funny that they called it "balala"
fr
now i cant stop calling balatro balala
ive only seen it on yt honestly
balitro
bulutro
billtor
baltron
@maiden river fixed
thanks
trying to make a joker that upgrades for every 3 in hand.
this code just doesn't upgrade by any circumstance
anyone that can help?
Replace the card = self by card = card
it upgrades the card i think, not the jikor
jokir*
card in calculate refers to the joker
Is there an easy way to have a joker reset a value after a boss blind? only thing I'm finding on the SMODS.Wiki is counting to three when a blind is won and resetting then.
Look up the code for Campfire
ykw I forget about that joker a lot :P
thanks!
also update smods
didn't do anything
do u want to upgrade the card or the joker itself
joker
hi sorry again, my code isn't working again =w=
chips and chip_gain
if context.joker_main and card.ability.extra.current_mult > 0 then
return {
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.current_mult } },
mult_mod = card.ability.extra.current_mult
}
end
if context.end_of_round and context.main_eval then
card.ability.extra.hands_used = 0
if card.ability.extra.hands_used == 1 then
card.ability.extra.current_mult = card.ability.extra.current_mult + card.ability.extra.mult_scale
card.ability.extra.mult_scale = card.ability.extra.mult_scale + 1
card_eval_status_text(context.blueprint_card or card, 'extra', nil, nil, nil, {message = localize('k_upgrade_ex')})
end
end
if context.cardarea == G.jokers and context.before and not card.getting_sliced then
card.ability.extra.hands_used = card.ability.extra.hands_used + 1
if card.ability.extra.hands_used == 2 then
card.ability.extra.current_mult = 0
card.ability.extra.mult_scale = 1
play_sound("bfdi_snowball_no", 1, 0.25)
return {
message = localize('k_reset'),
colour = G.C.RED
}
end
end```
could someone be a dear and check over it for me please? ^^"
no like copy the full line of it
i suggest you do
if context.individual and context.cardarea == G.play then
if context.other_card:get_id() == 3 then
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_gain
and add the debuff check ye
card.ability.extra.hands_used = 0
if card.ability.extra.hands_used == 1 then
that if will never be true
can you screenshot the entire calculate function
instead of returning mult_mod you can return mult only and it'll automatically make the message for you (assuming you're in a recent version of steamodded)
last thing, instead of using card_eval_status_text, just return { message = localize('k_upgrade_ex') }
and what happens currently when you play a 3?
just realized i forgot to change mult_mod
it upgreades when I play a 3 but I want it to upgrade for every 3 held in hand
okay it's working great, thanks!!
i was going off of the code for baron and shoot the moon and they were in G.play
G.play is played cards, G.hand is what you want
also question for the modding community, if you ever decide to try and refer some code from MTJ could you @cedar stream if there is anything i could clarify better on? as i tend to refer people to look at the mods code and i dont want to make things more confusing for them
they're in G.hand
what is mtj
they freezed the jimbo
oh
what context is used for "when this card is played/discraded"?
whats the effect?
When this card is scored/discarded, draw 2 cards
(on top of regular 1 card draw for used card)
you just need to add the discard context then
for balatro's artwork what's the pixel bit size? 32 or 64?
Ive added it and it still does nothing (literally)
it did nothing before as well
no crashes at least
are you talking about number of cards it should draw?
or table is your deck?
oh right I forgot about that
I only added loc vars and put num of cards in it instead of config
my b
can someone help me figure out whats wrong?
my pt_BR isnt being recognized and garlic_bread is displaying nothing
in en-us
the keys seem to be right too
why is there no file extension?
on the localization files?
i think theyre hidden when i look then in other peoples mods
like, its implicit
so i missed it
so starting with this as a base, how would I get the chip value and mult value of a played hand?
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.chipStorage, card.ability.extra.multStorage } }
end,
calculate = function(self, card, context)
if context.before and context.cardarea == G.play then
end
end```
oh that was not the problem
i just straight up forgot to put = before the brackets
(also what file is the code for decks stored in? I'd like to take a look at Plasma)
how does one level up a poker hand ? i checked the games code too and i cant figure out
they should be stored in "hand_chips" and "mult" global variables
How does a joker override a variable of another? Like how "Oops All 6's" can override the chances values of Space Joker and other probabilities? Or should I just look at the code for those?
there is no overriding, oops all 6s doubles the values stored in G.GAME.probabilities, which other jokers use in their probability calculations
Okay so something like this should be good?
Alright, let me rephrase closer to my desired effect.
I made a joker that bases it's xmult off of the times a specific hand has been played. When using Showman, I can buy another, but the initial display value for that xmult is the default value (x1) instead of the increased value based on the hand.played count. How do I make it show the proper xmult in shop even before it's bought?
A better way would actually be to check local hand = G.GAME.hands[context.scoring_name] and then you can access hand.chips and hand.mult
the rest of your code seems like it's not actually doing anything
ahhh
or rather
you're correct, it did not do anything
you can achieve the same effect by returning return { swap = true }
add a set_ability function to your joker definition where you can set the initial values
keep in mind set_ability will be called when you open the collection outside of a run too
ah, makes sense. thanks
hm, that doesn't seem to have fixed it. still not doing anything
well the message isn't popping up either
Try removing the context.cardarea check
that did it
nice
oop
but it reverts as soon as scoring cards starts
wow thanks OBS great frames
hopefully this shows it better
yeah as soon as it hits a scoring card the swap gets undone
that's odd
that's why
"before" context happens before the actual mult and chips are set to the hand's amount
ohhh
I'm not too familar but I don't belive discard and main_scoring can be active at the same time
loc vars is wrong
so ideally I want to set it to like, the context right after, or?
you might have to make your own context for it
should be relatively easy if you know how to do lovely patches
I barely know what I'm doing here
, weird workaround time probably
yeah you'll need your own patch for that
Got this error now:
Oops! The game crashed:
game.lua:2733: bad argument #1 to 'push' (boolean, number, string, love type, or table expected)
Additional Context:
Balatro Version: 1.0.1n-FULL
Modded Version: 1.0.0~ALPHA-1404b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.7.1
Platform: Windows
Steamodded Mods:
1: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.3.1, Uses Lovely]
2: Item Remover by elial1 [ID: ItemRemover, Priority: -1]
3: HD by Kars [ID: HandsomeDevils, Version: 1.0.0]
Lovely Mods:
Stack Traceback
(3) LÖVE function at file 'boot.lua:352' (best guess)
Local variables:
errhand = Lua function '(LÖVE Function)' (defined at line 553 of chunk [lovely debugplus.console "console.lua"])
handler = Lua function '(LÖVE Function)' (defined at line 553 of chunk [lovely debugplus.console "console.lua"])
(4) method C function 'push'
(5) Lua upvalue 'gameUpdateRef' at file 'game.lua:2733'
Local variables:
self = table: 0x3e576360 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x3ed34518 (more...)}
dt = number: 0.0060379
(6) Lua method 'update' at Steamodded file 'src/ui.lua:84'
Local variables:
self = table: 0x3e576360 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x3ed34518 (more...)}
dt = number: 0.0060379
(7) Lua field 'update' at file 'main.lua:996'
Local variables:
dt = number: 0.0060379
(8) Lua function '?' at file 'main.lua:935' (best guess)
(9) global C function 'xpcall'
(10) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '?' (defined at line 906 of chunk main.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"])
you should be able to target mult, hand_chips, modded = G.GAME.blind:modify_hand(G.play.cards, poker_hands, text, mult, hand_chips) that line, and put your context before that
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "mult, hand_chips, modded = G.GAME.blind:modify_hand(G.play.cards, poker_hands, text, mult, hand_chips)"
position = "before"
match_indent = true
payload = "SMODS.calculate_context { after_before = true }"
this is how I'd do it, I just named it "after_before" cus I lack imagination, but feel free to change it
ohhh, alright so where would I put this?
Mods/your mod name/lovely/<whatever>.toml
yeah should be, or do context.area == G.pack_cards
hmm
what I currently have written makes it never trigger at all
even when using from a booster
context.consumeable.area == G.pack_cards just makes it work like it did before
context.area == G.pack_cards makes it never trigger as well
correct?
yep
and then I can just, do context.afterbefore?
context is equal to what is after SMODS.calculate_context there
so context is just { after_before = true }
and no other information
if you want smt else you'll have to add it
yeah I mean putting it into the card, just
did you update smods
I took most recent source, I can try again though? maybe something failed
what version?
👏 nice!
1410c
huh, should work fine
Hi I've made a button appear when a specific card is added to deck, but how would I go to remove it when that card is removed?
add_to_deck = function(self, card, from_debuff)
G.GAME.current_alignment = 'thief'
G.GAME.extra_buttons = UIBox {
definition = {
n = G.UIT.ROOT,
config = {
align = "cm",
minw = 1,
minh = 0.3,
padding = 0.15,
r = 0.1,
colour = G.C.CLEAR
},
nodes = {
{
n = G.UIT.C,
config = {
align = "tm",
minw = 2,
padding = 0.1,
r = 0.1,
hover = true,
colour = G.C.ALIGNMENT['cs_thief'],
shadow = true,
button = "cs_access_stack"
},
nodes = {
{
n = G.UIT.R,
config = { align = "bcm", padding = 0 },
nodes = {
{
n = G.UIT.T,
config = {
text = localize('b_cs_stack'),
scale = 0.35,
colour = G.C.UI.TEXT_LIGHT
}
}
}
},
}
},
}
},
config = {
align = "tr",
offset = { x = -11, y = 0 },
major = G.consumeables,
bond = 'Weak'
}
}
end,```
G.GAME.extra_buttons:remove() in remove_from_deck I would imagine
hmm, print(context.consumeable.from_area) under context.using_consumeable prints a MASSIVE table? is this normal?
worked, ty
I really wish I knew what mod keeps messing with negative playing cards and hand size,
yes it's a card area
can you show what your current code looks like?
full joker or just the calculate function?
just the calcualte is fine
I have no idea why that doesn't work
How do I check if the played hand contais the most played poker hand? I've seen next(context.poker_hands["Hand Name"] but can't figure out the rest
I don't know how lua compares tables, but if the card is removed right after wouldn't they be considered different
how would i stop a card from being destroyed
specifically a playing card
like you use a hanged man on it and it doesnt get destroyed
it should just be a reference to the table
is it possible G.pack_cards is just a table of the cards in the pack and the actual cardarea is something else?
this was definitely working earlier, why on earth is it broken now
oh what why is this patch missing now
okay it's fixed now
oh right
it works perfectly now, thank you
update on this thing that I'm making
for some reason even thought I set the extra value to be 2 and only 2 the game is adding it to the "perma_bonus" value multiple times in a row and I can't find a way to stop it from happening
does anyone know how to fix this
borrowing from Oops' code, tried subbing the v*2 it uses for doubling the probabilities with a v + 1 to just add 1, unfortunately, doesn't work, wasn't totally surprised but would there be a way to add a flat chance increase?
(I did fix the for loop end formatting, didn't have an effect
So ive tried to revision the code referencing cement seal by Minty but the seal itself still does nothing in game:
main_scoring and discard don't happen at the same time
put this in add_to_deck instead of calculate
(also this will interact weirdly with oops)
So I should split them into 2?
one if statement for each?
or you can do if (context.main_scoring or context.discard) and context.cardarea == G.play
well when I make it a * 2 to check, it works in calculate.
Or do you mean for doing a flat boost, it has to be in add_to_deck
yeah oops effect is done in add_to_deck (and remove_from_deck to undo). In calcualte it will just add anytime there is a joker calculation
now game crashes, ig the next issue is in the function itself
is G.FUNCS.draw_card... is a custom thingy?
I copied it from Codex Arcanuum
but also yeah with this effect and oops you can get this to make prob 2, get oops to make prob 4 remove this to set probabily to 3 remove oops and now your probability is 1.5 without any probability jokers
card.ability.extra...
or oops first > 2 this > 3 remove oops > 1.5 > remove this 0.5
how do I write in an add_to_deck check? Haven't done anything outside of calculate and the source code is a bit hard to grasp
it doesn't need checks unless your effect shouldn't be run when undebuffed (which for oops it should)
ah no I mean, how do I replace calculate with add_to_deck
I dont get it. I pasted it in all places it could be placed in but it still crashes
okay that's how to write it, right right
what does the crash say
one sec
whats line 13?
loc vars (return)
like so?
oh I should put the rounding step after the subtraction
readd your seal on a new run
it crashes!
even in collection
either when I hover over the card that has it applied
or in collection
this scenario will still happen even if you round it @graceful magnet
sure does. weird
it's not weird, it's just how the order works
it's probably why the base game doesn't have any that add to the probabilities
the math gets funky
you'll probably have to patch oops all 6s
grief, how would I go about that
you could replace g.game.probabilities with something using metatables for maximum compatibility but that's Annoying As Heck
What's this, game picks two bosses and you can switch between them at will?
fun
really looking forward to ortalab when fully featured. There's some really fun ideas already
yo I still need some help with this issue
it'd be a cool mechanic if you had a button for big blind to 'raise the stakes' turning it into X2 Boss blind with a double $ reward
mb a new stake difficulty could force this mechanic each ante
that'd incetivise skipping blinds
it's getting pretty close now
what's call and check?
Yo what?? That sick!
call and check are alternate small/big blinds in ortalab
just discovered that probabilities can't go below 1 so I might actually just keep this effect as is
oh boy I'm gonna have to figure out how to make a new card area soon. Does anyone know of any mods that have good examples of card area implementation?
or honestly just make it +2 lol
damn lol
Trying to do a dynamic description background, like a {X:mult} that switches on/off using loc_vars, I've kinda hit a wall though and after looking at misc_functions I've come to the conclusion I need to make a nasty patch for this tiny thing... anyone got a quick solution?
this was fun to do
iirc there's {V:whatever} templates for that
not super familiar with the specifics, though
Ah but V only does text color, not it's background
Could you still show me a template?
Bettma was a good starting point for me
Bet, thanks for the tip
What's the mod that organizes jokers called so I don't have to deal with this 💀
not an easy example, but the planets in vanilla use it
Oh, I see
it's actually not that hard
it's just kinda confusing
what is this part doing
is there a way to tell a joker to fully re-render itself, or at least re-render the description?
What is card.ability.loyalty_remaining? I was looking through invis joker's code (I'm trying to make a similar joker) and I'm trying to figure out what it means since it keeps crashing my game
setting the perma bonus to itself or zero if it doesn't exist
you could add an entry to G.ARGS.LOC_COLOURS and reference that
id assume the number of rounds until loyalty card activates
loyalty card is a card that only procs every 6 hands. It's probably the counter for that.
brilliant! thank you :D
I tried removing that part but it's still adding to the "perma_bonus" value multiple times
Cartomancer
🙏
I'm looking at code for one and I see that now lmfao
have fun 

added a dynamic color and it worked like a charm!
OOPS wrong react, sorry! ;^^
im trying to add a consumeable to a challenge but it crashes with the error "attempt to index local 'center' (a nil value). im not sure what im doing wrong ?
maybe c_hanged_man?
oh! it works now, thanks :]
trying to make a stake mod, and I'm having some trouble. I cannot for the life of me get it to the state where it even boots the game 😭 isn't this (prefix config key false) supposed to keep it from checking mod assets for the atlas so that it should check the base game assets? I had to do digging through the discord to attempt to find info on this, the stuff listed on the api wiki is said to be outdated here on discord and I'm starting to feel like I'm going nuts trying to figure out what I'm missing lol
you don't need to create atlas for the vanilla ones
they're the default on their respective objects iirc
so just specify a position
ok I think I understand maybe
what's the best way to check for if a joker is destroyed? I wanna make a joker that upgrades when that happens
I keep running into an issue when I try to use SMODS.create_card() where it keeps throwing attempt to index local 'center' (a nil value)". Anyone know why / a fix?
it also gets thrown when I tried to start a custom challenge run with my new consumable (I use custom challenges for debugging)
what's the equivalent of this for glass?
or how would I change local card = Card(G.play.T.x + G.play.T.w/2, G.play.T.y, G.CARD_W, G.CARD_H, front, G.P_CENTERS.m_stone, {playing_card = G.playing_card}) (from Marble Joker) to create a Glass Card instead
m_glass
okay cool figured
I've spliced together Glass Joker and Marble Joker's code, hopefully this does what I expect??
anyone that can help me?
Nope doesn't trigger at all
kk
okay that's
that's something!
mama mia whata i doa wrong
okay now it mostly works as intended
Remove the = sign
you don't want to reassign SMODS.Sticker
I have this code right now but it doesn'y do anything
destroy_card is a context used for checking what cards need to be destroyed
there is no built in context for jokers being destroyed
ohhh ok
got a problem here, the card is properly being upgraded when i buy things but the upgrade message doesn't get displayed, could something be blocking it or did i mess something up?
how might one disable a joker
bad at lua but does the second "end" need a comma
should have said this earlier but the game keeps saying that the value "extra" is nil for some reason
extra should be a table cos thats what the game expects
then you put your variable inside that table
at least in my experience thats the correct way of doing ot
wdym by that
how do I do that
oh wait I know what you mean
no it should be extra = {var_name = 2}
o
then you access it thru card.edition.extra.var_name
gonna sleep now but would preciate some help figuring this out cos the logic is otherwise functional and it's a bit annoying having no visual feedback for when the joker upgrades
tag me and i'll see it tomorrow
i wanted to add an "upgraded" message to my function but it seems that it removes the ability for it to trigger on each card ? (it was working fine before adding the message part)
essentially i want it to show "upgraded" for each time a card is destroyed and buffs the joker up;
replace the return with SMODS.calculate_effect({message = localize('k_upgrade_ex')}, card)
it works! thank you!
hihi, how do you subtract money as part of a joker ability?
return dollars = -X
gotcha, thanks :D
tried that and it still didn't work
what now 😔
(only happened when i looked at the sticker in the collection)
should be card.ability.extra.upgrade
why does context.full_hand no longer work with context.discard? (im using calculate in a seal btw)
it's not a card it an edition
how do i check if a card has a specific seal on it when scored?
just do it
just make sure it exists first, there's a call to seals of just {discard = true}, I think for vanilla functionality
nope it still crashes
in the loc vars too
oh wait nvm
I can't read
(:
can you send the entire edition code?
i'm not sure its working
ya
did you do if context.full_hand first?
and if you change it back to card.edition.extra.... what's the crash?
still an issue, i did smth wrong with the badge colour i think
badge_colour = "84FF57"
should be badge_colour = HEX('84FF57')
guh
that worked
ok I'm learning my first joker creation stuff, so after reading back some messages to see if some of my issues have been solved before, I've seen a lot of references to ModdedVanilla, is that defunct now? it's not in my smods-main folder
ok good news it actual works now tysm
bad news I'm still getting the problem of the chips getting added multiple times in a row instead of just once
which was the problem I was trying to fix in the first place so I'm essentially back at square one
i return once again with another conundrum, my fellow fools
why it no unlocked I set it to unlocked after white beaten I can't test it >:(
(also when I try to use galdur with it it crashes telling me atlas is a nil value so that's fun)
how can i make this add a repetition to the first card after it already scored?
what do you mean?
so whenever you use a playing card with this edition on it it's suppose to give 2 extra chips similar to the hiker jokers effect
it works the way it's meant to but instead of giving 2 extra chips it gives 4 extra chips
Trying to retrigger cards with gold seals. This code shows the
mesage but doesn't actually retrigger. Is there anyone that knows why?
my only assumption is that it's doing the calculation twice somehow and I don't know a way to fix it
how would I debuff a card that has a sticker, then when a joker is sold it un-debuffs
I see ia lot of people on here saying theres no way to act on unscored cards, could one not just iterate through G.play.cards and context.scoring_hand to figure out which played cards dont score?
Not saying that thats wrong just wondering why you couldn't go about it that way
has anyone made the deck ui show your cards in draw order instead of suit/rank? if not, does anyone know where to start?