#š»ć»modding-dev
1 messages Ā· Page 243 of 1
You should download the mod
my edition keeps flipflopping back and forth between working and not working
Damn
Like my brain
I love when smods patches start failing despite me not targeting these lines with my own patches
argh
maybe they're deprecated?
..................and it crashed
idk why; isnt atlas always a nil value?
always a table, i mean
i mean like which line is like 53, is it the first one i sent or the second one
becuase if it's the first one context.scoring_hand[i].config.center is a table containing a lot of entries, are you trying to get the rank of the card?
I've decided to completely redo my Yume Nikki Jokers
one is used when the smooth setting is on
Tbf, they were a bit generic. I want something more unique for them
each joker is 4 jokers
why does the order field of my new consumeable type begin indexing at 46?
Are you sure you have the small Jokers in the 1x folder and the big Jokers in the 2x folder?
...
You're supposed to have the Jokers in the 2x folder be 2x size
and, can I manually assign an order parameter to them?
is there an array or way to get an array of all jokers, modded ones included?
so, my reverse tarot cards have orders 23 - 44, and my new hand/planet card has order 45, which is why my zodiac cards start at 46
Ideally, I'd want my new planet to have order 13, and my Zodiac cards to have order 1-13
im trying to for loop my way into finding the highest card played, and then see if its a wild card
Does anyone know a way to destroy a random joker card after a round?
look at the code for Madness, and just change the context for when it activates
oh god oh fudge
The humble multi jokers:
I've tried looking at its code, but I can't find anything on destroying other cards, is it in card.lua? or some other source code?
WHAT DID I DO I MADE IT WORSE
wrong sprite size in your atlas definition, probably
I SUMMON SPRINTER, THE FORBIDDEN ONE!!!
i see, ill tkae a look
yeah should be card.lua
Odd, I guess I'll look again, maye I missed it
does the atlas take from 2x or 1x again?
1x I think
i see
the sprite size should be 71 x 95
depends on smoothing i think, for me its always 2x for some reason, but update both
if somebody else has a better solution
Gotcha
would be greatly appreciated
Hello, good people. Are there any functions that do the same as set_edition but for enhancements, seals and stickers?
I think I was missing the pools field...
then instead of .config.center, use :get_id()
thatll give you the rank of the card
When your function returns, add remove = true, card = [card in question],
to the return table
well that didn't fix it
how complicated would yall say making 1 joker is?
ive heard Lua isnt exactly fun to deal with
Iād say itās a solid hour depending on the concept and picking up a new language relatively quickly
Sorry but, anybody know if I could run another .lua file trough my main.lua file?
I tried using dofile() or require but it didn't work and I didn't find anything online
Idk if what I'm saying makes any sense haha
yk what??
hmm alright
assert(SMODS.load_file('file_name.lua'))()
here is the file, im done, fix it, idc im gonna make morejokers for now
Thank you so much <3
i cant with this
Does it have to be in the same directory?
The file you want to load should be inside the same directory from where you are calling the function.
I assume you can specify the file path though
aight, ty
./folder/file_name.lua
And so on.
Probably works
Should work.
maybe I'm stupid but sadly doesn't
is there any up to date guides for modding? closest one i can find in threads is from like 7 months ago so i doubt its uptodate
Some useful Github links
https://github.com/Steamodded/smods/wiki
https://github.com/Steamodded/smods/wiki/Your-First-Mod
https://github.com/Steamodded/smods/wiki/Mod-Metadata
https://github.com/Steamodded/smods/wiki/calculate_functions
https://github.com/Steamodded/smods/wiki/API-Documentation
https://github.com/Steamodded/examples/blob/master/Mods/ExampleJokersMod/ModdedVanilla.lua
A Balatro Modding Framework. Contribute to Steamodded/smods development by creating an account on GitHub.
A Balatro Modding Framework. Contribute to Steamodded/smods development by creating an account on GitHub.
A Balatro Modding Framework. Contribute to Steamodded/smods development by creating an account on GitHub.
A Balatro Modding Framework. Contribute to Steamodded/smods development by creating an account on GitHub.
tysm
try to read them through, there are sadly no modding guides
yeah i feel the game being in lua is killing the modding scene, the modding scene for balatro is surprisingly small for how massive of a game its become
I have a joker that creates a copy of itself every time a boss blind is beaten, but it always just copies itself infinitely. Is there some stupid obvious oversight im missing
if G.GAME.blind.boss and G.GAME.chips / G.GAME.blind.chips >= .95 then -- Combined condition
print("Condition met, adding event") -- Debug print
G.E_MANAGER:add_event(Event({
trigger = "before",
delay = 0.0,
func = function()
print("Event triggered, creating new card") -- Debug print
local new_card = create_card('powercreep', G.jokers, nil, nil, nil, nil, 'j_pow_powercreep')
print("New card created") -- Debug print
new_card:set_edition({ negative = true }, true)
print("New card set to negative edition") -- Debug print
new_card:add_to_deck()
print("New card added to deck") -- Debug print
G.jokers:emplace(new_card)
print("New card emplaced in jokers") -- Debug print
end
}))
end
brand new to this. Trying to make a joker that gains X0.5 mult every time two face cards are scored (not caring about balance right now) im kind of stuck and not sure what to do from here. I understand what I have currently, but don't understand anything else so far
I enjoyed the cat embeds
Youāre missing the scoring, Face card detecting, and better wording ;P
If youre referring to the description of the joker, Im not too worried about it right now. But im not sure how to add the scoring, and detecting the face cards, which is why I asked here if somebody could point me in the right direction to help me with it
The SMODS wiki can help
It lists the automated calculation returns
And it also lists the context that provides the scoring hand
What does the calculate context function do again?
calculate it used to add things to the total score when scoring IIRC, I think it has more applicable uses tho
I see
Because Iām trying to find out why one specific joker is not working
Let me copy and paste the code and see if anyone can help:
any of yall ever played nuclear throne?
you know the effect when you go through a portal in that game. the background screen
it's like a spiral tunnel
i kinda wanna see if i can get love2d to make an effect like that for a card, maybe to implement for balatro
Iāll look when I get home Iāll be like 5 minutes :)
⦠the file isnāt a .txt normally though right?
anyone know what the extension for steammods in vs code is?
This isnāt an error message, the code isnāt doing what I intended it to do (add mult when a card changes suits)
it was on my end i was on mobile
this is way above my paygrade unfortunately i haven't worked with suits yet
oh wait
a lot of this is context not actual code ok wait
I see
if context.before and next(context.supbal_card_changes_suit(self, new_suit)) and not context.blueprint then
should probably be if context.change_suit then
oh hey n c:
hi
i might have a quick question if this fix doesn't work for me
lemme check if thi works
also you're missing a reference in that hook
... yup same issue, god this is annoying
Hihi!! :3
hihi!
local _card_changes_suit = Card.change_suit
function Card:change_suit(new_suit)
-- Then call the stored reference to the original function so it still works
_card_changes_suit(self, new_suit)
-- Then do whatever we want after (or before if you want)
SMODS.calculate_context( { change_suit = true, changed_card = self } )
end
whats the issue
for the LIFE of me i can't disscern why mult is working but chips are considered a nil value
it do be breaking my brain, care to point out my inevitable newb mistake? X3
did you modify the code in the middle of a run?
no? i've been loading a savestate but i've restarted the game numerous times
well managed to get it to atleast show in game, now to figure out how i'd even make the effect work, i guess i could forcibly tear parts from Canio and Ceremonial Dagger
concept mockup
i could try a new one
what if you dont load from a savefile?
ill try a new run c:
yoo this looks sick
ty
why did this work..,
objects keep their old ability values when you load
you need to restart or get a new instance
its working!!!!!!!!!!!! tysm
i can move on to finally making the joker ability work rather than troubleshooting something i have done on a previous joker LMAO
FYI thereās nothing to detect if Jokers were destroyed in vanilla
Paperback and Betmmaās do it tho
joyousspring does it :3
ah yeah i suppose it wouldnt detect it
How do you do it?
Betmmaās old solution checked for the color of Card:dissolve
Hm. Well, itās not working for the Sigil card which is odd
btw this treats selling as the same so its obviously not a good solution lol
i am not code guy i am art guy
does balatro do anything silly with love2d in terms of rendering
wtf why is my edition breaking only after i apply it to a joker, remove it, and then apply it again?? the original mult should never be changing i cannot find anywhere in the code that would be causing it to change, let alone only after its applied twice
oh shit maybe i should deep clone on this one specific line in the on_remove function
does aiko not do that?? why does it work for them then
or did they just not test as rigorously as me
im art girl, but i also like coding but im not v good
istg if this really is just a reference vs value assignment problem i might lose it
it was a fucking reference assignment issue
Hello. Can anyone tell me if there is a person on this server who understands the code? I am making my own joker and I need to apply a function to it so that it is destroyed with a 25% chance after the end of the round. Maybe someone in the chat made mods and knows how to do this?
https://github.com/Steamodded/examples/blob/master/Mods/ExampleJokersMod/ModdedVanilla.lua this has a clone of gros michel
which has basically the same effect as you're describing
I'll take a look now, thank you very much for your help
michel when gros
if gros, then only michel !!
ok so i think i've fixed big jokers? i can't think of any more glaring issues with them i should solve
though while im debugging them. why the fuck does loyalty card double to every eleven hands instead of twelve
ohh
in the code for some fucking reason
Does the code that makes sigil work not use the āchange suitā function?
it stores it as one lower than it is
and then adds one
???
why does it do that.
can i be bothered to patch it? fuck no!
its staying at every 11 hands
it might be because of the timing of the update, I remember having trouble with that for jokerdisplay
no like its ability.extra.every is 5. why is it 5
man this is giving me a headache
why did i have to pick a complicated effect to start with
i dont know if this is the case but i can guess its so it doesn't trigger early
That is. Really silly if that is the case. Programming oversight?
thats not what i mean
this is my best guess too
depending on how it works i might just be able to handle the doubling of the every variable differently which would be fairly easy
Programming usually also counts starting at 0
not in lua
0-11 is technically 12
Iām going to check the code for sigil, see why itās not triggering
ok it seems like i may have to decide between making Joker Stencil not buff at all or giving literally every joker a x2 mult. fun
sigil uses set_base
I see
ok its making probabilities half as likely again why is it doing that i told it not to
Oh god, how would I even account for that
You could have a ājankā solution of potentially checking how many joker slots you have and subtracting it by 1 to fit when you calculate stencil (I am dumb and do not know how to do it but logically it makes sense)
hook set_base and check if the suit before and after are different
I see
the thing is im trying to double all values. except the default value for x_mult is 1 so i don't wanna double that except for when i do and its so so confusing
thats why i dont do stuff with vanilla jokers lol
if i ever have to im taking ownership and recreating the effects with smods api
damn, Big Perkeo doesn't give two negative consumables
thats a shame
i like perkeo
hey n i have another question
oh damn Driver's License is hard coded to 16 cards
shoot
for why not work? it says it's indexing a nil value
or wait did it say indexing?
i got this from the arm, but it's still quite confusing
handname should probably be context.scoring_name
like in the brackets?
the goal is to level down a played hand c:
i do not know what im doing and the guides really dont help
that's me but in life
i mean they got the joker to display in game sure but it just crashes upon doing anything
so
i wish there was a way to see all the contexts and stuff tbh
i so often need to ask for a certain context
the wiki?
that only has examples though?
no
im like trying to use the modded vanilla example jokers as a guide and even then it wont do anything
i am not a programming guy why did i think this was a good idea
most context are there except some new ones
why the FUCK does 8 Ball literally just store its probability directly to the extra. like literally just extra = 4
that is. so annoying
oh really?
yeah
im gonna have to hard code a case for that
huh
still doesn't help me level down a hand unfortunately
lemme give it another gander
you can try returning level_up = -1
i tried that but it just didn't do anything u-u
What does set_base do exactly ? /genq
changes suit and rank
I see
I have a joker that creates a copy of itself every time a boss blind is beaten, but it always just copies itself infinitely. Is there some stupid obvious oversight im missing
yeah, it's probably calling the calculation of the new ones
what else is it supposed to store? the rank 8? š¤
extra= ball
extra = we ball
fair
n was it really as shrimple as that? do my eyes decieve me?
so would i have to my condition for the duplication to be outside the calculation
you can add a value to the new one so it doesn't trigger that round
i see, what would that look like in practice
when you make a copy you do copy.ability.extra.copied_this_round = true and then you set it to false in context.setting_blind or something
waiiiiit no i cant, it upgrades even when it cant level down the hand
ok sick thanks
although, seeing a lvl 0 hand is hilarious so immna keep that part
im p sure itss a shrimple context change
i would use if context.final_scoring_step then to make a enhancement do something at the same time glass cards break, right?
How do i get the current deck the run is on?
i'd kill for someone to make coding simpler just in general man
like these are helpful to a point but the second you need to do something unexplained, good luck
does anyone know what all the names of variables for colors modifiers in descriptions (the {C:[variable name]} {} things are? I'm working on a tool and part of that is a real time visualizer of text modifiers with colors and I need to have all the base ones in there to get it fully set up. If you also know the hex codes of what the variables are somehow that'd also be amazing
sitting looking at the example jokers lua with tons of lines of code going completely unexplained with 0 notes like:
tyy
what are you stuck on
trying to get literally anything to work beyond the joker appearing
is this inside the calculate function?
im looking at Castle & Cavendish being explained in examplejokers and theres just no notes for what anything does
yes
what do you mean by anything? most stuff is either explained there or on the wiki
and frankly diving into a lua document thats hundreds of indexes long to try and get 1 simplish thing to work is an absurd ask
is there any easy way to change a joker's odds in such a way that the description says, for example, "2 in 4" instead of "1 in 2"? or is that just something that only oops all sixes can do
frankly at this point i just want the xmult to display in the description, i dont even care if the effect works or not, just trying to get it to not display as xNil ingame
oops all 6 changes the base probabilities of everything for that, maybe you can change the loc_vars
i dont even know why its displaying as +nil either
You don't have your local vars defined
you need a loc_vars function https://github.com/Steamodded/smods/wiki/Localization#loc_vars
Because you have a plus instead of an X in front of the #1#
hihi i am once again having a problem, ik this is probibly the wrong context and worded incorrectly but how would i look at the level of the played hand and see if its above or equal to zero
this goober is a problem child
what you did before in the other screenshot but change handname to context.scoring_name
english please
i think the link explains it well
i dont mean to be rude but none of these are actually helpful
i tried that before, but ill try it again c:
ohhh right it says its trying to compare with a table for that line which,,, im still learning about tables ;w;
like theyre helpful to a point but that point is "heres an all at once info dump with no real correlation towards anything any of the code actually does"
all of that correlates to what the code does
And even if it didn't, that mindset is not going to help you with programming
How do i get the current deck the run is on?
guess im gonna stick to art then cause all this is doing is making me want to throw something
now my balatro wont even start without crashing, i dont get how its gotten worse
i dont think im a stupid person but man this is so frustrating to deal with
you might need to learn more basics
like, I'm willing to help but it's hard when people say that they don't understand anything
Hi. I'm a curious person who can understand a bit of coding but never quite put my hands onto it.
If I were to create a mod for personal use to add a few more jokers in the game, where should I start from?
(I already have smods and talisman running)
i'm making my first mod and don't really know what i'm doing, this joker is either crashing or just doesn't do anything (supposed to convert spades to hearts and clubs to diamonds)
SMODS.Joker {
key = 'conversionJoker',
loc_txt = {
name = 'Placeholder',
text = {
"Convert played cards with {C:spades}Spade{}",
"suit to {C:hearts}Heart{} suit and {C:clubs}Club{}",
"suit to {C:diamonds}Diamond{} suit when scored"
}
},
-- This is leftover from the template, i don't know if config is required or not but i left it in just in case
config = { extra = { mult = 4 } },
rarity = 1,
blueprint_compat = false,
atlas = 'jokerAtlas',
pos = { x = 0, y = 0 },
cost = 8,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult } }
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
if context.other_card:is_suit(spades) then
return {
assert(SMODS.change_base(card, 'Hearts'))
}
elseif context.other_card:is_suit(clubs) then
return {
assert(SMODS.change_base(card, 'Diamonds'))
}
end
end
end
}
is_suit also accepts strings for the suit.
First, you need to define card = other_card.
SMODS.change_base(context.other_card, 'Hearts') also.
oh
hmm, im still having trouble.,, idk what table this is trying to compare to at all x-x
G.GAME.selected_back
it works, thanks
oh do you have talisman
i do!
that's the problem
ah.
talisman makes hand levels into tables
ohhh.,, weird
is "copy.ability.extra.copied_this_round" real, game crashing, cant find documentation of it
ok thanks
mind if i ask what to_big is?
it's what turns numbers into talisman numbers
you need a dummy version of it if you want to use it without talisman, something like
to_big = to_big or function(a) return a end
oh to make it so it's still defined without talisman?
yeah
word!
ugh.,,
now im getting the old issue where its saying 'hand' is a nil value
ignore that i was looking up space LMAO
Is this trying to get the "level" of "current" hand?
why is smods making the card prefix c for something I've specified is a planet?
context.hands.level doesn't exist, you need to do the other thing i told you but wrap it in to_big
ohhhhhh, gotcha!
is there a way to make this have the planet prefix?
losing my mind because my code randomly stopped working and i literally have no fucking clue why. even undoing all the recent changes isnt working
ITS FULLY WORKING
c_ is the prefix for consumables
so planets, tarots, spectrals, etc
literally n thank you for your patience im so happy about learning this stuff c:
my first rare jonkler is working, exp farm my beloved
oh this is brilliant
ah ok
once it's done it should allow for making jokers, decks and maybe even consumables pretty easily, right now it's not quite there yet
witness the consiquences of your actions (soon to be textured)
0!?
what really is xChips anyways
c:
can it go below 0?
multiplies Chips by X
nope, thats what i was struggling with
nope as in it shouldn't or wont?
it was keeping it at 0 but still leveling off of a hand
mult:
o huh
very similar to XMult, but interacts differently for a few things
won't and shouldnt c:
(before Mult)
i think it's underutilized so i wanted to make a joker that does it and does it well
so, these cards both have the same order value. But all of my custom consumables appear to have their order calculated as if all of them were tarot cards (values begin and go up from 23), even if that's not the set they're in
and I'm not sure how to fix that
same here, though i do get why people argue not to add it
the difference between XChips and XMult is very build-dependent and typically not much of a change
but it does exist
i dont think it should be in vanilla but i think it adds flavor to mods
i find it worth, if mainly for the variety
i agree tbh, vanilla is just.., good XD
i still play vanilla runs even tho i play modded
think of it like how you think of XMult
guess my favorite number
is it possible to kill the player during scoring?
Wee + XChips source would be nasty
I LOBE VE CHIPS ADSGJLSDJG
IKR
oh neat, we have a similar joker! c:
:D
mine is a rare, what's yours? c:
in general, XChips makes Chip scaling useful in the endgame
whoa...
i dont get it
Wee is a Chips source, one of the best in the game
ooh, and make sure you define when a hand CANT level any lower!! I have mine set to 0 because i wanna see people cry that they have a lvl 0 hand XD
i know, whats different from adding mult
bcos that AND mult has a different higher score
... right?
im an art student not a math nerd X3
it's the same operation unless you're in plasma deck
exactly
plasma deck.,,,
except that some Jokers behave differently with it
it all goes back to this
anybody know how to fix this, or am I just stuck using funky index values
but not wee
why would Wee not behave the same as other Chips Jokers under XChips
even if its not different LMAO
because multiplying mult or chips doesn't change anything during main joker scoring
could someone give me a guide on how to make joker retextures?
fair
unless the XChips/XMult took effect after Wee triggers
no
I recommend using Malverk, and if you do there's the Legendere mod (and other Malverk mods)
it's the same
then i am very confused
that's what i'm trying to say
there is very little difference at the end of the day
yeah but my point is that wee + xchips is not more insane than wee + xmult
in fact xmult is better because order doesnt matter
that was what i missed
and both, assuming both identically-valued sources of XChips and XMult, would provide the same value
i'm not a math student either, i'm an engineering student
im comsci so im worse than both
of course, why not have both

