#💻・modding-dev
1 messages · Page 141 of 1
'start of a new blind'? you mean starting the round?
Yeah
2 is a wrapper for 1, and 3 funnels its return value into 2
All contexts are here minus a few end of round ones I missed
this as it'sown thing right
still that after hand drawn, and might be worth adding to context which cards were drawn?
just making sure
yes
chicot, madness, cartomancer trigger in
context.setting_blind and not self.getting_sliced
What's getting_sliced?
call me scooby because i haven't got a clue xD @merry raven
besides the error it works
should be context.setting_blind and not card.getting_sliced for smods functions
getting destroyed by another effect like madness
Ah I see
it indicates being destroyed at start of round by something like dagger or madness
@frosty dock thanks for putting up with myy BS lol
all good
I guess last question would be away to remove that error
this one?
the screenshot
it goes away if you remove your override of global create_card
is there a way to detect Seltzer disappearing itself, from another card?
it's not a huge deal
remove the group_key
ahh ok
if context.setting_blind and card.ability.extra.state == "primed" then
print("ENHANCE CARDS")
local normal_cards = {}
for _, handCard in ipairs(G.hand.cards) do
if handCard.ability.set ~= "Enhanced" then
table.insert(normal_cards, handCard)
end
end
if #normal_cards >= 2 then
local half = math.floor(#normal_cards / 2)
for i = 1, half do
normal_cards[i].config.center = G.P_CENTERS.m_fm_radiant
card_eval_status_text(normal_cards[i], 'extra', nil, nil, nil, {
message = "Radiant!",
sound = "fm_well_of_radiance",
colour = G.C.ORANGE
})
end
...
When I started the next blind/round, it doesn't seem like my cards are converting to my custom Enhancement, what am I missing? I reckon it's because that the if case is met before the first hand is actually dealt
use context.first_hand_drawn
this is greate now i can just focus on making the cards 😄
setting_blind happens right when you press select on the blind
the actual hard part is done
I see I see
try it
they're both cards, I don't see why not
i'm pretty sure it should work fine
actually, maybe the better way to detect what I want is whether or not k_drank_ex is about to display? That way, it procs on any drink joker, even ones added by other mods?
the best way i can give you to make that work is to wait for the release of lovely 0.7.0 and patch a calculation context for specific messages into SMODS.calculate_individual_effect
Hmmm even after using it it still didn't work, no cards converted to my Enhancement when the Blind started
What I did was to replace context.setting_blind with context.first_hand_drawn, didn't work, it also didn't work either when I included both
are blueprint, perishable and eternal _compat all false by default?
I think it's the opposite?
if you don't define them
perishable and eternal compat are true by default
blueprint compat is false by default
lol doing this made the pack unselectable when in the menu
lol are you sure?
show
give me a second readding it because I think I understand how the dictionary works
no just show me a screenshot of it not being selectable
hold
discord on linux is ass so had to export this video in a weird way to get it to upload
only first few seconds really matter
i don't see how that's relevant
Well u see my code
it's spaghetti so
yup that was it
it's the group_key
oh cool and my dictionary worked to
the error is gone
😄
that doesn't make sense
group_key is literally only used in one localize call inside the booster
¯_(ツ)_/¯
so even if it's controller jank idk why that would be the case
that's within reason to be controller jank
if I add them with the debug menu
close the game and reopen it they work fine
now not working again lmao
I've noticed that if you use the debug menu to add a joker to your 'inventory' then they can still show up in the shop again even without showman, so it might just be debug mode jank?
it is indeed controller jank, any booster spawned through debug cannot be selected w/ controller. Found this when debugging stuff w/ controller a few days ago
i've actually got a run like that right now :D
double baron was invis joker's doing, btw
ok
so if i start a new run it works?
but i have to add the pack with debug
go to main menu and come back to the run for i to work
ok I did it once started a new run now it doesn't work lol
is there away I can just make the pack have a 100% chance to spawn?
(relevant effect)
@frosty dock it's just debug menu jake
I made the pack have a 999 spawn rate
and every time it worked fine
nice lol
again thanks for putting up with my BS most modding communities usually just give the piss of figure it out on ur own attitude lol
it's a collective struggle
is there a way to figure out why cryptid mod crashes when i select pink stake on decks?
joke answer; it's because you have cryptid installed
serious answer; im not sure what pink stake is, is that another mod or is that added by crypid?
it just makes teh deck harder.. i think pink is in the OG game.
do you mean purple stake?
oh maybe let me double check
does it give you a crash log or does it just hard crash
llog .. ill share it
nice!
real quick question, i noticed the head of exodia has the 'mention other card effects' thing going on, how do you do that? I need to do it to reference gold and stone cards with one of my jokers
honestly
I have no fucking clue
Spaghetti code
¯_(ツ)_/¯

Lua do be like that
figured it out, it's by adding m_(card type) to the info_queue
loc_vars = function(self, info_queue, card)
info_queue[#1116390750314307698_queue+1] = G.P_CENTERS.m_gold
info_queue[#1116390750314307698_queue+1] = G.P_CENTERS.m_stone
return { vars = { card.ability.extra.chips, card.ability.extra.mult } }
end,
the return value here is for the variables on the joker description itself
that ability seems very weak — it's harder to hit than Walkie Talkie, and gives less of a reward too
I had it at +7 +7 but was told that was too strong :)
anyopne got suggestion for yugiuoh cards to throw into this mess of code lol
yeah I got it a few messages later, thanks 😄
this doesn't work?
return { dollars = card.ability.dollars, sound = "doot" }
calc_dollar_bonus? And what of the mod prefix to the sound string?
Right.
but in context.before
got this as a hacky workaround for now
G.E_MANAGER:add_event(Event({
func = function()
play_sound("pencil_doot")
return true
end
}))
return { dollars = card.ability.dollars }
Te sound only plays alongside a message
But why 🤔
hey yall
do yall know why text input ui is so weird
its just so weird for some reason
how do i correctly set up "requires" for vouchers? currently it isnt working
yea youre limited to one text input onscreen at a time before you start to get issues
even with one text input on screen
its funky
or its my code thats funky
Greetings Balapals™️®️!
I'm gonna be out for two weeks in Japan for... a thing, so I can't be around for your pinning needs.
Feel free to message any non-Playstack moderator to do the pinning during this time.
Yes, it will count toward Value Up.
No, they definitely don't mind.
No, I don't watch anime. I'll still be going to Akihabara though. I hear the arcades are great and I have an e-amusement pass to use.
Keep ^^^^ing.
~ Egg
?
it's just a table of voucher keys, like requires = {'v_blank'}
oh i forgot to add {}
Make sure you have the v_ and if needed, your mod prefix
thanks
how would one run a check for the number of played cards in new calc?
#context.played_hand for contexts that support it, #G.play.cards otherwise
so #context.played_hand == 1?
ya
new ability idea! what do you think?
Modern Art (Common): Gains $2 of sell value per High Card played
it allows more sell value to be generated, but at the expense of your Hands
how to check for the number of cards in current deck?
#G.playing_cards
thanks
if I want to increase the number of cards players can use from Booster Packs, what's the part of the booster pack that I should be looking at? card.abiility.extra seems to be the number of cards in the pack itself.
how would i make this message appear on the joker its tied to, like how wee joker does it?
card = self?
okay, no, looking at my own code, card = card is correct. Is the message not appearing, or is it appearing on the wrong card?
its appearing on the card its going off of, i.e the face cards its triggering off of
hmm
try juice_card = card I think
edit: apparently it's message_card
do i need to add that or change the card=card thing to that
change
yeah better_calc is really confusing about that
played_hand ain't a thing
it's always scoring_hand or full_hand (depending on what you need)
ok one last thing, why is this adding the mult up twice
i only triggered this guy with three face cards why did he get 18 mult instead of 9
bad context check
does it need context.individual too?
yes
ok thanks
else it also triggers on context.repetition
i see
will it still work with red seals and such?
oh yeah and this gets 'not context.blueprint'
cus its the part that scales the mult
yes, context.repetition is for giving retriggers
got it
what would i set repetitions equal to to give just one repetition?
just 1? or is it more involved than that
also yeah set up more context
turns out, 1 is fine
It’s message_card now fyi. Juice card still works but should ideally be used for juicing an extra card
I think it’s worth the strange notation in this scenario to make standard messages just automatically know where to be though
Not getting any errors, but this isn't doing anything?
how do i make a joker check if there are no cards of a certain rank, and react accordingly?
local avoid = false
for i,v in pairs(G.playing_cards)
if v:get_id() == >rank< then
avoid = true
end
end
if not avoid then
>do thing<
end```
code updated
oh my god I was using some leftover commentary from steamodded as a place for patch and now it's gone 😭😭😭
lmao
I don't even know where it was
thank you! it works
does anyone have an idea of how to change a card's suit? i've been looking around for examples of people doing it but me and my friend haven't been able to do much without running into errors. trying to have it happen when scoring the card and we have the context down but not the function itself
i do
are you doing it via a consumable or joker?
may i see the code?
via joker, on scoring
hold on
this is the code my friend whipped up, and the errors being thrown because of it
old or new calc?
this is for a consumable but, it does check for a suit and if it cant find the suit then it does something else
what is your version
the important stuff i highlighted
thats new calc
that screenshot is my code, and it does work on both new and old calc
i'll try this out
hey so how do you make card skins/resource packs? I already unzipped the .exe of balatro but what do i do now?
thinking how it looks
also the suprise of 3 people actually following my texturepack 😭
Is there a card skin template people use to make custom card skins?
Ah
Thank you!
made a pallete consisting of the main colors the spritework of the game uses, if anyone else wants to use it here you go
why does this crash the game with an "attempt to compare string to number" error? is there something i'm missing?
try get_id() == "Jack" or get_id == "11" instead?
the crash log mentioned chips being the problem but ill try that i guess
nope that didnt work
new or old calc?
i.. dont know what that means
i apologize im really new to modding
what version of steamodded are you running
the latest
1304a is old calc
1318c
bowling ball from morefluff
Crash is on start?
Ok well then that means that it is seeing the jack
How does Hiker work in the base game? Would it be possible to have a consumable that applies an effect like Hiker but with an increasing number of chips each time its triggered, and only have it apply to cards of a specific rank?
so like a card having the hikers ability?
I have my lua script in the mods folder but for some reason it's not finding it (using Steammodded and lovely both work and I can see the mod window, other mods, but not mine)
Ahh okay i think i got it 🙂
What that exactly is is a consumable that when first used gives +5 chips to all twos
try commenting out certain lines until it works, then figure out why that line is causing the crash
but each time you use another one of the same consumable the amount of chips it gives increases
replace if context.individual and context.cardarea == G.play with if context.cardarea == G.play and context.main_scoring
I mean, another thing I was thinking of is have it tied to a variable that goes up by one when the consumable is used
oh huh
i found the problem
my dumbass didnt realize you cant load a save while testing
ok so i think what caused the issue in the first place is that BalaUI puts "" around the values in the extra config
after removing them it still crashed because i was trying to load a previous save to test in which you cant do oops
okay we're getting somewhere
joker_main isn't the right context but that's for after i get this even ingame at all
so: how do I get this to appear as an actual joker in the list I can cheat in and test?
I'm guessing it doesn't appear since I'm not giving it an atlas?
Can you do lovely patches into other mod files, specifically into SMODS? I have it targeted but it doesn't actually patch
talking bout this
no idea but maybe mult -= 5?
a_mult_minus + the card.ability.extra.mult into a string type
How could I calculate how many Enhanced Cards are in the full deck
This is my second day Balatro modding but I program in C a lot sorry 
I was looking at this earier, I made an effect based on what Drivers Licence does
if G.STAGE == G.STAGES.RUN then
if self.ability.name == "Driver's License" then
self.ability.driver_tally = 0
for k, v in pairs(G.playing_cards) do
if v.config.center ~= G.P_CENTERS.c_base then self.ability.driver_tally = self.ability.driver_tally+1 end
end
end
end
basically to start with you need an update function to tally up the amount of cards its looking for, for the description
then in the calculate function you do whatever you do based on that code
if you wanna copy one of my jokers and see how a similar effect is done
in my case the function gets the number of 7-rank cards in the deck, divides that by 7, and then multiplies by 100 to get chips
Should be a decrement integer operation
So, something like this for the update?
update = function(self, card, dt)
if G.STAGE == G.STAGES.RUN then
card.ability.extra.EnhancedAmount = 0
for k, v in pairs(G.playing_cards) do
if SMODS.has_enhancement(v) then
card.ability.extra.EnhancedAmount = card.ability.extra.EnhancedAmount+1
end
end
end
end
is there a way to add text boxes and sounds when a joker is triggered like cardsauce does it or is that only a cardsauce thing?
SMODS.Sound and return a sound from calculation (new calc dependent)
new calc?
why this break in the newest commit of steamodded?
Im getting a crash when the joker is loaded
update = function(self, card, dt)
if G.STAGE == G.STAGES.RUN then
self.ability.extra.XMult = 0
for k, v in pairs(G.playing_cards) do
if v.config.center ~= G.P_CENTERS.c_base then self.ability.extra.XMult = self.ability.extra.XMult+1 end
end
end
end,
calculate = function(self, card, context)
if context.joker_main then
return {
message = localize{type='variable',key='a_xmult',vars={self.ability.extra}},
Xmult_mod = self.ability.extra
}
end
end
}
crash log ^
steamodded version above 1304a
i fixed my problem
SMODS.Atlas {
-- Key for code to find it with
key = "FOM1",
-- The name of the file, for the code to pull the atlas from
path = "FOM1.png",
-- Width of each sprite in 1x size
px = 71,
-- Height of each sprite in 1x size
py = 95
}
SMODS.Joker = {
key="Jill",
loc_txt = {
name="Jill Stingray",
text={"Gain 1 random Consumable of any type and lose $#1# at end of round"},
},
config = {
extra = {
money = -1
}
},
atlas='FOM1',
pos= {x=0,y=0},
rarity=1,
cost=2,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.money } }
end,
calculate = function(self, card, context)
if context.end_of_round then
return {
calc_dollar_bonus = function(self, card)
local bonus = card.ability.extra.money
return bonus
end,
SMODS.add_card(set=='Consumeables',soulable==true)
}
end
end
}```
can't figure out why this basic joker isn't loading
just doesn't pop up in the joker panel at all
any chance it's not loading since it's getting mad at some loose json files?
Guys is there a way for me to add a info_queue to a card whenever I want?
Its not a specific edition or enhancement
try card.ability.extra instead of self.ability.extra
I’ll try it out later, I’m taking a break from coding, thanks though
got an odd problem with my custom card textures, they seem to have some sort of odd outline to them. any ideas as to what would cause that?
looks fine to me
you sure? because when compared to the default cards, they aint got that
just to be clear, what part of the card are you referring to when you talk about an "outline"?
the edge of the card is identical
i see what could be described as an outline around the colored sections
is this the outline you refer to?
yes
should i also send the high contrast versions
do the hc versions also have this outline?
huh, odd
huh
i have no idea why this would look weird
everything i can think of is turning up negative
part of me feels like it might be an issue with gimp discarding unused RGB info but idk why it would do that
No, the outline issue is caused by how the game/love2d processes sprites with antialiasing
It can be fixed by adding a 0-alpha outline of a color of neighboring pixels around the sprites, but it's a lot of manual labor
I have a script that is able to fix this automatically
I can share it if you want
i feel like that'll be my best bet since gimp is saying "nah, we dont need those outlines"
it's not a gimp problem, nothing does that automatically
from the art software I mean
aseprite doesn't even recognize 0-alpha colors as colors
It requires python and pillow to run, and also edit the file and change the path (YOUR_USERNAME_HERE and YOUR_MODNAME_HERE)
To use it either just launch as-is and it will process all the sprites in the mod folder (if the path is correct), or alternatively, it can process individual sprites from the mod's 1x folder if you drag & drop them into the script file (doesn't work on images outside of the mod folder)
Anyone think i should make the chance lower for this?
is there an alternative to SMODS.eval_this if i want a joker to show an upgrade message outside the normal calculation steps because the console keeps telling me the function is depreciated
Maybe 1 in 5 so double oops doesnt create infinite consumables
true
or 1 in 7
ayyy that did the trick, thank ya!
why not use card_eval_status_text()?
bump
or would that require an edition
Just do a check before you append the info queue
Oh right I misunderstood, you just need to patch into generate card ui iirc
Wherever it handles info queue
whats that function? dont see it on the documentation
I tried that, but it crashes because _c.ability is null
and If I add a check for _c.ability it doesnt do anything
it does the message, what documentation? it's from the game, not from smods
ah sorry, assumed it was an smods function, ill look for that one
vague idea, what do you think?
Emotional Damage (Rare): Gains X0.25 Mult per discarded Flush (Currently X1 Mult)
name is subject to change, it looks like this and i don't know what emotion it conveys
amazing file name for an amazing script
is there a way to set chips/mult to something?
not add not multiply, set
for context, the joker i want to make
debugPlus does it with the add mult/chips button i think
the idea being i take the current chips/mult, take the log base two of them, math.ceiling the result, and then make 2^[thatnumber] the chips/mult
so investigate its code?
thats probably your best bet
i finally got around to doing this and it crashes specifically when i have ortalab on and does nothing when i have it disabled. im wondering if i have the contexts wrong or something
it otherwise does nothing on its own
im glad i can look through the documentation but im having a lot of trouble finding what i need
hi, i'm using variable colours for one of my jokers, and they're not working — is the bug in this line?
colours = { ({ G.C.Tarot, G.C.Planet })[card.ability.extra.chosen_type + 1], ({ G.C.Planet, G.C.Tarot })[card.ability.extra.chosen_type + 1] } } }
that's not the right ref for the colors
is there a context for when a hand is being drawn? Like, I want to look at the cards and perform actions on them before the player draws them.
G.C.SECONDARY_SET.Tarot
ooo
checkered deck?
can rarity drop rate be changed with a voucher or naah
I'd assume I'd have to repool the rarities right
well I assume custom rarities can but idk about the vanilla ones, because I can't seem to find what the name I'd use for them is
ooh hello!!
bumping this
comparing it side by side with a normal game joker from the smod testing ones i really can't see the issue
it's pretty simple so i don't know what'd be causing it
wait.
okay no it wasn't a missing comma
i'm kinda stumped
should i also replace self.ability.extra.XMult?
your header is invalid
friendsofmuuyo
does your mod show up in the mods list
those are from VS code autogenerated stuff i believe
yeah it appears fine
the joker itself just doesn't appear
oh i see
probably
it also seemed to be loading the code fine?
remove the = after SMODS.Joker
it probably didn't because the statement you have is valid lua
just doesn't do what you want
wheyy!
gonna have to fix the loc section
but it at least appears
thank you kindly

