#💻・modding-dev
1 messages · Page 281 of 1
you can just overwrite the original language file, it's what i've been doing up until now
so i cant make it into a mod?
you can set it to use a language as base, overwrite whichever fields you want to change, and that's it
load it through steamodded like any other (though this is literally what i was just asking about avoiding :P)
i could use this as reference
thanks doc
also what text editor do you use
IDE*
vscode
if youre that type of person
thanks doc
does anyone know why my bu mod might not be working
can you analyze the crashlog?
its not even a crash log
aure please dont deevolve to an emo 2008 kid 💔
ship it
yall
can i see your lang file? and/or how you're loading it in the lua?
check out balatro impact
play B:SR btw
play balatro impact guys
its the bu language mod
oh it's not even using smods lmao
yeah
i'll look but not what i've been using to replace my language thus far
how would one do that
Just aint workin at all now... Clearly I'm missing something obvious
-- RESET IF 'UPGRADE' NOT FULFILLED - MORE THAN ONE HAND PER BLIND IS USED
if G.GAME.current_round.hands_played <= 1 and not context.end_of_round and not card.ability.extra.Xmult == 1 and context.cardarea == G.jokers then
card.ability.extra.Xmult = 1
return{
message = 'Subsonic...',
sound = 'LJet_SCruiseReset',
colour = G.C.ATTENTION,
}
end```
add another language in smods, port everything to there
ive been making myself hard to mod this game
using N++ doesnt help a bit
For those just joining me, It's meant to reset as soon as the first hand doesn't beat the blind
alright fine
WWWWW
YOOO
we love vscodium
nevermind
except that i can't get the python language tools to work
it downloaded
now pipe smods and the source code into it
i mean
you just need to open the mods folder with lovely and smods
and there will be autocomplete
OH
this semester aint done but i am
ye
or you can do what i did with this
:3
Bumping because I'm dying inside
what this supposed to do
is there a way to make a tarot card that takes out 2 cards and add a new one based on the two? dowsnt look very hard but im not sure
also good morning!
Joker gains Xmult for each blind beaten in a single hand
I want it to reset back to x1 if the first hand fails to win the blind
But the only version i've gotten to reset resets multiple times
sometimes even repeating while it absolutely shoudln't be
if G.GAME.current_round.hands_played > 1 and context.end_of_round and context.main_eval and card.ability.extra.Xmult > 1 then
card.ability.extra.Xmult = 1
return{
message = 'Subsonic...',
sound = 'LJet_SCruiseReset',
colour = G.C.ATTENTION,
}
end
dunno, some stuff to prevent that from repeating
swagger
hi N'
Okay this works, but it debuffs at the end of the round. Would I change it to context.after for it to debuff right after the hand has played?
debuff wha
resets*
how do i make a joker that adds a new playing card to the deck like with the stone joker?
oh, so, like
it resets after the second hand is played?
As john smods has said:
No after the first, but only if it didn't beat the blind
so the rest of the round won't get the benefit of the Xmult
if G.GAME.current_round.hands_played > 1 and context.before and not context.end_of_round and card.ability.extra.Xmult ~= 1 then
card.ability.extra.Xmult = 1
return{
message = 'Subsonic...',
sound = 'LJet_SCruiseReset',
colour = G.C.ATTENTION,
}
end
probably that
What if some other mods f'd up this joker's Xmult that makes it less than 1?
~= 1 instead of > 1
why does this crash?
it's for a deck
I'll get my mods rarity working then I'll make a smods version of the bu mod
does the create a card function work like that?
ye that's why i'm using an event for it
Should it not be create_card({set=whatever})
instead of straight going to the brackets? Or is that just one of those lua things
how do i make a joker that changes the playing cards i have? like, i have an steel card in my hand and it turn into gold
like midas but for some types of cards
You can skip parenthesis if the argument is only a table
ahh
do i just put context.destroy_cards into the if here? been struggling to get it to work
Is G.GAME.dollars should be used with to_big with Talisman?
Hi folks, what does 'prepend_key' do in create card? I am trying to make a booster pack containing only cards from my mod, all of my joker cards have my mod prefix of fox_
you need to to_big anything thats being compared with G.GAME.dollars
to_big(G.GAME.dollars) actually doesnt do anything, since G.GAME.dollars is already a table
it appends your key to the pseudoseed, it can also be used to check the source in in_pool iirc
but you can still do that nevertheless though
In this case why vanilla stuff like check_for_unlock({ type = "money" }) doesn't patched yet? 
same goes with mult, hand_chips, and blah blah
Thanks! I tought you might know! I wil lhave to dig deeper to determine how to do this
you need to create an objecttype for what you want
hmmmmmmm, shouldnt this crash tho 🤔
its comparing a table iwth a number
but im not too proficient in those talisman shenanigans anyways, so maybe im wrong
if i were to add the informations about a custom enhancement to a joker i would use
info_queue[#info_queue + 1] = G.P_CENTERS.claws```
right? (the enhancement key is "claws"
It wil cause a crash because you're comparing table with number
talisman moment
Highly doubt cuz its been here for a while
mhm
I thought Talisman's bignums and stuff already handle comparing with numbers
im still frustrated over the fact that you need Disable Scoring Animations enabled
to play my mod
like, what the hell 💔
it will crash if it isnt
Wtf that sounds silly
why does it do that.
I've got it. I just use context.hand_drawn and G.GAME.current_round.hands_played >= 1. Works well enough
what is the context for drawing cards?
talisman✨
ah so thats the timing ur looking for
icic
context.hand_drawn
Yeah like after 1st hand is scored but before the second hand is happening
ty!
Sorry I wasn't clearer lmao
its fine, im glad u figured it out tho :D
Imagine mod which does not crash for at least ONE day 
Hi folks, how could I index through all of my custom jonklers? My base Lua skill isn't so great but what I'd like to do is this
list all registered cards with this key "j_Fox_"
now how would i make it check if cards with a heart suit are destroyed, and then make it gain xMult from it....
talisman existing:
💔
What a hell, how
what do i use to add an enhancement based on the one the card already have?
we just dont know
grab the card's enhancement key
how do i do this?
card.config.center.key i think
do i use this in a context or?
then use :set_ability to set the card's enhancement
whatever context ur using should work
card shoud be replaced with the card your targetting
the id for steel cards is just "steel" right?
m_steel
tyty!
as far as i can tell this should be working per the documentation, says other card is returning nil and when it doesnt say that the destroy just doesnt work
is there a guide to starting out with modding? I know basic coding but I'm not familiar with modding or Balatro's file structure
🙏
and also
you forgot an "and" there
cheers, thank you
bump...........
It works perfectly now
do i just add "m_steel.config.center.key" under "contex.hand_draw"?
In honour of you, I will make a Joker inspired by your favourite plane @manic rune
Yessir
you can check out how "caino" works
im currently doing hw rn so i cant access the source code, sorri
search "caino" in card.lua i think
you can do
local list = {}
for _, center in ipairs(G.P_CENTER_POOLS.Joker) do
if center.mod and center.mod.id == "your mod id" then
list[#list+1] = center
end
end
caino... my old nemesis...
You want the Plane Pepsi (was supposed to but didn't) gifted to a man or The Concord Pepsi Sponsored
oh yeah, that controversy
mhm
gift it to me :3
GR.3 Harrier coming right up
i think im missing something prretty obvious but idk what
a joker that when hand is draw checks for steel cards and turn them into claws card (a custom enhancement i made)
okok!
...there doesnt seem to be anything to check the new cards being drawn, hm
it can also be the cards scored if its easier
yeah, thats a lot easier
ye so sure
oh actually
wait
if context.before then
for _,othercard in ipairs(context.scoring_hand) do
if SMODS.has_enhancement(othercard,"m_steel") then
othercard:set_ability(G.P_CENTERS["your_enhancement_key"],nil,true)
end
end
end
there, i think thats it
there will be no effects and such though, you will have to do it urself
no effects you mean like the enhancement?
ooh, visual effects
now that i have no idea how ill do, lemme check that github page
uhm..
how do I make a return message appear on top of the deck
one sec
what is the thing for if the card shows up in the shop?
set_ability
also applies when it shows up in a pack
or when it is spawned in general
i think its G.deck
is it not possible to load functions into debugPLus? I am trying to debug a function in one of my packs but gettings DebugPlus to notice it is....ahhhh
wait, i thought i saw one that was like how there is "no_suit" and you just had to set it was false, is that it?
no
set_ability is like calculate
it's a function you put in your joker
the code in there runs one time when the joker is spawned
oh ok, ty
Would there be a way to :
- check a joker's edition
- see if it has a sticker (like perishable)
in the calculate function ?
card.edition to see if it has an edition
card.edition.key should be the edition key i think ("e_foil" for foil)
i think :get_edition() works too, not sure whats the difference
ok
stickers are like
card.ability.eternal
i've only ever done this for eternal so idk about other stickers
likely the same
card of course referring to the card you are checking
i would assume it's .perishable
yes
yeah that should be everything but
make sure you check if card.edition exists before checking card.edition.key
or it could crash
ok
thx
It works
thx
ngl
adding a custom jokers is shockingly easy
it's great
how would i make this?
events, :flip()
yeah
not even triggering the mult gain now let alone destroying the cards ;-;
just do "card:flip()"?
should be context.destroying_card not context.destroy_card
other_card doesnt exist in context.destroy_card
replace context.other_card with context.destroy_card, and switch the positions of that and context.destroy_card
if context.individual and context.cardarea == G.play and context.destroy_card and context.destroy_card:is_suit("Hearts") then
does destroy_card also work
i thought it was just destroying_card
i think destroy_card is added by smods
i see
also i think you need to return remove = true specifically to destroy the card
so just swap them or?
nope, just returning true will destroy them
oh cool
event({trigger = 'after', delay = 0.15, func = function() card:flip()?
@brazen tusk this should be it
thats not how you make an event
i mean, you are close
this is how an event should look like
do remember to return true inside func, else it will loop forever
tyty!
check this out if ur still confused
it would be really cool if debugPlus could render a whole table, like the collection view, showing the impact of a shader on all jokers @rough furnace
nessicary
didnt
aiko manage to do that?
its definitely possible through a command
you should ask them
still not doing anything ;-;
G.E_MANAGER:add_event(Event({
Trigger = 'after',
delay = 0,15,
func = true,
card:flip()
}))```
like that?
its "trigger", but yes
and thats not how you define a func in there
func = function()
--do stuf
return true --THIS IS IMPORTANT, DONT REMOVE
end
ooh okok, tyty
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0,15,
func = function()
card:flip()
return true
end
}))````
like this @manic rune ?
oh okok, ty!
and that should work, yeah
anything else?
okok! ty!
but you will have to tweak the trigger and delay a bit to get your timing right
Hey can I ask for crash help here?
ofc
So I got this crash. I think it had to do with the hoarder joker from Extra Credit not allowing me to cash out a blind
Wait are you making a mod and this is happening?
No I'm playing the game
oh, those crashes are supposed to be in #⚙・modding-general
Shoot alright
#💻・modding-dev is usually for when you are making your own mod
Yo where do people make pixel art for jokers and whatnot for normally?
aseprite
but for non-pixel art, probably smt like krita
or gimp 3.0, i heard good reviews about it
Aseprite is my preferred pixel art tool
bruh
Is the free trial adequate?
I'll have to figure out why my flush not flushing
How to force cards in card area be placed correctly?
Like after changing area.config.card_limit they're moving to new destinations not instantly
hey so a friend of mine is installing a mod I made and it works fine on my own pc, but once I gave him a zip with all the relevant files it keeps crashing. any ideas on how to fix this? I know next to nothing about lua so any help would be appreciated! (here's the crash log)
Looks like you didn't send both versions of the textures correctly
you need both the 1x and 2x versions and they need to be in the correct folders
okay I'll give that a try tyvm!
I solved my problem. How do you make a booster pack only of cards from your own mod?
First import two functions, one to give you a string startsWith function, and another to look at g_p_centers to find things that start with your prefix.
Finally, call that within your own booster pack
function StartsWith(String,Start)
return string.sub(String,1,string.len(Start))==Start
end
function string.starts(String,Start)
return string.sub(String,1,string.len(Start))==Start
end
function getResourceWithPrefix(s)
local results = {}
for k, v in pairs(G.P_CENTERS) do
if StartsWith(k, s) then
print(k)
table.insert(results ,k)
end
end
return results
end
function getRandomFoxJoker()
print("getting a random fox joker")
local allFoxJokers = getResourceWithPrefix("j_Fox")
print ("received list of " .. #allFoxJokers)
local randomJoker = allFoxJokers[math.random(#allFoxJokers)]
print ("random joker shall be ".. randomJoker)
return randomJoker
end
Whassup devgenerates? :3
You don’t need the string bit, just check the mod property on the center object
could anyone help me tackle making my first booster pack? im struggling to understand what to do to get the items to show up and how to code them in :3
how do i get a jokers rarity
just make an objecttype 😭
so i gotta check context.cards_destroyed ig
also don't use math.random there or it will not be consistent in the seed
<card>.config.center.rarity
now that is a very cool idea, to use pseudorandom to control the spawn order
joker that diverges the timeline
did i do something wrong?
i am still plenty confused
main_scoring is a boolean, not a card
do you have an idea of how to use pseudorandom like that for spawning? I would totally implement it!
so i add main_scoring = boolean instead of main_scoreing = card?
just replace math.random(max) for pseudorandom("seed", min, max)
no, boolean means true or false
just check if context.main_scoring and ... then
oh so i invert the cardarea and the main_scoring?
it's fine both ways
im not sure i follow sorry
the order wasn't the problem the problem is that you were comparing true == Card
so i have to take out the "== card"?
yes
tyty!
hey N do you know at a glance why this color thingy isnt changing the background?
second issue is that you're returning a value outside of a context so it will return in all contexts
this is for a booster right
mhm
how do i fix this?
idk if returning things works but i do it like this (i think ic opied it from another mod)
cards_destroyed doesn’t exist
oh, do you think that'd work with hex codes?
my game crashes when i use it btw
oh
vanilla code doesn't even help me then okay 🥲
how would i go about create a joker pair like gros michel and cavendish where the upgraded joker doesn't show up in the shop until the first has been destroyed?
G.C.JOY.X are all hex codes
oh . w.
if context.cardarea == G.play and context.main_scoring then
local Xmult = 1
local dol = 0
if pseudorandom('lucky') < G.GAME.probabilities.normal / 4 then
Xmult = 2
end
if pseudorandom('lucky') < G.GAME.probabilities.normal / 15 then
dol = G.GAME.dollars
end
return {
x_mult = Xmult,
dollars = dol
}
end
idk what you want the effect to be tho just basing it on your code
looks right! ty very much!
so I HAVE NO CLUE WHAT TO DO!!!! YAY!!!!!!!!
sure why not
what do you want to do?
for some reason the code is telling me to but a , in there
why is it there twice lol i didnt know that
wait do i have to define the hex code somewhere?
where can i find the shop logic
does someone know why its telling me to add a ,?
no, you can just use HEX('000000')
oh word
you have an extra end
i tried taking outt but it tells me to add again
oh does the other one start with this
then you might need it somewhere else
wait no sorry got confused by the formatting
can you send the file?
yeye! ill send in dm
i love how im putting in effort to make this mod as unintuitive and unvanilla as possible
like my next issue to tackle is once i get the cards spawning in, how to make them spawn on random areas on the screen rather than being organized
How do you make a custom suit not show up in the customize deck section?
oh that ones cool
never give me numbers for i will change them and experiment like a monkey with a typewriter

so context.remove_playing_cards exists then right?
what do you want to do?
well my goal is to create a booster pack that creates my favorite things in balatro from a table
Okay I've been stuck on this for so long, is there any example of a front and back face card mod? I'm trying to find a way to make it all streamlined into one lua file but I feel my braincells melting trying to find a key that'd work for front faces on malverk. 
dear god i'm finally getting somewhere
you can make an ObjectType
whazzat? c:
how do i make a card take out money when played
make it give a negative amount of money :3
i tried using p_dollars = -1
i tired but then nothing happened
basically you can add cards to it to create a collection and then you can use as a set like "Joker" or "Tarot" https://github.com/Steamodded/smods/wiki/SMODS.ObjectType
so i need to check if the card getting destroyed has the hearts suit
and if it does, the joker gains x0.5 mult
OH WAIT THIS IS EXACTLY WHAT I NEEDED
how do i check the suit...
do i even have this right actually
could i use card.ability.rental then card:set_cost(1)?
game.lua search for self.P_CENTERS = {
wait i found it i tghink
ah i was in card..,,,
that explains why i was missing so many things
its beautiful

so many keys.,,,
what do i put for just Hearts though
is there a way to force unhighlight a card?
loc_vars = function(self, info_queue, card)
card.ability.extra.money = -1
return { vars = { card.ability.extra.money } }
end,
calc_dollar_bonus = function(self, card)
local bonus = card.ability.extra.money
if bonus = -1 then return bonus end ```
how about that?
think so but idk what you are going for
basically:
if card with hearts suit is destroyed, the joker gains x0.5 mult
im currently trying to figure out destroying myself to no avail so i can't help with that sorry
using debugplus, how do i print a line of code in the consule on balatro?
do i just do print()
?
who did this
hey lads, I need willing volunteers to try out lovely's gamepass build #1214591552903716954 message
would this work as taking out money when playing the card?
ive set the rental cost before
now i need it to add the mult to the total mult...
...how would i do that
has newer smods broken if context.individual and context.cardarea == G.hand?
because i cant get it to work during scoring
it only runs once you win the round
baron doesn't work at all
anybody have any idea
hmm its a bug introduced by me
let me investigate
does this look right so far
you don't need all that in the return just return { xmult = card.ability.extra.currentXmult }
if i want to add bonus dollars to a card permanently like hiker does it how would i go about this
card.ability.extra.dollars doesn't seem like the way to go
thanks!
ive got it mostly working, im having two issues though
perfect
how can i make it so you loose $1 when playing a card (enhancement
im thinking of just making it so it always comes with the rental sticker when you get it
changed that
ok so, problem, none of the actual objects are showing up
its all going to the fallback default card
it made one lusty joker when i had that in the table which was weird
objecttypes are a bit weird honestly, i would recommend checking out a mod that uses them to check how to inject stuff
im trying to buff a scored card in the context.individual context but its happening after the card is scored. what's the proper context for this?
whats the context to check the full hand not just scored cards? i tried G.play.cards but its not working
might need to change what im doing for it
wdym by buff
G.play.cards should have the full hand, what are you trying to do?
ohh you need context.cardarea == 'unscored'
like add a permabonus
Like Hiker?
also joker_main should be outside individual
would adding that with an and do both?
You’d need to add the buff before
no, it should be an or
ahh
how would i go about that?
fair enough
heres a simple one https://github.com/MathIsFun0/Cryptid/blob/91400dd85b17ade4f0b4f91d485848434ad837e3/lib/content.lua#L304
thanks c:
should be, my comments just make it look odd rn
oh yeah i see
now other_card is returning nil ;-;
bane of my existence
okay now i need it to actually add the mult when a hearts card gets destroyed
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
smth like that should be good
can replace the last one with the actual value if you dont wanna set up the variable
or replace it with your variables even*
ignore it
dont ignore it lol, its telling you card.ability.extra.currentXmult is not a valid field in the table
remove the return
ohh
so this then
yes
my ide does that stuff sometimes for stuff that just isnt a problem 💀
are you kidding me 🥹
context.removed is a list of cards removed, you need to iterate through that
limited edition
i don't even know what to do anymore i think my brain is collapsing
if context.remove_playing_cards then
for _, pcard in ipairs(context.removed) do
if pcard:is_suit("Hearts") then
card.ability.extra.currentXMult = card.ability.extra.currentXMult + card.ability.extra.XMultIncrease
end
end
end
how come this only ever displays question marks? the print("Added!") is being shown so the list should be updated but its always just ?,?,?
thanks
well i got it summoning 5 cards now but, they arent random its the same 5
<@&1133519078540185692>
how does the rarities work in smods
hey guys, so i'm trying to implement my joker idea in to the game, but i'm not sure how to implement one of the mechanics in to the joker. I'm trying to have it change the mult and Xmult based on the number of letters in the names and descriptions of other jokers, but i just don't know where that information would be stored or how to pull from it. Any ideas?
i find the docs a little cofusin
i'm not entire sure if this is the question your asking, but the rarity = 1 would be common, 2 is uncommon, 3 is rare, and 4 is legendary
i meant like custom rarities
ohhh, yeah i'm not sure, sorry
G.localization.descriptions["Joker"]["joker key"].name
G.localization.descriptions["Joker"]["joker key"].text
i worked on this a lot, it spawns 5 cards i like, unfortunately not at random but that'll be something i take on another day
ohh okay! What about doing it per joker that you currently own?
thank you so much for your help btw
grab the joker key from each joker in G.jokers.cards
how would i do that in the SMODS.Joker? I'm still verynew to Lua, i'm sorry
for _, joker in ipairs(G.jokers.cards) do
local name_lenght = #G.localization.descriptions["Joker"][joker.config.center.key].name
local text_lenght = #G.localization.descriptions["Joker"][joker.config.center.key].text
end
nooo cuz that was my exact reaction too lmaoo
-# oh right
im not writing this shit on discord
i have a habit of writing code on discord instead ❤️
who tf
rip
i dont think it has one
under the loc_vars? or somewhere else?
wherever you want to get the counts
you would probably want to manually remove the space inside the description too, actually
unless you want it to be counted too
i'm doing it for a specific letter that changes each round a la ancient joker
someone got the error attempt to compare table with number on this line in my mod if G.GAME.dollars <= 10 and G.GAME.dollars >= 0 then, is G.GAME.dollars sometimes a table?
oh
fuck talisman
THANK YOU FOR UNDERSTANDING MY PAIN AURE
💔
modders when they have to make their mod compatible with talisman:
how do i add support for talisman then?
add a to_big function
tup yup, that
then for any comparisons, you wrap the operands in to_big
would i make the 'for _,' a variable and then use a randomise function?
do i just pass dollars through to_big when using it?
e.g. if to_big(G.GAME.dollars) <= to_big(10)
for every number?!
nop, you use to_big on the number you are comparing with G.GAME.dollars
ohh
note: nothing will break if you don't to_big the dollars unless an old version of talisman is being used
this is only needed for comparisons
yeaa i think i like talisman less now
mult, hand_chips the global var
round score iirc
lol
G.GAME.chips
i dont get what you mean
G.GAME.blind.chips
how do rarities work with localization files
but only with comparisons?
nevermind i missunderstood
and probably some more, trial and error ❤️
you would probably still need to do to_big when adding stuff with the stuff i listed above, just to be sure
i'm trying to count the occurences of a certain, randomly chosen, letter in each the title and description, and use that number to effect the mult
on the joker
string.find
you can use that to see how many occurrences there are
labels = { k_perkolator_perkeo_r = "Perkeo" }
dictionary = { k_perkolator_perkeo_r = "Perkeo" }
smh
how would that work in context? wouldn't it be several different strings?
ah nvm its not string.find
i misremembered
here, check out this one
is there a way to access the required chips to win a particular blind?
G.GAME.blind.chips
what would be the best way to make certain cards undiscardable, say for a boss blind?
thank you
thank you! i'm still not sure how to get the, presumibly multiple strings, one for each name and each description
hook to whatever function handles the discard stuff, and do the wonky thing i guess
maybe without the mod prefix
-# i think my brain is running out of brain juice
yeah I guess I could just hard code it
nvm that shit is case sesative
i had to lowercase the r
hard-coding for the specific boss blinds was my last resort
oh yeah
for loop
actually, N', isnt description a table of text
ok folks who know how to DynaText i got a predicament
i'm making an edition that functions a bit like Misprint but instead of randomly choosing a number it chooses a random effect, it either does foil, holo, or poly's effect. But i'm struggling to figure out how to put the XMult text box graphics in just one of the dynatext options
does anyone know how to help with that?
uhh yeah forgot
wha
im guessing this is wrong
i dont think you can
or G.C[blah blah] if you want to use a pre-existing color
it's really not possible?
inside is hex code of the color you want fyi
calculate = function(self, card, context)
if context.selling_card then
return {
chips = 0.75 * G.GAME.blind.chips,
}
end
end
is there a reason why something like this would not work?
would that be under the loc_vars part of the SMODS.Joker ?
im not really sure if dynatext has a way to add borders
oh, semi-recently support was added for variable text background colors using the code B: instead of X:, so maybe you could just have it always be there and set the color in the table to white (which would be invisible) for every other entry and red for the xmult entry?
in wherever you need to do the count
not white, its clear i think
oh is clear also a thing?
mhm
yeah G.C.CLEAR
even better then
uhh, yeah, this will run even when you are not in a blind
and G.GAME.blind.chips doesn't exist outside a blind i think
oh whoops
is there a context to check if im in a blind
if G.GAME.blind and G.GAME.blind.chips, probably?
let me try
ive been trying this all day and cannot for the life of me get it to work, do i need to do a for loop or smth?
this looks bad
calculate = function(self, card, context)
if G.GAME.blind and G.GAME.blind.chips and context.selling_card then
return {
chips = 0.75 * G.GAME.blind.chips,
}
end
end
i guess you cant do math on these kind of variables?
seems weird
context.other_card.ability["please_destroy"]
then add a separate context.destroy_card outside your context block
check if context.destroy_card has the mark
if it is, return true
if context.individual and (context.cardarea == G.play or context.cardarea == 'unscored') first of all
G.GAME.blind.in_blind
would still fall for the error right
idk
then for the destroy_card check, it needs to be separate from the individual scoring
okay this helped not trigger the error when its outside the blind
now i need to do it for the actual implementation
if context.destroy_card and (context.cardarea == G.play or context.cardarea == 'unscored') and context.destroy_card:is_suit('Hearts') then return { remove = true } end something like this, separately from the other checks
i thought you just need to return true?
it worked for me, idk
true is specifically converted to { remove = true } actually
ahhh icic
how do i do those little code snipits like that?
it's not recommended and you'll need to switch to a table if you want any customization on the effect
like some message being displayed
o yea, N', have u checked my world system i added in my mod :3
would that have to be a seperate return from my message etc or would those word with the true
i'm trying to show the code that i have so far so i can ask for help in context
nope is it up already
vscode fooled me lol
you can put a message into the table you're returning here if you want a message precisely when the cards are being destroyed, not scored
the code needs to go inbetween the backticks
return { vars = { card.ability.extra.mult, card.ability.extra.Xmult } }
end,
for _, joker in ipairs(G.jokers.cards) do
local name_lenght = #G.localization.descriptions["Joker"][joker.config.center.key].name
local text_lenght = #G.localization.descriptions["Joker"][joker.config.center.key].text
for
end
```
alright cool tyvm
im actually very proud that i got it working with minimum help from others :p
-# asides from the flying button
yo this is sweet
ohh thats cool
how do i print out values using debugplus in the console
eval your_value
thank you
eval G.GAME.blind.chips * 0.75 like so?
yes
cool ty
yeah, it allows you to switch between the vanilla showdown boss blind and the mega one from my mod :d
it also accounts for boss reroll, which will only reroll the vanilla one
i want it to and mult and Xmult for each occurence of a certain letter in the names and descriptions of jokers i own, and also randomize what letter it looks for. I need to concatonate the joker names/descriptions in to 1 string each and use a for loop to count it. I'm not sure how to do that with lua, i'm sorry if this is beyond the scope of this channel
hmm weird, so eval G.GAME.blind.chips * 0.75 works and gives me the right number but when i put it in ```lua
calculate = function(self, card, context)
if G.GAME.blind.in_blind and context.selling_card then
return {
chips = 0.75 * G.GAME.blind.chips,
}
end
end
maybe try setting the stuff outside return first
local ret = G.GAME.blind.chips * 0.75
then return that
text should be red ngl
how can i make a enhancement where everytime you play the card you loose $1
okay
the red color of perkeo's hair i mean
yay
context.individual and context.cardarea == G.play
then return dollars = -1
text_color i assume
oh thats fire
it might just be because youre trying to modify chips when a hand is not played
tried but dont work
context.individual context.main_scoring
also read but didnt help with that specific thing
crap
Ah
i tried using self.ability.rental but also didnt work
is your name debug or smt
It's so hard to read I love it
debug inspect swag???
what i said
how do i make shaders for editions?
send debug message (inspect (swag))
lemme try
sendDebugMessage(inspect(SWAG))
what the fuck
Yea alright just prove me all wrong 😔
guess i need to upgrade the swag side of my brain
oh, yeah im not trying to play a hand when a joker is being sold since that wouldnt be possible right
this reminds me of teen code in my country
instead of returning chips, is there a way for me to set the chips of the current blind to that value
how does one set the text color of a rairity
ease_chips?
what in the
like that?
i remember someone asked before and i checked and it was not possible without patching
rip
damn, i remember Winter being able to do that
guess im not doing it
whats that
set your current chips to the given number
not quite
how then?
local name_lenght = #G.localization.descriptions["Joker"][joker.config.center.key].name
local text_lenght = #G.localization.descriptions["Joker"][joker.config.center.key].text
how do i use/manipulate the output of this?
i mean the badge function accepts text color but i dont think rarities pass that
ooh okok, ty!
so i do return { ease_chips = wtv the value is }
tables use curly braces
ah
i wonder if thunk ever reads messages in those modding channels
ease_chips(0.75 * G.GAME.blind.chips)
i hope not
i bet he secretly really likes hit mod joyousspring
i bet he loves gambling² reincarnated the mod
if G.GAME.blind.in_blind and context.selling_card then
ease_chips(0.75 * G.GAME.blind.chips)
end
end
like this?
that will work, but it will always set the chips to that number i think
ooof
youre right
i didnt consider that
it worked! ty so much!
do stuff with G.GAME.chips too
wait i got it
i was stuck on this for kind a while
thunk dms me every night asking me to add his favorite movies to kino but i ignore him because he's kinda annoying
this checks chips scored right?
checks how much chips you currently have
as in for the hand or for the round
the round
awesome thats perfect
this is the type of rp message my cat sends me when I'm having some snacks while watching a movie
😭 huh???
*demolishes your house by inhaling your chips bag with the power of a literal black hole cutely :3
It's like the chance outta 1 that a Joker will be this type
i thought of when you fuse 2 wild cards you get the "Monster" joker, everytime you play a steel card if turns into a "Claws" card (Fusion of Steel+Wild, gives X3 mult but breakes after 3 uses), what yall think?
#thuglife
does the thunk talk to people here
i haven't seen him being around here before
not me he hates me
if G.GAME.blind.in_blind and context.selling_card then
ease_chips(0.75 * G.GAME.blind.chips + G.GAME.chips)
end
end
``` this worked perfectly, thanks @manic rune
how do i make shaders
i mean, yes, but that's probably sent straight to message requests
check example shsders
and good luck
i genuinely wish you the best
well ok... im scared now
like, i wish you come out alive

where do i get information about the booster pack inside the context.open_booster context? the wiki isn't clear on this.
what
ʖᒷ∴ᔑ∷ᒷ 𝙹⎓ ℸ ̣ ⍑ᒷ ᓭℸ ̣ 𝙹∷ᒲ
im scared
me when shaders:
how do i make it so you cant get the enhancement in booster packs or in shops?
what the hell is an f#
just by using the tarot card for it
ℸ ̣ ⍑ᒷ 𝙹リᒷ ℸ ̣ ⍑ᔑℸ ̣ ꖎ𝙹𝙹ꖌᓭ ↸𝙹∴リ ⚍!¡𝙹リ ⚍ᓭ ╎ᓭ ℸ ̣ ⍑ᒷ 𝙹リᒷ ∴⍑𝙹 ⊣╎⍊ᒷᓭ ⚍ᓭ ℸ ̣ ⍑ᒷ ⍑ᔑ!¡!¡╎リᒷᓭᓭ ∴ᒷ ↸𝙹 リ𝙹ℸ ̣ ↸ᒷᓭᒷ∷⍊ᒷ, ᔑᒲᒷリ
makes sense, ty!
i dont like this
👁🗨

context.card
How the hell does the rarity badge colour work?
local name = #G.localization.descriptions["Joker"][joker.config.center.key].name
local text = #G.localization.descriptions["Joker"][joker.config.center.key].text
``` how would i put all of the names and texts in to strings? i'm not sure about the format of Lua stuff
remove the #
I've tried G.C colors, I've tried hex codes, I've tried C/X: colors
The # means you're trying to get the size of a table
So it'll return a number or nil
show how your smods.ratity looks like rn
what's the blank spot for
the "for _"
for index, value in ipairs(list) do
G.C.CSMR_PRESERVERS = HEX('000000')
SMODS.Rarity{
key = 'preserver',
badge_colour = G.C.CSMR_PRESERVERS,
default_weight = 0.75,
pools = {['Joker'] = true},
this worked for me
some people call index "key"
return { vars = { card.ability.extra.mult, card.ability.extra.Xmult } }
end,
for _, joker in ipairs(G.jokers.cards) do
local name = G.localization.descriptions["Joker"][joker.config.center.key].name
local text = G.localization.descriptions["Joker"][joker.config.center.key].text
for "E" in name do
Xmult =+1
end
for "E" in text do
mult =+3
end
``` is this right?
idek which one is correct at this point
it's index for ipairs and key for pairs
That's literally how I did it and it's just pure white
show me your code
what?
close some of ur tabs
The color I made works everywhere else
would it be possible to make the destroy happen one card at a time?
do i just leave it as "for _" or do i need to put something tghere
i think its because the color is assigned after you create the rarity
so G.C.FLESH doesnt exist at that point
Rarities are established way before everything else?
i think u can return delay
not sure though
all object definitions are run before most vanilla code afaik
you can try defining the colors outside the function
can you try just putting the color before the rarity
Like I said the color works literally everwhere else, so I'm confused
and see if it changes anything
I'll shove it before the rarity though
wait dont you have to call the funtion
return { vars = { card.ability.extra.mult, card.ability.extra.Xmult } }
end,
for _, joker in ipairs(G.jokers.cards) do
local name = G.localization.descriptions["Joker"][joker.config.center.key].name
local text = G.localization.descriptions["Joker"][joker.config.center.key].text
for "E" in name do
Xmult =+1
end
for "E" in text do
mult =+3
end```
did i implement this right?
for _ is fine unless you plan to use that value for something
loc_colour is called by the game, its a hook
ah gotcha
who knows what it does
how hard is it to make a new type of consumable?
is there a context that can check if a card's suit or rank has changed?
or do i have to check for certain consumable types being used
i dont think so
so i do have to hardcode in what consumables can affect it
and risk imcompatibility with other mods
right?
This is what I did to do things when consumables are used, you could probably find a way to finagle it into working using this
maybe hook set_base? idk
That would probably work too
is there a wiki for hooks ive never used them before lol
In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...
thanks so much
❤️
Does SMODS.change_base use the set_base function?
yes
i was a little bit distracted when coding and instead of putting the enhancement name i put my own full name 😭
How the hell
dont ask me i dont even know LOLL
Also
https://github.com/Steamodded/smods/wiki/SMODS.Booster
https://github.com/Steamodded/smods/wiki/SMODS.Consumable
Though I'm not sure how to set up consumable sets
yeah i meant like how cryptid have the codes yk?
I know
There it is
Consumeable Type is the second one
so if i understand this correctly, hooks basically change base game functions, in this case set_base?
and so death, and other tarot cards that would change card ranks/suits
would use set_base
so i can check for joker being owned in set_base and add to his mult?
They don't change it, they insert code right before it, when the function is called, it'll run your code, and then the function's code
tyyy!!
gotcha so i would do
function set_base()
check if joker owned
do something if joker owned
end
how can i make it so a card is destroyed after 3 rounds?
i think @heady siren has this exact implementation in their mod
counterfeit cards
actually no
its not rounds
Not quite yet, it's an idea for now
yeah thats what i meant actually
oh well i suppose you guys can implement together then lol
with rounds i meant use, its just because the ones im using are h_x_mult so basically rounds
would i not use G.GAME.mob_arena_values.area to get the area value
trueee lol
In the enhancement code in context.main_scoring and context.cardarea == G.play / G.hand make it increment a card.ability.extra variable by 1, and if that variable is 3, do return {remove = true}, or card:remove(), if one doesn't work try the other
okok!! tyy!
erm how do i define my shader
local set_base_balatro = set_base
set_base = function(self, card, context)
--do something
local ret = set_base_balatro(self, card, context)
return ret
end
is this what i do for hooks
no, sorry "set_base" doesn't exist I meant Card:set_base
function Card:set_base(card, initial)
im like 99% sure this is wrong
i mean like i codded it wrong
local set_base_balatro = Card:set_base
Card:set_base = function(self, card, initial)
--do something
local ret = set_base_balatro(self, card, initial)
return ret
end
so like this then ?
Card.set_base = function(self, card, initial)
following this
Card: passes self
also local set_base_balatro = Card.set_base
@heady siren is it right?
gotcha