the simple solution: XChips and XMult working together for maximum chip generation
BIG NUMBER!!!!!!!!!!!!
^mult
huh?? why is it saying the length of keywords is 0???


i dont think # works for non-arrays
samn
Xscore when Plasma Deck walks in:
aiko's code is.. bad..? no, it cant be..
if you need to check if it has something do next(keywords)
me when plamsa yummy puirble
this joker is so mid LMAO i love it
š„š„š¦
which one?
the one i just made
having a level zero hand is MISERABLE, you have to have a planet engine online for that joker to ever be worth
less mid than what i've got in the oven at least
it has a cool gimmick of deleveling
I have all of the basic things set for normal things, but the textures just arent replacing for some reason, heres what my file directory and .lua file look like
I'm just gonna assume either I'm missing some specific value in my card declaration, or this is an artifact of SMODS implementation at this piont
you can prob just add event
calculate = function(self, card, context)
if not context.joker_main then return end
if pseudorandom("death_card_trigger") < (1 / card.ability.extra.odds) then
print("[DEBUG] acitvated death prob")
-- force game over
G.E_MANAGER:add_event(Event({
func = function()
G.STATE = G.STATES.GAME_OVER
G.STATE_COMPLETE = false
print("[DEBUG] game over triggered")
return true
end
}))
else
print("[DEBUG] get fucked kiddo")
end
end
}
and just integrate that with your other functions
can it go negative
nope
good
hello chat, how would i check to see when a joker is purchased or otherwise added to your inventory (through riff raff, judgement)?
SMODS.INIT hasn't been applicable in ages
wait you look at my joker
you need a more recent modding reference
me when designing legendaries
:3
:3
im just using a really old tutorial then š
could you send me one thats more up to date?
oh i have a legendary in my modpack, but it literally does nothing and it's entire purpose is to make people waste soul card LMAO
makes it squeak
c:
i love useless jokers RAAAAAAAAAAAAAHHHHHHHHHH
oh, that's evil
that's so mean...
witness my jonkler
wait till i pull up with the squeak build
REAL
and beat Violet Vessel
ive got 2 legendaries myself, but only 1 can be spawned through a soul card
how many squeak per second
why is there a naked Patrick
the other you need to sell x amount of another joker to spawn it in
i was considering making all Legendaries upgradeable through a (buffed) Soul
(im a little statistic)
Hello
if you do that ill make it compat with this mod so that you can't sell him until the song is over XD
What does set base call again?
I'm just gonna make a lookup table to do what I want to do at this point...
peak comedy
Tier II consumables shall exist, and haunt your dreams
thats fair, i just have some moderate theming through jokers
to spawn this one it (its called the president)
you have to sell a random amount between 5-10 of the secret service jokers to summon him in (always negative)
and the amount to sell randomizes between runs
wdym
simple enough
unusual Legendary acquisition is quite interesting
and you get cash out of it
money is always epic
how do i make the tooltip for an edition change depending on what type of card it's referring to? like how negative changes between "joker slot", "hand size" and "consumable slot"
infact thats basically exactly what i want to do
you need to make your own tooltip localization
absolutely
how would i make the game determine which hand is played after a joker modifies some cards (ex. play a two pair that would end up being a flush, how do i make it detect the flush)
Sorry. i meant to ask if i am calling set_base right here:
trying to create the context "a card changes suits" for my joker to call ^^
it should be something like
local card_set_base_ref = Card.set_base
function Card:set_base(card, initial)
card_set_base_ref(self, card, initial)
SMODS.calculate_context(...)
end
i see
and i think it would be easier for you if you name the context the same thing you did before
<@&1133519078540185692>
ummm..... scammer?
how do i add malverk as a dependency for my mod?
im extremely new to modding sorry ;-;
Gave him a week timeout so he has a chance to regather his account
that was pretty...cool of you š
function Card:change_suit(new_suit)
card_changes_suit(self, new_suit)
SMODS.calculate_context( { change_suit = true, changed_card = self } )
end
so it would be "change_suit"?
(dab)
yeah
i see, ty
you need to check if the suit changed in set_base tho
mhm mhm
because it will trigger if the rank changed
so um. how, exactly, would i do that? would i need to redefine "set base" again?
you can do local original_suit = self.base.suit at the beginning and put calculate_context inside if self:is_suit(original_suit)
this doesn't take into account stone cards and stuff probably
could someone answer this?
does this help https://github.com/Steamodded/smods/wiki/Mod-Metadata
bump ( “dĻd)
wouldnt this only work if it changes to the original suit tho?
i want my joker to gain when it changes suits
context.buying_card for buying, for adding idk if there's a context or you need to hook something
i named it original suit as in the suit it was when set base was called, not the first one the game doesn't store that
thank youš
i seeeeeeeeeeee ty
ok how do i check the type (joker,playing card,consumeable) of a card?
card.ability.set
thx
how would i make the game determine which hand is played after a joker modifies some cards (ex. play a two pair that would end up being a flush, how do i make it detect the flush)
what localization field should custom consumables be in? Other?
.... im sorry i need so much help
i have the thing all set up, but i need to know if i should make any changes to my lua code
what's the code looking like now?
one change I'd personally change is switching to notepad++, but that's just me
local card_set_base_ref = Card.set_base
local original_suit = self.base.suit
function Card:set_base(card, initial)
card_set_base_ref(self, card, initial)
if self:is_suit(original_suit) then
return { SMODS.calculate_context ({ change_suit = true, changed_card = self }) }
end
end
switch to vscode or a proper code editor
local original_suit = self.base.suit should be inside the function before card_set_base_ref
i see
oh, forgot to reply
^
I use notepad++ since it's lightweight and it does have syntax support for lua and json, so it's good enough for what I'm doing lol
i mean as long as it does what you need
now it says that base is a nil value
anything's better than windows notepad š
wrong chat but LOL
get yuried idiot
real
yuri!?
the balatro discord server
lmao
true
true
anyway yea idk why base is nuthing now
local card_set_base_ref = Card.set_base
function Card:set_base(card, initial)
local original_suit = self.base.suit
card_set_base_ref(self, card, initial)
if self:is_suit(original_suit) then
return { SMODS.calculate_context ({ change_suit = true, changed_card = self }) }
end
end
not entirely familiar with how set_base does things honestly
fair enough
okay so its saying AltTextures is nil so like
what do i do
currently trying to find a way to make a joker that adds its own edition to played cards
oh don't return calculate context tho
the adding an edition part isn't the part that's confusing me
just wrapped up the art for my joker c:
just wanting to know how I'd make it add its own edition to noneditioned cards
yes that works thank you
do i need ot use this lua file
it should be base.suit, if im reading the text corfrectly: self.base = {
name = self.config.card.name,
suit = self.config.card.suit,
value = self.config.card.value,
nominal = 0,
suit_nominal = 0,
face_nominal = 0,
colour = G.C.SUITS[self.config.card.suit],
times_played = 0
}
local rank = SMODS.Ranks[self.base.value] or {}
self.base.nominal = rank.nominal or 0
self.base.face_nominal = rank.face_nominal or 0
self.base.id = rank.id
if initial then self.base.original_value = self.base.value end
local suit = SMODS.Suits[self.base.suit] or {}
self.base.suit_nominal = suit.suit_nominal or 0
self.base.suit_nominal_original = suit_base_nominal_original or suit.suit_nominal or 0
if not initial and G.GAME and G.GAME.blind then G.GAME.blind:debuff_card(self) end
if self.playing_card and not initial then check_for_unlock({type = 'modify_deck'}) end
end
what's the difference with adding an edition?
bc it might have a different edition
yay minecraft industrialism art
you need to check if it has an edition?
can't seem to get my localization table to work, at all
then add that edition to played cards
isnt that just card.edition
is there a context that is after the cards are played but before the played hand is determined
does it do that by defau-OHHH
I'm fairly certain it's laid out correctly? isn't the loc entry just supposed to match in key?
never made a consumable so maybe I'm wrong but what if you change other for elemental
...this is. new.
already tried, i'll try again though?
thatll be 746 dollars and 93 cents, i expect it int he next 6 minutes
I did see that cryptid uses Code as a loc category and I couldn't find any patches to hint at it being custom behavior
can someone give me a mod that uses malverk so i can get a reference?
i dont think so
yeah Elemental = doesn't work
fantastic
in that case, how would i check for other hands manually
idk
ok
a pre-scoring when played context might come with blindcalc, whenever that releases? since that's when press_play for boss blinds calculates
yeah
are there any mods with jokers that change the suit of cards?
is there a way to count instances of a card in your inventory
which type of card
mb, a joker
#SMODS.find_card("j_key")
So I looked at the reference, and I seem to have mostly the exact same code, so could someone help me? its saying global "AltTexture" is a nil value
can i just pop this anywhere and it'll just output a number?
yeah
SMODS.find_card("j_key") returns a list of all the jokers with key "j_key"
# gives you the length of the list
GIVE YOU THE LENGTH OF THE LIST
damn markdown
What is the text editor youāre using out of curiosity?
they're using notepad
notepad
Wowie thatās so cool
{
cardarea = G.jokers, -- G.play, G.hand, (G.deck and G.discard optionally enabled)
full_hand = G.play.cards,
scoring_hand = scoring_hand,
scoring_name = text,
poker_hands = poker_hands,
before = true
}```
...how outdated is the wiki-?
why
oh it isn't outdated
looks up to date to me
that function errored like three times when I plugged it in lol
the brackets at the bottom is what's inside of context
okay. the issue was using an underscore in place of a dash in en-us
wonderful
lmao
new to balatro modding and lua in general, how would one go about changing the pitch of a sound based on the game speed if possible? this is giving an error lol
unexpected symbol
it causes a crash lol
what causes a crash
the brackets
you don't put that in your code literally
from that snippet of code
well yeah
wha
its documentation
why is it like that then
not valid lua code
Oh Andromeda you are a Miku enjoyer right?
yeye
then why is it presented like it is?? š
What do you think of this new Joker Iām working on!
woaa :O
Changed the values around, and I got it to stop saying that, but now this is happening:
functions/misc_functions.lua:1691: bad argument #1 to 'ipairs' (table expected, got string)
I love it!!
i wonder how many mikus we have across the modding scene
Dizzy Miku?
this is read like:
if context.before and context.cardarea == G.play then -- condition to check if you're in the context
-- this is what's inside of context in that condition
context = {
cardarea = G.jokers, -- G.play, G.hand, (G.deck and G.discard optionally enabled)
full_hand = G.play.cards,
scoring_hand = scoring_hand,
scoring_name = text,
poker_hands = poker_hands,
before = true
}
its an expression that, when true, means "context" is the table below it
Rotten girl miku
When a hand contains Face cards (Queen excluded) and contains a pair, create The Fool or Judgement
Although Iām still trying to figure out the Fool and Judgement aspect, canāt get them both
Well like itāll either crash the game or itās just the create the fool and never a judgement
what are you using to create them
I wish I had the code right now but Iām on my phone right now
try something like
SMODS.add_card({key = "c_fool"})
SMODS.add_card({key = "c_judgement"})
just making sure
Oh. I did not use this at all
I did it completely differently
Wait Iāll have the code thatās close to it
using the smods function is probably the best way
scoring_hand:set_edition(edition, true)```
is this how you give played cards an edition before scoring?
it should be
alright, that's what I thought lol
oh wait what's scoring_hand
do I need to use an expression or smth
you want all played cards or all scored cards or what
all scored cards
you need to loop through context.scoring_hand
So get rid of domino and instead it was c_fool
h u h
yeah instead of
local new_card = create_card('Tarot', G.consumeables, nil, nil, nil, nil, nil, 'domino')
new_card:add_to_deck()
G.consumeables:emplace(new_card)
just use SMODS.add_card
Okay so i got the game to load, but when i try to apply the texture, the game crashes, any fixes or do i need to give the error?
do u know what a loop is
nnnno
So do I just copy and paste what you typed out earlier into that?
Like key = blah blah
the error is on line 138 of maverk, saying its calling a "nil" value.
heres what my lua code looks like:
AltTexture({
key = "jokers",
set = "Joker",
path = "JrJokers.png",
original_sheet = true,
keys = {
"j_joker",
},
localization = {
"j_joker",
},
})
TexturePack({
key = "jr_cards",
textures = {
"JJ_jokers",
},
loc_txt = { -- Localization text for tooltips displayed in the texture selection screen - can be added to a localization file under [descriptions][texture_packs]
name = "Jr's Jokers!",
text = {"Jokers, but they're replaced by Jr's friends!"}
}
})
Okay thank you, will try it out tomorrow!!
okay, now how do I make sure that it does the thing for the scored hand?
for _, card in ipairs(context.scoring_hand) do
card:set_edition(your_edition, true)
end
a joker i added is appearing in the shop multiple times even though i dont have showman or anything
alrighty
Also, question, if I put the edition as card.edition, would that try to copy the edition of the scored card or the joker?
Do you know if SMODS adds a card to the deck when selling a card?
i think so
how do cards get that (Currently 1x Mult) text color
Do you know what for
Iām patching Card:add_to_deck to add a context to adding cards to the deck
But selling a card triggers my Joker
{C:inactive} ?
weird
well crap, it doesn't
Yeah. Either my calculate is poorly written or a card is being added somewhere; could be a SMODS thing
See .ability.edition
yes... it works
was I supposed to replace the underscore with anything?
if context.before and context.cardarea == G.play then
for _, card in ipairs(context.scoring_hand) do
card:set_edition(e_polychrome, true)
end
end
end```
did I do anything wrong?
oh but if you're using card.edition you might need to change card to another name like playing_card
i think e_polychrome has to be a string
oh right, ty
or do {polychrome = true}
nope, didn't work still
try this
the problem is
I was just using polychrome as a test to see if the function works
I want it to copy the joker's edition
i know but does it work with that or not
Again see if this is the proper way to do it
...where do I put the {polychrome = true}
instead of e_polychrome
Or maybe look into card.edition if itās a table
that's not the problem currently, the function to set the edition isn't working lol
And I think the argument might be wrong
Hence why it doesnāt work
which argument?
The one I told you to change
that's the one I'm using polychrome as a placeholder to test as
so uh
when i try to play a round of balatro with my custom textures, this error happens
functions/common_events.lua:2489: attempt to compare nil with number
You tried card.edition
did my save corrupt or did i just do something wrong
I said to try card.ability.edition
this is what I'm currently working with
if context.before and context.cardarea == G.play then
for _, card in ipairs(context.scoring_hand) do
card:set_edition({polychrome = true}, true)```
changing card.edition to something else didn't work, it's caused by something else
āļø
Or to see if .edition is a table and use that table to fetch the key
is this crashing?
can someone help with this please?
Do you have cryptid
did you put 1x and 2x variants?
yeah
Oh wait I misread
would updating 2x but not 1x cause this or no
Itās nil and table
probably
also, to answer this, it's not crashing, it's just not doing anything
still crashing with the same error
i wanna make a joker that scales up other jokers but idk if thats something im learning tonight oml