okay, now my joker crashes when trying to score
update = function(self, card, dt)
if G.STAGE == G.STAGES.RUN then
card.ability.extra.XMult = 1
for k, v in pairs(G.playing_cards) do
if v.config.center ~= G.P_CENTERS.c_base then card.ability.extra.XMult = card.ability.extra.XMult+1 end
end
end
end,
calculate = function(self, card, context)
if context.joker_main then
return {
message = localize{type='variable',key='a_xmult',vars={card.ability.extra}},
Xmult_mod = card.ability.extra
}
end
end
}
and heres the crash log
Xmult_mod = card.ability.extra
there should probably be .XMult at the end of that
damn, it really do be the simple oversights
hm
i dont think it should be trying to add a table as a mult
i dont think its debug plus that adds the +10 chips/mult buttons
i believe those are built in debug options
did you replace the vars= one as well to have the .XMult
so does anyone have any input on this problem?
you could also check how plasma deck does it, i just remembered that
i think there's global variables for current chips and current mult
where would decks be in here?
back
no shot in it being named mult and chips is there?
i think it is
hmmmm
anyone use debugplus watch lua?
it'd be nice to have live updates, but it seems you need to "take ownership" and such, but i can't find documentation
is there a way to get log of an arbitrary base?
math library is saying theres only logs for base e and base 10
im needing base 2
also does anyone know the specific version of lua does this game use?
i know its not 5.3
but im also assuming its 5. something
you can just use a log transformation right
probably
how'd i do that exactly?
i might have learned that in calc but i dont remember if i did
iirc from calculus its log10(X) / log10(B) = logB(X)
Hello, anyone know if its possible to create a new color for joker description, like i want to create a color like the holo one who switch but with differents colors
5.1
noted
tbh little peeved abt that because ive snooped around a lil in 5.3 documentation and it seems it has some nice things
You can define a new Color using the HEX function then use the V: text tag to set the Color to that variable
hmmm. that's not it
i'm trying to use DebugPlus's function "watch lua (etc).lua"
to reload my main file every time i modify it
but it prints that I need to use take_ownership
Current state and quick look around of the Balatro Mod Manager (don't mind the steamodded versioning, it's still wip)
which I'm attempting to do, but it's printing a cryptic error
(and there's no documentation of take_ownership, just discord message searching...)
anyone know how can i get the current maximum consumable slots? and also how i can get the current amount of consumables
two things
first, both args.chips/mult and chips/mult return nil values
second, my game crashes before it enters the joker scoring stage
any thoughts?
how do I get the color for a variable suit name (like the Ancient Joker)
how do i check how many rounds have passed after buying the joker? like a perishable sticker. I need it to start working after 3 rounds have passed
start with checking invis joker maybe?
look at the example joker mod for castle
i've never made a mod for this game before but have coding experience and lua is obviously pretty easy. i'm currently debating whether i should start small with a set of jokers or jump to "the big one" and try a mod inspired by lethal company lol (blind amounts are lower, shop is larger but you have to keep money until the end of an ante and pass a quota to survive) (obviously needs some work but the concept hooked me LMAO)
(for context, trying to set the chips and mult to something instead of adding/multiplying them)
probably the first one
at least get a few basic mods set up before you dive deeper
unfortunately true
best to know how the game ticks before trying to make it tick differently
one more idea for tonight :D
Inception (Common): +4 Mult per played hand this Blind
i did but im a bit confused
another idea
make a counter variable in the config, then have it count up at end of round and make it so that the joker only does its actual stuff when that counter is greater than x value
How can i force every joker in the shop into a negative
that's kinda how the invis joker works
noted
if I want the Nth Joker, I use G.Jokers[N], correct?
Args was a local variable that decks use in their effect function
G.jokers.cards i believe
yep
then yes do [N] at the end
Hi, would someone be interested in helping me figure out how to mod the game? Sit down, go through examples, how a mod is set up, make a small example mod with me? I have zero knowledge in lua but I'm confident I can patch together some stuff to make a mod happen :)
STEAMODDED 1.0.0
A tutorial on how to make a modded Joker.
https://github.com/art-muncher/Example-Mod -- EXAMPLE MOD
https://github.com/Steamopollys/Steamodded -- STEAMODDED
https://github.com/WilsontheWolf/DebugPlus -- DEBUGPLUS
-----------------------------------------------------...
tis what i used
I'll watch it, thanks
and a willingness to delve into SMODS documentation
if you want to recreate a feature that is already in the game / closesly matches what already exists dig through the games code to see how it was done
excellent. The text works. Now to get everything else working (already got the cards properly flipping, it's just the other two parts)
ok how could i find where it defines args
args is usually the name of a generic variable passed into a function.
so it'd be defined at function creation
well here
but like
this isnt really helping me
cus i want to know where it gets args.chips/mult from
Probably in state_events or common_events
State_events.lua or common_events.lua
ok
...
is it really that simple
actually
no
thats total chips
might be those though
yup got the timer thing workng
This code did work back when I had it only flipping Hearts cards, but now that it's a variable it's not working?
alright so my joker works
however, the counters dont update when it does what i have it set to do
does anyone have any input?
actual picture of stats because i didnt realize i only hovered over it for like half a second
huh.
this is spawning 13 cards. for some reason?
do you use latest smods or old calc?
me or them?
you
let me run a quick git pull on smods, but it should be the latest ver
you need to update hand text
how do i do that then
then this should work
if context.end_of_round and context.main_eval then
any idea why the cards won't spread out here?
SMODS.current_mod.config_tab = function()
local area = CardArea(nil, nil, 4 * G.CARD_W, G.CARD_H,
{ highlight_limit = 0, type = "title" }
)
G.playing_cards = {}
for k, v in ipairs(SMODS.Mods.SuitOrder.config.suit_order) do
local card = Card(nil, nil, G.CARD_W, G.CARD_H, G.P_CARDS[v.card_key .. "_A"], G.P_CENTERS.c_base)
area:emplace(card)
end
G.playing_cards = nil
area:align_cards()
return {
n = G.UIT.ROOT,
config = {align = "cm", r = 0.1, colour = G.C.BLACK, emboss = 0.05},
nodes = {
{
n = G.UIT.O,
config = { object = area }
}
}
}
end
you're close
update_hand_text({delay = 0}, {chips = hand_chips, mult = mult})
yep, just updated
just so i understand for future, i'm assuming this context means that it won't run the same code if it's already been run within that context?
no, context.main_eval specifically blocks retriggers
and just put that in the if statement where this happens right?
that's not what it's supposed to do.
I've just forgotten to fix it
also with my config menu, is there a function to hook to detect when these cards are rearranged?
alright it's been fixed
noted, the wiki for this is just a bit hard to understand
thank you kindly 
found the page with all the contexts, the github wiki search is a bit temperamental so it seems i have to use the repo search
it was always supposed to just refer to contexts that trigger on a joker without any secondary card involved
okay
one joker done
onto however many more
(each being super weird effects...)
isn't that joker_main?
joker_main is the main scoring phase of jokers
e.g. end_of_round gets a main context on jokers as well as context.individual and context.repetition
gotcha
someone may decide to add their own effects though, which is why we don't want to encourage negative context checks
how would i get that sound to trigger same time as the joker activating
(actual sound pending just using plasma sound bc ability is similar)
i.e. context.end_of_round and context.main_eval instead of context.end_of_round and not context.individual and not context.repetition
oop post code too
ooh it's multiple sounds
put play_sound in an event
if that's the case put it in a func in the return table
yes, put keep the message outside
outside the func? like it is currently?
is there a way, without context (I'm in Blind:stay_flipped, not a calculate), to tell if a blind is active or in the shop?
yeah, like it is here
G.GAME.blind.in_blind
thank you lol
right, status texts use another set of events
so you also need to put the sounds in an event 🥴
like this?
no
damn my reckless copy pasting failed me
func = function()
G.E_MANAGER:add_event(Event({
func = function()
-- play_sound(...)
return true
end }))
end,
i
see
bump
you forgot to return true
what should be returned true
oh ok i see
yeah i noticed that part
thanks
hmmmm
the sound isnt really in sync and its bugging me
bump
@frosty dock i know this has been asked a million times but how to patch smods with lovely
what mod id
seems it's just _
how to get top card in cardarea?
use the cards table
cards[1]?
for the leftmost one yeah
having a weird problem with high contrast stuff in deckskinslite
everything seems fine with the code and textures, but why are the textures swapped in-game?
it works perfectly fine as a standalone mod tho
oh wait i think i found out
nope, still the same, tought it was a missing comma in highContrastTexture
(i know it could be fixed by just changing the name but damn i wanna know what did i do wrong)
there's no context for the "money gained" phase, yes? i'd like to have my joker spawn stuff specifically then but it isn't a priority
there's none on the context page so i assume not
aaaanyway
now to figure out how to make the consumable type random...
since as far as i can tell add_card needs you to specify the type?
bump
is there a way one could discard an amount of random cards from someone's hand after they play? like, the same way that the hook boss does it
should be able to grab the source from the game, look at that blind, see what it does, then feed it a local that's pseudorandom
so this was because i didn't set card_limit
card prediction isn't easy
(the crash)
area should be G.Consumeables (without double quotes)
without quotes
ah!
okay
i see what you mean
learning lua seems to be a process of endurance
mmm still getting a crash
hello?
this Sucks but this is the best way i can find to do it
is there a guide on how to create mods?
i'm trying to make some custom Tarot skins/Textures(?) but i'm not seeing a clear way to do that with steammodded unless im just looking in the wrong places, is it similar to deck skins and can i do this with DeckSkinsLite or do i need something else?
Is it better to just downgrade before better calc? it seems to be the cause of a ton of crashes, I can't even get ceres to run by itself without a crash
most likely
Yep, now it doesn't crash when i get a straight. Thank you!
still looking for help!
full deck is in G.playing_cards
and i made the dreams true
misprint moment
thank you!
Fun fact: When I did truly glass cards, you can actually see 2~3 future cards almost the same way, ahaha
was this directed at me?
Had to rewrite how the deck works a bit, but it was fun
yeah
what?
compile a table of all cards of the desired rank, choose a random one, and destroy
im not looking to destroy them from the full deck, just the scored hand
then use context.scored_hand
It's better to do it after all joker calculations, before putting cards to discard:
functions/state_events.lua
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = (function()
if G.GAME.modifiers.debuff_played_cards then
Before this part you can insert your logic
delay(0.3)
if G.GAME.selected_back.name == 'Random Deck' then
for i=1, #scoring_hand do
local card = scoring_hand[i]
logic to destroy
end
end
Don't forget to handle Glass Cards properly
otherwise destroying them will not add mult to Glass Joker for example
And in order for jokers that do sth when card is destroyed
after doing your destroy calculation you will need to call calculate_joker once more
okay i searched on github and found code that does what i need the murderous urges are gone
nevermind i'm going insane
Alas,,,
@tight thistle if your destroy logic is simple enough you can put it here:
functions/state_events.lua
in this loop, func: G.FUNCS.evaluate_play
local cards_destroyed = {}
for i=1, #scoring_hand do
local destroyed = nil
--un-highlight all cards
highlight_card(scoring_hand[i],(i-0.999)/(#scoring_hand-0.998),'down')
like that
then you will not need to recalculate card destroy joker effects
because they are handled at the end of this loop
That's if joker removing card
if the removing effect is caused by sth else
it's the way to do it
For example if you are doing a Back that will remove random cards
calculate_joker is not a place to do it
it is a joker destroying the cards
then yep, in calculate_joker
just search for examples from joker that removes 1st discarded card and gives you 3$
should be very easy then
okay, thank you
not calcuate_joker
use smods methods
uhh
in your joker's center put a calculate method
see but how would i go about destroying multiple cards as a result of an enhancements ability
my bad, I always modify the og source first, and when I like everything - only then transfer to SMODS
does anyone have any ideas? (video where reply is)
its more in sync than it was before but its notably not at the right point and its bugging me
(code)
maybe give the event a delay like with other events
its already too late though
is this not how you use the destroy card context
I dont think it requires a boolean value in (Hearts)
that part works fine, the boolean is to ignore debuffs
its not destroying any cards as is, earlier it was destroying itself (wrong), and when i can get it to destroy cards its only destroying cards that are scoring
is there a way to reload the game without closing and restarting?
Wdym?
i set up a task in vscode that boots the game with a hotkey
i already play in windowed mode so exiting is fairly fast
I play on a drawing monitor so i can assign a key to launch an app
you could probably set up the task to close the game then open it
fixed it!
added delay=0 to the return
lines everything up nicely, if not making it a little fast
tried it bc i saw this in the code i copied
hold M to restart
gonna try having both delays-
oh
...
-both delays at .5 so its a little slower
hopefully its still aligned
nah it aint, oh well
the only way i can get it to do what i want is to context.before, loop through all cards then destroy them manually but that causes phantom cards to be in the deck. anyone know how to fix that
Did not know that
i dont understand, where do i put this and how do i format it?
in your joker definition
OKAY I CHANGED NOTHING BUT IT WORKS NOW
HERE'S THE CODE TO GENERATE A COMPLETELY RANDOM CONSUMABLE
AUGH
calculate = function(self, card, context)
if context.end_of_round and context.main_eval then
SMODS.add_card {
set = 'Consumeables',
area = G.consumeables,
soulable = true,
}
play_sound('myo_opencan')
return {
dollars = card.ability.extra.cost*-1
}
end
end
hmm
now i think i just need to verify that the consumable area won't fill up
which is easy
does anyone know what per means here perchance?
just, anywhere in the joker?
i think that's pitch
i was looking at the documentation
it seemed as such
mhm
percent
yeah, table keys are unordered
order only matters for loc_txt innit
it doesnt seem to like it
i wish i could get it so that i could send the message and play the sound with a different delay
cus if its delay = 1 the sound is out of sync
but if its 0 the message dissapears too fast
no that table is describing what's in context
i have a function that is supposed to discard 2 random cards in your hand at the start of a new round/start of scoring, but it's only discarding after the hand is scored. i essentially copied the boss blind "the hook"'s event code verbatim but i'm unsure what makes it discard afterwards instead of before
i put an immediate function trigger but it didn't change anything lol
hey is there like a template of the cards but with the art removed? i wanna make custom face cards but i dont wanna go through the tedious process of deleteing all the art but not the borders
u could prob just recreate the borders
i have this one i use as a base
alr thx
could you tell me what im doing wrong? i really want to know
is there a way I can make a definition window pop up? Like, when you hover over Deja Vu it tells you what a Red Seal does?
put this in local vars, replacing the GPCENTERS stuff with the key of the thing you want to put in
anyone know how to put a message in add_event function?
where do you find the code for tarot cards? i might just be blind but not sure where it is
looks like card.lua
line 1373 is that bit
is there a way to put a message in an add_event function?
preferably like the normal ones for joker cards but ill take anything text based at this point
thanks!
hmmm
anyone know of any mods that fuck with the deck card order?
i wanna make all the topdeck hearts
draw all of them first
modify G.deck.cards
no?
what's shown there is the fields that you can access through context
Anyone know where do i find or how to edit the "Oops all 6's" probability from 2 \ 3 to 5 out of 8? or else?
then what is it that im looking for in that page exactly?
can i get any help with this?
calculation contexts and such
card_eval_status_text
set that to equal a message and put it in the add_event function?
no, thats a function
oh
or use SMODS.calculate_effect with a return table
im still unsure what for
crashing, not sure what the cause is, making a texture pack through Malverk and this crash keeps happening when i open the game
but i put that within the addevent function right?
I need a better way to balance out the Yu-Gi-Oh cards
where does local_vars go? I tried it in the joker definition function and in the hovertext def, and it didn't do anything in either location. No breaking, just nothing
So far only one I got is pot for +2 draws
what's going on here?
I want a joker I made to have a definition slide, like how Deja Vu defines red seals
I was told to put info_queue into local_vars but I don't have a local_vars
in your loc_vars function, add to the info_queue table
one sec
the image above goes in the table passed to SMODS.Joker
loc_vars goes pretty much anywhere
@cerulean rose is there a way to program a joker card to add like a counter to it when a specific card type is used and if 3 are used I can make it force a +2 draw?
Just curious if there is functions for this
all you need for it is the loc_vars line, the table.insert line, and the end line right after it
context.using_consumeable
ahh, I think I'm still using the old syntax
oh god what is that
what do each of these args mean?
yeah ok use SMODS.calculate_effect i have no goddamn clue
hmmm
okay
any recommendations for like, debugging or dev views or anything?
e.g. actually figuring out What's inside that table (or whatever it is)
i'm green to lua
pass a table like you'd return from calculate
you can use inspect on the table to get more information about its contents
So reading the wiki what's the best card type for putting a card in ur deck?
?
You know packs u open with special versions of cards u add to ur deck
Like steel stone ect
How do I say get the pot of greed card to go into the deck
So if u draw it can be used as a consumable for a +2
#1321617606318493829 check this out
hmmmm
you're saying in the ingame console, yes?
I'll take a look when I get home
no i know, the depth isn't working so i'm just a bit confused
Not a deal breaker to just make it like a consumable tarot card but it be funnier to make it like an actual card lol
im gonna fuckin
putting the message in the calculate_effect provides the exact same fuckin issue
this looks right, right?
use inspectDepth then
no, the SMODS.calculate_effect call should be in the event function
it is
no, it's a separate function
no its not
it needs to be inside func
mhm
the inner one
how could i make this discard only one card, instead of two?
i think that tried to load so much text the game crashed
now to keep testing
it's a list of cards
drawing happens from the end
so like this?
Okay, I turned one of my jokers into a modern style - and got the definition window working - but now she lacks a sprite. is Atlas the sprite?
@cerulean rose i dont even know any more
atlas and pos both need to be set
code looks like thus
checks out, i'll just have to figure out how in the hell to do what i want to do
this is my first blush, i just have to actually learn lua
oh god its that bad
truly
that would put all of the hearts at the bottom
oh
also you'd need to copy everything back
yeah
bumping this
try changing bounds of for loop
this worked lol! i was misreading the syntax of a for loop
any way i could make a variable of the rank of the removed card? like, if a 7 was removed, set a variable to 7. i'm unsure if this could work perfectly as this uses "the hook"'s code, which removes a card rather than discarding it
selected_card.base.value
So, this used to work, when I was using the old syntax to define the joker. How do I detect the joker now?
needs to be j_modprefix_key
ahh
but also you should use SMODS.find_card
every time i try to do an operation on it (specifically card.ability.extra.mult = card.ability.extra.mult + (card.ability.extra.mult_gain * num)) it gives me an error about trying to perform arithmetic on a nil value, do you know what the issue could be?
is num defined?
is card.ability.extra.mult_gain defined?
also if you want the chips value it would be selected_card:get_chip_bonus()
yes, here's the full function (i could easily be doing something wrong though lol)
can we see the config definition
also do this
also is there a reason the upgrade happens way after the discard?
nothing specifically, i just forgot to reorder it lol
the idea is that it adds x0.01 * the rank of a random discarded card to the multiplier, not the chip value
i'm pretty new to lua so apologies for any incompetence lmao
i figured face cards should be just a 10, aces an 11
What should I do if I want to have two messages appear on different places (namely one on a joker and the other on a playing card) at the same event/timing?
What do you think would fit the theme of this card 4 random jokers cards or 4 random hand cards?
Playing cards.
If I was actually good at coding I would unironically code a graveyard into this game
didn't work either, raised fist uses G.hand.cards[i].base.nominal for its mult, which makes me think it's something with selected_card
i may just have to adapt raised fist which does this
if self.ability.name == 'Raised Fist' then
local temp_Mult, temp_ID = 15, 15
local raised_card = nil
for i=1, #G.hand.cards do
if temp_ID >= G.hand.cards[i].base.id and G.hand.cards[i].ability.effect ~= 'Stone Card' then temp_Mult = G.hand.cards[i].base.nominal; temp_ID = G.hand.cards[i].base.id; raised_card = G.hand.cards[i] end
end
if raised_card == context.other_card then
if context.other_card.debuff then
return {
message = localize('k_debuffed'),
colour = G.C.RED,
card = self,
}
else
return {
h_mult = 2*temp_Mult,
card = self,
}
end
end
end
there already is one
it's not shown on screen though
Wait cards are actually stored somewhere?
I figured the game would just store the last used card
i'm pretty sure it stores every discarded/played card somewhere
G.discard.cards?
Fucking Christ
I wonder if I could actually get this to work lmao
I could literally add graveyard return card effects
Who's the other guy
If wants he could just have whatever I make if he wants to add it
I highly doubt my spaghetti code would compare to his
https://ptb.discord.com/channels/1116389027176787968/1290737736004927498 https://ptb.discord.com/channels/1116389027176787968/1323066843501432903
one is a concept, the other one has a mod out
update = function(self, card, dt)
if not G.SETTINGS.paused and G.jokers then
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_gain
return true end }))
end
end,
how would i go about making this event trigger every second and only every second? (joker that gains +1 chip every second)
Hmm his mod looks to just be multi cards
My plan is to actually incorporate card effects
Like for example pencils exodia win condition
they are inspired by the card effects. but a lot of things just don't translate over to balatro
(at least for the second one, idk about the concepting one)
Well it's a meme mod
Not meant to really be balanced lol
Meant to just be a what if thing
😴
Not really expecting monster reborn to do a x100 multi
I'd expect to restore a joker card or something
a
a
I dunno if balatro has the ability to loop a function
But maybe do something where u can loop back to the beginning of that function when it ends
you see the problem here is the function will finish instantly and itll just keep doing that forever and ever and no other game calculations will happen
i think its something to do with update but idk how to make that wait a second
how exactly would i make this wait 1 second 
I wish you could log the game with debugging even if it doesn't crash or be nice if you could see errors
It would make trouble shooting easier lol
Kinda like how GMOD does it where it'll spam the console
sendTraceMessage is how to send messages to the console
in the debug the mod?
DebugPlus can show that in-game, but it's primarily for output to the CLI console that appears.
Copied this if condition from Dragonite.
Is the highlighted part necessary?
Like, what problem would it cause in the future if I remove that part?
Hm... how would a SMODS-rebuilt Observatory-like Voucher be implemented...
so i may be struggling a little bit
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_gain
tried to do this but upon realising that this doesnt work as i wanted i tried other solutions and i cant figure out how to make it the way i want
Is uncommon ok for this joker in your opinion
seems fineish
the spectral part is making me want it to be rare but it should be fine i think
its .8 for tarot and .2 for spectral
oh thats fine then
ty for the feedback
nice 4am ping
the answer is wait for lovely 0.7.0, it's currently borked
...on my groove again - if I wanted an Observatory-like scoring of consumables to be done (w/o being on a Joker, instead being tied to whether you have redeemed a voucher or not), do I need to hook into calculate_joker or something else? @frosty dock 🖐️
wdym by hooking into calculate_joker
we have context.other_consumeable
i may have lost my thought process and now i have no idea why this doesnt work 😭
Yeah, I use that for the Win98 Joker... but I have a Voucher being redeemed being the main condition. Where would I put the check?
oh I misread 🥴
unless we add calculation to vouchers, you'd just have to hook calculate_joker
Though, because of Card: being in front, that's a part of the hooking too, correct?
local calcjoker_ref = Card:calculate_joker
function Card:calculate_joker(context)
...
Card:calcjoker_ref(context)
end
that's not how that works
return calcjoker_ref(self, context)
though something like that won't actually stack with observatory
so maybe I do just make voucher calculation 
That'd be the easier route, tbh.
...would this mean I am at least partially responsible for score_card and this now? 😛
update = function(self, card, dt)
if not G.SETTINGS.paused and G.jokers then
G.E_MANAGER:add_event(Event({trigger = 'after', blocking = false, delay = card.ability.extra.seconds * G.SETTINGS.GAMESPEED, func = function()
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_gain
return true end }))
end
end,
im sorry this is like the third time im posting this same code but slightly different but it seems like something is happening with either update function or the card.ability stuff thats making it add up so much (for context i only want the joker to get 1 chip every second but its reaching like 700 chips in 2)
From what I notice, G.TIMERS.REAL could be used. You'd just need to set the "current" value of G.TIMERS.REAL to a custom value in the Joker and then set chips based on G.TIMERS.REAL minus the initial value to get the time that had passed since the initial addition of the Joker to hand.
math.floor(G.TIMERS.REAL) % 60 will give you the current timer in seconds since launch of game, though.
We’d need to fix how vouchers are saved too, iirc when they redeem it just toggles a boolean value
Yeah, that's what currently done.
fortunately i dont understand anything of what you just said so im left to try and figure this out myself 
oh lord seems like i managed to set the entire games timer to a different value
funny thing is i can just make this based off of time since launch and have the chip amount on later runs be something dumb like 1000
I love the right one
Same
it may just be me but the left one is a little bit basic imo
the right is the tier 2 of the left right?
I'd say so, it has the line in the middle of the name
I think I have debugplus
just not sure how to use it other than press 3 to spawn cards
what if the right one used the dithering that Tarots use?
yeah left one is wheel of wheel of fortune and the right one is idk yet lol
gonna be like 1 in 4 to spawn a wheel of fortune on blind select or something stupid
add negative chance perchance
what do you think the right voucher is for
I don't know
it's for warding off predators
the bg is just incantation with the cards removed lol
what 😭
yeah i thought it was a weird move too but like im not in charge of anything so
hee hee hoo hoo and so forth
Im hoping they announced that somewhere
I suggested it
When aure added calculation contexts for the deck and discards
Although I had also suggested to allow it to be controlled per context
its just going to make it so people wind up making code that breaks with other mods loaded tbh