the context was wrong do
if context.before and context.main_eval then
for _, pcard in ipairs(context.scoring_hand) do
pcard:set_edition(card.edition, true)
end
end
what i did was:
Use maverk to replace 2 jokers (Normal, and Chaos the Clown)
Boot up the game
Try to play a round
Game Crashes
im not that good at creating sfx,,,,
hm, no clue then
okay, that didn't work either
i just tested this and it did what you wanted
no, the problem is the context
oh yeyeye the function itself works
I'm just trying to figure out how to make it use the joker's edition
OKAY IT WORKS NOW
YIPPIE
i mean the condition was wrong
yibeeeeeeeeee c:
alright, now to figure out how to guarantee that it has an edition lol
how would one implement the shaking animation with delays when a joker triggers
Okay so yeah it just corrupted my save
booted up a new save and its perfectly normal
can we get an rip for my level 2 save š
ty
ok i managed to get it to actually display correctly and not crash on startup, better than it was, now to actually make the effect work
okay so me using poll_edition just causes a crash for some reason
does anyone have the code for Canio? or should i bite the bullet and just unzip balatro so i have it all myself (and if so how would i do that)
open up the exe file in 7zip or winrar and just extract it
it's completely unobfuscated lol
I forgot to hit save, checks out lol
hmm
trying to even find what lua theyre listed in and unless im blind
i cant find em
can someone help me with this btw
what do you mean by guarantee
Which one looks the lamest
probably the second but they all look good
like it'll always spawn with an edition
you can probably give it a random edition in set_ability
I tried that
it crashes
poll_edition("Sage", 1, true, true, {"e_foil", "e_holo", "e_negative", "cry_mosaic", "cry_oversat", "cry_gold", "cry_astral"})```
whenever I try to load the joker
what would be a good way to ban all the jokers besides ones under a certain prefix.
for a challenge
how would I do that
poll_edition causes an smods related crash
as in card:set_edition
I tried setting the table but it caused this crash
ohhh, I think one of the cryptid editions are bugged rn
idk why else it'd give that error
is there a way to make the cards change suit at the same time as the message pops up?
where are the base balatro jokers data stored in balatro's lua files? I've searched card.lua and cannot find em
which one are you looking for
Canio
how on earth do I keep a custom consumeable from showing up in the shop
return false for in_pool?
I tried that and it didn't work as far as I could tell
wait let me try starting a fresh run...
I'm even dumber
shop_rate = 0 since this is a custom type
hmm trying to understand this
so to reuse this i would have to define a local variable such as Faces but instead for total cards destroyed
is there a way to get an array of all jokers, including modded ones?
.
and have that variable multiplied by my xmult factor? yeah?
under what condition does the game use 2x assets?
you need to return a func with an event
when pixel smoothing is on
i see, thanks. i wondered if that's what that did
idk if it's a good way but i do that in my mod so that only cards from it appear by hooking get_current_pool
i assume thats this: https://github.com/Steamodded/smods/wiki/Guide-ā-Event-Manager
in what
yeah in the return put
func = function() G.E_MANAGER:add_event(Event({...})) end
in what what
ok, thanks
im confused on where to use this
Is there a way to do the opposite of a dependency? or like, an incompatibility with a mod
do you know what hooking is
yes, there are conflicts
how can I apply a custom sticker to a card that already exists?
i'm trying to look it up here and finding tons of conflicting info
I might need to install Cryptid for the sole purpose of debugging when people report crashes with Cryptid active
I cant seem to find an example to follow for a booster pack
i just reply "sad" and move on when they report talisman or cryptid crashes idk how to solve
do stickers have a specific prefix like other objects?
oh for a booster pack is easier to create an objecttype
i have some examples in my mod but they might be hard to follow
it just would be nice to have any example
What is the objectypes doing
it creates a custom group of your objects basically
im confused as to what this is doing
that's why i said it was hard to follow š
it's basically looking for all the jokers that start with "j_joy" and then putting them in groups depending on their qualities in my mod
you care about that first part only probably
would there be a surefire way to check when a card is enhanced? or should i attempt a hook?
card.ability.set == "Enhanced"
that works to check if a card is enhanced, but i'd need to have something activate when one is enhanced. so far i'm thinking a hook on set_ability() but i had wanted to check if there was a guaranteed way to make sure without hooking
ohh yeah i don't think there is
anyone willing to guide me through this?
trying to make the joker gain x0.3 mult per card destroyed, ive copied some stuff over from canio but its crashing and im not exactly sure why
dont have enough knowledge to know why
im trying to get this atleast working with playing cards without getting frustrated as i was earlier
key will be nil
keys are also prefixed with the type (in this case "j_") followed by your mod prefix
if you need the key its at center.key (card.config.center.key)
i dont think you need to check it though
well basically i just want it to only apply if its the flowey joker
and as i said im not really knowledgable enough on how to define that, assumed that referencing key would work
canio has this if self.ability.name == 'Caino' and not context.blueprint then and i wasnt sure how to really
make that work
for something else
Is this the appropriate place to ask about modding errors?
vanilla code needs to do that since hte calculate is lumped into one big function ran for every joker
your calculate only runs for your joker
either this or #āć»modding-general works
Got this error during a run, honestly do not know enough about modding to understand why it messed up
you have like a million mods active
probably the most ugly code anyone in here has ever saw lets be real
fusion jokers isnt compatible with talisman
im pretty sure youre using an old outdated version anyways but more recent forks arent compatible either
ah okay
I've seen far worse don't worry
the chatgpt ones are my favorites
ive written worse
I was just trying to get as many working as I could tbh
yeah but atleast it was probably functional
now im getting a gamecrash and im not sure why
what shouldve been a simple like maybe 3 hour adventure has turned into 10
and counting
honestly if i had money at this point i'd pay to have someone take this damn problem away from me im very much done with fighting to learn it
im writing code and have 0 understanding on what any of it is doing, im trying to actively copy other code and apply it to my own joker and it just doesnt work
-
the line that says
self.ability.extra.xmult = ...should have all theselfreplaced withcard -
the second
returnis wrong, you don't return what it says on the wiki, that's what's insidecontext
- you should read what the crash log says or at least send it as well
second return being the first in calculate?
sorry i mean the second in calculate
how do you fix mods not appearing
ah
is that section even doing anything or can i just delete it outright i legit dont know
you can delete it
unless you want to also want to display a message when it upgrades or something
Why doesn't this work? is it because its the being of a run or?
man coding is stupid
oh one more thing, lua is case sensitive so it's going to crash because sometimes you use xmult instead of Xmult
no clue what deckgroups is
forgot end
of course it is.
because lets not make things simple
okay, I have returnedeth
guh
Its a custom list, i've alreday made the checks all the if statements return true at the start of a round
card:set_edition(poll_edition("Sage", 1, true, true), true)
end,```
why this crash
surely making it case insensitive wouldnt add extra complexity and extra overhead
but it crashes when the deck turns the card to said suit
surely making everything be
CARDNAME does THING if REQUIREMENT
would be simple š
i cant tell if youre serious
mostly not
but man i will not miss whenever ai is smart enough to actually write functional code so art people like me dont have to toil in the pits of whatever level of hell this is
anyone who understands balatro's pool system a bit more than me, is there any possible reason tarot merchant voucher (tarot cards appear 2X more likely) sets the tarot_rate from 4 to... 9.6, instead of 8?




