#💻・modding-dev
1 messages · Page 466 of 1
where's the text box code? i would like to change the text box background
it worked... but i now see this error when i click play(like the deck not the menu button):
card.lua:4944: attempt to index local 'obj' (a nil value)
I'm struggling to figure out what passes into cards and what doesn't. Seals have the same calculate function as enhancements, right?
btw i'd like to say that i'm cooking
i believe so? no reason for it to be different
what does this mean:
card.lua:4944: attempt to index local 'obj' (a nil value)
(i am stupid)
you've incorrectly set up an object. If it happens when selecting a deck, it's probably the modded deck you're making. But you'll wanna check the entire crash log
Yeah, okay, so post_trigger only gets sent to jokers. I'm just missing the specific thing that's happening that limits that scope, I guess
oh, don't try and continue runs if you're changing things drastically in your code
just start a new run
no its no like i started a new run
and then when i got the joker it got that error
that means that specific joker has something that the game tries to check that's broken
is there a way to let jokers in the collection be selectable? aka to change the area config highlight limit to 1 instead of 0?
i can send the code its not that long
Crash report and the code would be handy
is perma bonus mult/xmult in base smods yet
yes
wait it didnt crash again i think it works tho the tetx isnt showing up and i thinks thats becuase i dont know how to set up the loc_txt propelly with localization:
the lua file:
key = "SpiderSushiMod",
path = "SpiderSushiMod.png",
px = 71,
py = 95
}
SMODS.Joker {
key = "top_hat",
atlas = 'SpiderSushiMod',
pos = { x = 0, y = 0 },
config = { extra = { chips = 15, mult = 10 } },
discovered = true,
cost = 5,
blueprint_compat = true,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.chips, card.ability.extra.mult }}
end,
calculate = function(self, card, context)
if context.joker_main then
return {
chips = card.ability.extra.chips,
mult = card.ability.extra.mult
}
end
end
}```
the en_us file:
```return {
descriptions = {
Joker = {
top_hat = {
name = "Top Hat",
text = {
"Gives {C:chips}+#1#{} Chips and",
"{C:mult}+#2#{} Mult when scored"
}
}
}
}
}```
is it perma_mult or perma_bonus_mult
can you please surround it on both ends in 3 ` marks?
ooh
thyere
localization isn't working because you're missing the object type prefix and the modkey prefix
how do i do that then>
[objectprefix]_[modprefix]_[objectkey]
no like wher edo i put it
oh, c'mon discord
and how
for example, this is a joker, so the object prefix is 'j', my mod is Balatro Goes Kino, and I've set the prefix in the .json file as 'kino', and the joker's actual key is 'titanic'
so j_ssm_top_hat would work?
presumably, yeah
I'll have to do a proper deep dive into how SMODS does its calculations, and for now change the effect I have in mind. Bit scared of messing things up too badly
uhh now that the text is loading i got the crash again:
i think it crashes because of the code or smth idk
How are you loading in your files?
what do you mean loading my files
what did i do wrong
uhh can i see the code
that one cryptid formatting proposal from a few months back:
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
local myspot = -1
if context.other_card:get_id() == 4 then
for index, value in ipairs(G.play.cards) do
if value == context.other_card then
myspot = index
end
end
if G.play.cards[myspot + 1] then
G.play.cards[myspot + 1].ability.perma_mult = G.play.cards[myspot + 1].ability.perma_mult or 0
G.play.cards[myspot + 1].ability.perma_mult = G.play.cards[myspot + 1].ability.perma_mult +
card.ability.mult
end
if G.play.cards[myspot - 1] then
G.play.cards[myspot - 1].ability.perma_mult = G.play.cards[myspot - 1].ability.perma_mult or 0
G.play.cards[myspot - 1].ability.perma_mult = G.play.cards[myspot - 1].ability.perma_mult +
card.ability.mult
end
else
myspot = -1
end
if myspot ~= -1 then
return {
extra = { message = localize('k_upgrade_ex'), colour = G.C.CHIPS },
card = card
}
end
end
end
should give cards adjacent to scored 4s +2 perma mult
the adjacent to scored 4s part worked fine
oh wait I see what I did
no I didn't
i read it wrong
no i don't manually add the extra mult label
the joker has localization that functions
then i have no idea, might be an smods bug? or maybe another mod
maybe another mod is clashing with it then yeah
hello?
I still need help with that, does anyone have an idea on how to fix it?
not sure what mod that would be
it would be a mod that implements perma mult on its own
if you have cryptid my guess is always that
i don't use cryptid
If you show how the crash happens, and your code, I might be able to spot something
my best guess is DX tarots just cause that mod is old
(i am using yahimod but that doesnt do anything)
key = "SpiderSushiMod",
path = "SpiderSushiMod.png",
px = 71,
py = 95
}
SMODS.Joker {
key = "top_hat",
atlas = 'SpiderSushiMod',
pos = { x = 0, y = 0 },
config = { extra = { chips = 15, mult = 10 } },
rarity = 2,
discovered = true,
cost = 5,
blueprint_compat = true,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.chips, card.ability.extra.mult }}
end,
calculate = function(self, card, context)
if context.joker_main then
return {
chips = card.ability.extra.chips,
mult = card.ability.extra.mult
}
end
end
}
not that one
Hey, someone can help me made a custom deck? I never made a mod before
did you cheked vanilla remade
gonna see if i can manually remove the secondary value for ++2 mult
I know that has some tutorials over there, but de 7-zip dont allow me Replace files
No 😅
And Sorry my english, im still learning
That vanilla has option to change de card deck skin?
this is a stemmodded mod to show how vanilla elements would be created if you were a modder
so theres how to create blue deck, yellow deck etc
hellooo?
btw i am new in modding too. i've been copy pasteing code from vanilla remade to understand moding
Oh, thanks for help then 🙂
I'll take a look in a sec. Still at work
k
BETMMA SPELLS
well that just removed a + from each number
that's technically closer
there are no other mentions of perma mult in my entire mods folder except a morefluff joker that uses it and the smods implementation of it
this perma mult is pissing me off
i am the original starwalker
do i have to change this description to mention that the hand is redrawn or the concept of "redraw if no cards, lose if no cards in deck" is known well enough?
the card's data has nothing wrong with it so I'm pretty sure this is just another mod causing it
ok so i started a new run and got the joker but it still doesnt show the text and also i want to be able to continue a run
The issue isn't that continuing a run is broken. The issue is that if you change things in your code, the loaded in objects don't change with it, which means that the game will run code that might no longer work.
Also, if the text isn't loading, you'll have still not set up your localization properly
What does that file look like now?
return {
descriptions = {
Joker = {
j_ssm_top_hat = {
name = "Top Hat",
text = {
"Gives {C:chips}+#1#{} Chips and",
"{C:mult}+#2#{} Mult when scored"
}
}
}
}
}
and you're sure your mod prefix is ssm?
en-us.lua
Yup
ok so this is the third time that im saying this:
i am stupid
nah that one is understandable
thank you
It's all stuff that happens even when you're more experienced, haha
it works
thats programming for ya
The main thing is learning to read crash reports in a way that'll make you say 'oh, this is probably me being stupid' rather than 'oh, this is a difficult problem I'm gonna have to solve'
i am responsible for three Rofflatro crashes and all of them have been syntax errors
does anyone know why my mod could possibly be preventing playing cards from self destructing, but just makes them not score anymore?
i literally have no idea why they don't, i dont hook anything relating to self destruction or card removal
SMODS.add_card{key = "j_my_master_hunter"}
card:start_dissolve() yo i am using this to technicaly turn my joker into another joker. any idea or resource how can i make it directly transform. or if jokers have turn back thing like when aplying ranked cards enchantment. can i make it turn back and transform it to another joker ?
card:set_ability(key)
you might have to do some extra stuff in order to make it turn back
how this works. will i put jokers id i want it to transform in the key ?
i guess cryptid got something like this
i have a joker that transforms into other jokers each round but the implementation is complicated haha
great,, its not my calculate_individual_effect hook
that makes this more complicated
i would not be skilful enough to implement it
does add_card function support spawning with edition ?
at least i could make it like its same joker this way
yes edition = "e_key"
but i would recommend using set_ability to "transform" jokers
that keeps everything
soo how do i use set ability in joker
like this
i am going to lose it why is none of the code that raises the most suspicious responsible for this
thank you guys.
Could you post the code?
the most helpful i can be is by posting the entire github (which is here); i have no idea what causes this (it's been in for a while, but i never realized it was my mod since i tend to not update mods for a while)
all i'm doing right now is disabling non-essential code and seeing if it changes anything
it didnt work. i think i did something wrong . calculate = function (self,card,context)
if context.end_of_round and context.game_over == false and context.main_eval and G.GAME.last_blind.boss and G.GAME.last_blind and not context.blueprint then
card.ability.extra.invis_rounds = card.ability.extra.invis_rounds + 1
if (card.ability.extra.invis_rounds == card.ability.extra.total_rounds) then
--SMODS.add_card{key = "j_my_master_hunter"}
--card:start_dissolve()
card:set_ability("j_my_master_hunter")
end
return {
message = (card.ability.extra.invis_rounds < card.ability.extra.total_rounds) and
(card.ability.extra.invis_rounds .. '/' .. card.ability.extra.total_rounds) or
localize('k_active_ex'),
colour = G.C.FILTER
}
end
if context.joker_main then
return {
chip_mod = card.ability.extra.chips,
message = localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } }
}
end
--
end
it didnot turned into the other joker
P a i n
yep
is "my" your mods prefix?
i really wish i could just ignore this but it's so annoying
yes it is
could it be because j_my_master_hunter 's in_pool is false ?
please use codeblocks btw
how to do it
Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to d...
searched it but couldnt find
oh thanks
```lua
your text here
```
actually that article has broken pngs wtf lmao
oh only if you disable cookies. because that makes sense.
at this point i'm just going to cut out entire files from the files to load list until i find the issue
the code
that got the job done quick,.,,,
narrowed down to 2 files
Anyone has any examples on how to do badge implementation with Malverk? I used SMODS' take_ownership to add badges to vanilla jokers, but it seems to create a conflict with Malverk (the game closes with no error messages after clicking the Texture menu button).
I saw Malverk has support for badges, but while the syntax is similar to how it's used in SMODS.Joker, I dunno how to specify which Joker I want to add the badge to.
From what I understand, you add this block to your AltTexture:
key = {
name = 'new name',
text = {'new desc text 1', 'new desc text 2'},
badge = 'badge_string'
}
}```
Then change `badge_string` to whatever you want and use it here, with the colors and text you want to show:
```Malverk.badges.badge_string = function(self, card, badges)
badges[#badges + 1] = create_badge(badge_label, get_type_colour(self or card.config, card), nil, 1.2)
end```
But I'm not sure *where* to add the ``Malverk.badges.badge_string` function. Should it be outside of the AltTexture? Do you need to add one for each Joker I want to change? Or just one for each badge type? Do I also need one new AltTexture for each Joker/badge type?
how do you apply gold seal to a playing card
how do i properly add the cards to the deck? rn im doing
for i, v in ipairs(G.deck.cards) do
v:start_dissolve()
end
for i, v in ipairs(G.hand.cards) do
v:start_dissolve()
end
local card_1 = SMODS.create_card { set = "Base", edition="e_polychrome", enhancement = "m_steel", seal = "Red", front = "S_J", area = G.discard }
local card_2 = SMODS.create_card { set = "Base", edition="e_polychrome", enhancement = "m_steel", seal = "Red", front = "S_J", area = G.discard }
G.E_MANAGER:add_event(Event({
func = function()
G.hand:emplace(card_1)
card_1:start_materialize()
G.GAME.blind:debuff_card(card_1)
G.hand:emplace(card_2)
card_2:start_materialize()
G.GAME.blind:debuff_card(card_2)
G.hand:sort()
return true
end
}))
which is inside a consumable with a custom type
if context.before and context.cardarea == G.play and context.main_eval then
local talisman_cards = 0
for _, playing_card in ipairs(context.scoring_hand) do
if not playing_card.seal or playing_card.seal ~= 'Gold' then
playing_card:set_seal('s_gold', true)
talisman_cards = talisman_cards + 1
how do you apply gold seal to played cards?
full joker
the gold seal key is just "Gold"
replace create_card for add_card and change G.discard for G.deck or G.hand
and remove the :emplace lines
any idea why that didnt work
it says active when i beat the boss
normally does it just before deleting iteslf and adding other joker
this time it just stays active
and nothing happens
did the commented code work before?
no idea then
what's your smods version
interesting
oh yeah, what about this?
loc_vars = function(self, info_queue, card)
info_queue[#info_queue + 1] = { key = 'Gold'}
return { vars = { card.ability.extra.xchips, card.ability.extra.xchips_mod } }
i might be missing something because reading code on discord mobile is a pain
So I've created a Joker that says "Stone cards have their own rank" (meaning you can do 5oak with stone for example). For it to work, I created a new rank, and I applied a lovely patch to Card:get_id() saying if I have the joker and the card is stone, return the new rank.
Now, I don't want any card in the game to have that rank (like, cards from booster packs/magic trick or from cards that randomize ranks). The rank exists just for this Joker. How would I prevent this rank from generating in any way? Or is there a better way to code this joker maybe?
I thought i'd never need to ask again here, but what I'm doing is so complicated i just don't understand.
- How do I add a new tab to the game info screen that works a bit like the voucher menu, just for single card sprites (not jokers, not playing cards but custom cards)
- How do I store data in the run save?
- What is the discard equivalent of
ease_hands_played(1)?
I remember something like weight = 0 maybe. I used this to prevent an enhancement from spawning in shop and in a pack?
like that?
hopefully :)
try spawning in many mega standard packs with db+
when i returned to commented part , it didnt work somehow. so i changed the condition above >= from ==. now commented works again. but card: function gives error about comparing two nill values
try checking smods docs
i did
time to git reset --hard. to working version
can you even retrigger gold seal cards?
oooh the error is not about transforming the joker now. i think because it transforms. i get a nill comparing error because this line message = (card.ability.extra.invis_rounds < card.ability.extra.total_rounds) and
yaaay it works when i dont try to execute a code about local variables when theres no such card to hold variables. thanks @red flower
Could anyone help me figure out how to have a list of jokers be debuffed in the collection?
still doesn't work
collection? did you mean run
bump :)
what are you trying?
I mean in the collection
applying gold seal on played hand
you cant debuff jokers in the collection. what are you trying to do?
I'm trying to have this be persistent
give me a minute
oooh. hm. ig hook the opening/tabchange function for the collection, and repeat with every joker in it if its a specific one and set card.debuffed = true? thats a long stretch btw
I've been trying to find those tbh
but I haven't been able to find where I can hook into them
or where they are for that matter
You have to use the in_pool() function to prevent it from generating
The description says
"Sisyphus Prime - Applies Talisman to played cards in hand, Gains x2 Chips per scored Talisman card, Retriggers Talisman cards, stockpiles xchips and unleashes it at the end of hand."
card:set_seal('Gold')
What is talisman?
an enhancement?
or the rank you are saying?
i meant to say gold seal
but i just wrote it as talisman
the spectral card used to apply a gold seal
this is to make them gold seal
and
so your description is:
Applies Gold Seal to Played Hand.
Gains X2 Chips per Scored Card with Gold Seal and retriggers them.
XChips Reset each Hand
hm
stockpiles xchips, unleaashes them in played hand and resets them.
my main concern is just gold seal
it does gain permanent xchips on played gold seals
thats generally accepted just without "Unleashes them in played hand" and "stockpiles xchips"
ooooh. explain furtgher
i think i understood incorrectly
xchips get stockpiled per hand, so each card gives xchips like x2, x4, x8, x16, x32
what
if permanent xchips x4, then it would be x4, x8, ...
wait
is that right?
yeah
xchips > x 2 > x 2 > x 2 > ...
are you meaning that the joker gains x2 chips every time a gold seal scores?
it stores all your xchips and passes it on to the next card, doubling the xchips
yes
and does it reset after the hand was played?
yes
i'm supposed to be making an interest based joker
maybe i can do it better.
instead of retriggering gold seal cards
card.ability.extra.xchips = card.ability.extra.xchips * 2 every time a gold seal scores
card.ability.extra.xchips = 1 after scoring finished
um
xchips isn't the issue
the issue is not being able to apply gold seals
i'll just find a better method
instead of applying gold seals
it instead applies gold enhancement on played cards
and gains money from them
Another bump
:set_seal('Gold')
no change
seriously, where are these/what are they called
I can't find them
are you calling copy_card anywhere
other than this hook? yes
in one of my jokers
show me the call
cartomancer appears to be the culprit - deck opens just fine with only it off
calls
SMODS.Joker {
key = "top_hat",
atlas = 'SpiderSushiMod',
pos = { x = 0, y = 0 },
config = { extra = { chips = 15, mult = 10 } },
rarity = 3,
discovered = true,
cost = 7,
blueprint_compat = true,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.chips, card.ability.extra.mult }}
end,
calculate = function(self, card, context)
if context.joker_main then
return {
chips = card.ability.extra.chips,
mult = card.ability.extra.mult
}
end
end
}
how do i make it so top_hat activates every time a jack is used
well, honestly I can't tell in this code, but according to the crash log copy_card is being called with the string "294" as the first parameter
or in the latest one it was "399"
apparently this is known and is fixed in the latest dev build of cartomancer but not release
if context.individual and context.cardarea == G.play and context.other_card:get_id() == 11 then
individual is when a card scores
cardarea == G.play means "cards in the played hand", you can also use G.hand for cards held in hand
other_card is the card being scored in individual and 11 is the id of Jacks iirc
Hello !
I'm trying to make my joker trigger to debuffed cards but won't do anything, and i the card removal effect will only trigger once even if there's two cards removed, help to fix this would be appreciated thanks !
thx
then either disable that mod or get the dev build
it's not an issue with your mod, your hook looks fine to me
Hey y'all I'm wanting to get into Modding Balatro. Any good place to start or learn how too?
Check mods you like, the closer to vanilla the better for starters, check the smods wiki as well of Vanilla Remade, great resource that remake the vanilla jokers but in the modding context, this will help you a lot
use latest commit of Cartomancer, not release
download via green Code button
bump - so far, i've figured out:
- moving the stuff in the return table's func to before it and removing the func made the stuff in the func work, but not the message. so it doesn't like this specific return
- i wondered if it was a syntax or specific issue with the way i was forming this message, so i tried an
eval SMODS.calculate_effect()with this message and it worked just fine - i tried doing
return { message = 'Test' }outside of any context at the end of the calculate and that worked as expected - i wondered if it was an issue with changing a joker into another joker via set_ability but it persisted
for some reason, it doesn't seem to like this specific return table in this specific circumstance? it just behaves as shown. it doesn't even crash, it does nothing. as if i never specified a return table
Bump
my discord dosent scroll to your message but try putting a print before the return
priht(return ...)?
🤷 , Put it in G.GAME, ease_discard(1)
no just a print to see if the calculate trigger
unfortunate, makes sense, tysm!
How do you apply gold “enhancement” to played cards?
card:set_ability("m_gold")
what are those files people use that move your mod info into a seperate file?
moving this into another file e.g
When its needed, is the joker key j_prefix_joker or prefix_j_joker
Ok so it’s kind of hard to create Sisyphus Prime’s ability.
Atleast for me
What other proposed abilities should I give him?
first one
Thank you!
thanks!
Thank you too!
@daring fern you're still working on seals on every?
you draw?
is there a way to do this:
{X:attention,C:white}Top Hat{}
without removing the space between top and hat(this is in the en-us localization file)
is my "if boss blind is defeated" condition correct?
if context.end_of_round and context.cardarea == G.jokers and not context.blueprint and G.GAME.blind.boss and G.GAME.blind:get_type() == 'Boss' and G.GAME.blind:cleared() then
No just uses free art as joker assets
No.
what do i do?
It's hard one
if context.end_of_round and context.main_eval and not context.blueprint and G.GAME.blind.boss
I can make simple but it's harder
i mean you can learn
does your game die when you have no hand size or when you cant draw any cards? so even if u have 0 hand size but you have a joker to draw cards will you live?
Ok I try
Yes. No.
damn ill need to hook :(
ik but how do i do the {B:} in the en-us file thing
theres something you need to put in your joker's loc_vars
no like where and how do i put in the loc_vars
if context.end_of_round and context.main_eval and not context.blueprint and G.GAME.blind.boss then
card.ability.extra.xchips = card.ability.extra.xchips * 20
card.ability.extra.interest = card.ability.extra.interest * 20
card:juice_up(0.5, 0.5)
play_sound('holo1', 1, 0.5)
return {
message = "Yes, that's it!",
sound = "sisyphus_yesthatsit",
colour = G.C.GOLD
}
doesn't work.
doesn't work on trigger
in your jokers?
in here:
return {
descriptions = {
Joker = {
j_ssm_top_hat = {
name = "Top Hat",
text = {
"Played {C:attention}Jacks{}",
"give {C:chips}+#1#{} Chips and",
"{C:mult}+#2#{} Mult when scored"
}
},
j_ssm_bottom_hat = {
name = "Bottom Hat",
text = {
"Gives {C:chips}+#1#{} Chips",
"and {C:mult}+#2#{} Mult",
"if adjacent to {X:attention,C:white}Top Hat{} Joker",
}
}
}
}
}
this does not trigger after defeating a boss blind.
help
Can you make a joker to show different text when buy it and different text when you see it in collection
does anyone have a solution for this issue?
i have the same problem
no idea until now
stretched is caused by wrong res methink
its 71x95
if card.area and (card.area.config.type == 'collection' or card.area.config.type == 'shop') then
return {
main_start = {
{ n = G.UIT.T, config = { text = "you shitty clown", colour = G.C.RED, scale = 0.4, shadow = true } }
}
}
end
Would this work
"after boss blind is defeated" trigger doesn't work.
what color(hex) is attention(the orange one)
ff9a00
thx
bump !
the table prints just fine as expected. it just doesn't behave as expected when returned
Played debuffed cards don't score.
ok fuck trying to look for answers at 1AM, i'm going to bed.
No, I mean debuffed cards don't call calculate so it is impossible to do things on them without patching.
you can check if card.area == G.jokers
ah i see, i was thinking since they could play the scoring animation there was a way for my joker to trigger it for those cards especially
Let me try
Will this check wether card in collection or in possession
that checks if it's in possession
calculate = function(self, back, context)
if context.end_of_round and not context.repetition and not context.individual then
if G.GAME.blind.disabled and not G.GAME.blind.skipped then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
local joker_pool = {}
for _, joker in pairs(G.P_CARDS) do
if joker.set == "Joker" and joker.rarity == 1 then
table.insert(joker_pool, joker.key)
end
end
if #joker_pool > 0 then
local joker_key = pseudorandom_element(joker_pool, pseudoseed('welcomebacktosloplive'))
SMODS.add_card({
key = joker_key,
area = G.jokers,
from_card = nil,
discovered = true
})
end
local consumable_types = {'Tarot', 'Planet', 'Spectral'}
local chosen_type = pseudorandom_element(consumable_types, pseudoseed('thanksforsloppingby'))
SMODS.add_card({
set = chosen_type,
area = G.consumeables,
from_card = nil,
discovered = true
})
return true
end
}))
end
end
end
}
this doesnt spawn anything after
defeating a blind
what did i do rong
i dont think blind.skipped is a thing
im still reading
jokers are G.P_CENTERS not G.P_CARDS
right
You know, that looks kinda cool. A lot of numbers, he-he.
So, basically tabs UI and pagination ready, now... API?
you also dont need to do any of that, add_card can spawn a common directly
how
set joker rarity 1?
SMODS.add_card{set = "Joker", rarity = "Common"}
its not a number?
you can do a number but theyre different for add_card
that looks fine
how do i make bottom_hat activate only if its adjacent to top_hat:
SMODS.Joker {
key = "top_hat",
atlas = 'SpiderSushiMod',
pos = { x = 0, y = 0 },
config = { extra = { chips = 15, mult = 10 } },
rarity = 3,
discovered = true,
cost = 7,
blueprint_compat = true,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.chips, card.ability.extra.mult }}
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and context.other_card:get_id() == 11 then
return {
chips = card.ability.extra.chips,
mult = card.ability.extra.mult
}
end
end
}
SMODS.Joker {
key = "bottom_hat",
atlas = 'SpiderSushiMod',
pos = { x = 1, y = 0 },
config = { extra = { chips = 50, mult = 50 } },
rarity = 1,
discovered = true,
cost = 3,
blueprint_compat = true,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.chips, card.ability.extra.mult, colours = { HEX('FF9A00') } } }
end,
calculate = function(self, card, context)
if context.joker_main then
return {
chips = card.ability.extra.chips,
mult = card.ability.extra.mult
}
end
end
}
can you show the return?
do what blueprint does to get the index and then check if index-1 is top hat or index+1 exists and its top hat
its still not spawning anything
do you want it to spawn when the blind is disabled?
well no
i dont know how blueprint does it and i dont really know how to code the mods
well, then add a not in front of that condition lol
fuck
and the message dosent show up?
yes.
it used to be that the entirety of that prior if statement was in a function in the return table and that didn't happen either
so for whatever reason, the game is just not doing anything with this return table
set = "Joker"
i still dont know how to do it and i dont understand the code in the blueprint
damnit
I would recommend reading a bit more on lua then
It's a loop that checks at what index the card is in G.jokers.cards and gets the card at the index+1 (the right card)
wrong chat
modding-dev is civilised, as opposed to modding-chat
ok but isnt there like an if that checks for thing in the joker area
next(SMODS.find_card("j_modprefix_key")) checks if you own it
seems like your localization function may be wrong?
i need to check if there is a specific joker in a specific slot in the joker area
I know, and I already told you how to do it lol
no; i tried an eval SMODS.calculate_effect() with this and it worked just fine
but i dont understand lua or SMODS like i barely understand them
well, I'm sorry
This channel is for modding help, not for someone else coding it for you
hi N
hi dilly!
how are you my friend
im sick again..
wbu
im not asking someone else to code i just want the fucking if statement like thats its i can do the rest
D:
get some soup, water, and rest
im okay, i went to get my rent from the atm yesterday and it ate my money so i had ot call the bank and they claim ill get it back in a few days so im waiting for that
400 bucks missing thank god i didnt try and pull more
otherwise its been hot here and is getting hot this week too
There's no simple if statement for that
wouldn't just putting the next call in an if statement do that, though
oh specific slot
yeah, the for loop is probably the best bet for that, then
just loop through G.jokers.cards until you find your jokerand put the index into a variable. there's your slot number
damn thats crazy
please take care, I've heard heatwaves are very bad this year in most places
are there any video to spritesheet converters, that are good to use? since I really do not want to space out every single frame (73) 1 pixel away 😭
so, how do i make the card trigger for more than one card being removed (hangman for exemple)
i am being safe :D
i got plenty of water and all that
for k, v in pairs(context.removed) do?
i could try that, thanks
since every single one I found, does not work, or does not space them out
maybe you can use ffmpeg to convert it to frames and then use something like this to make the tileset
https://www.finalparsec.com/tools/sprite_sheet_maker
Use this free tool to make a sprite sheet for your Unity game and optimize performance for your 2D game.
I'll do that thanks!
anyone know whats going on with this? my mods made with joker forge and crashes on startup
show the code
which part?
well it seems to be main.lua, so around the line 212 from what i see
also joker forge is still quite a WIp and from what i remember, it's simplified lua, so the way it'll be coded may not work correctly
send the json from the site in the joker forge channel and I will have a look at it
probably a bug with a specific combination of triggers, conditions, and effects
i'm pretty sure something like created spectral doesn't even exist, more like add consumable spectral
unless it's a local
if I remember it correctly, it creates a local variable to conditionally show the message based on if it was successful
I will have a little look at it tonight when I'm home
bump:
- moving the stuff in the return table's func to before it and removing the func made the stuff in the func work, but not the message. so it doesn't like this specific return
- i wondered if it was a syntax or specific issue with the way i was forming this message/localize call, so i tried an
eval SMODS.calculate_effect()with this return table and it worked as expected - i tried doing
return { message = 'Test' }outside of any context at the end of the calculate and that worked as expected, so it's specifically this return - i wondered if it was an issue with changing a joker into another joker via set_ability, but it persisted when i tested it by spawning it from collection
- there's no issues with printing the return table. that behaves as expected.
- tested this during a blind to the same problem
- testred other return tables and they work as expected
here is the current calculate function with the return that is misbehaving highlighted:
one thing i would recommand is to put the jokers in a separate lua file, sure keeping all in the same lua file works but it'll be easier if you have separate files and everything
though again i suppose it's Joker FOrger way to work
Also, do you know a lil about manual joker codding ?
I eventually wanna split it up into separate files properly when I add things like consumables and stuff to jokerforge
and I want to add export options so if you would prefer each joker be it's own lua file in a joker folder, you can do that
that sorta thing
cos I've seen a couple mods do that too
yeah, cuz one big file seems hell to navigate trough, even the id being a large number sure does avoid conflic but wow
this code for some reason keeps giving me "attempt to compare table with number" errors, even when inserting to_big()
yeah i think i did said 'bout this, singular joker exports and can help a lot
thankfully there's already ways to export individual joker files (added I last night), but you are right, export options would be great
Put to_number(to_big()) around G.GAME.dollars
If your goal is to either set dollars to 0 or double the current amount then you're doing it wrong btw
Yeah I just realized that rn
Why does that exist and why does that make my joker work
Because G.GAME.dollars is a table because of Talisman and to_number() turns it back into a number.
Damn
narrowed it down further:
the game is outright refusing to do anything with a return table during context.remove_playing_cards
which is weird because that means @red flower s one here (on which this is based) should not work? https://github.com/nh6574/VanillaRemade/blob/main/src/jokers.lua#L4706
how do i set Jokers edition with add_card?
JokerDeception
put the created joker into a variable, do :set_edition() on that
edition = "e_modprefix_key"
Do I need to restart the game every time I update the code or is there any quicker way
Diavolo be like
oh, inside add_card
different approaches
Yes.
thanks
yeah, that should work in the add_card table
so if it's vanilla, it's e_negative
Yes.
yes
tyty
works fine for me
Alright, now I'm wondering why Talisman turns a major game variable into a table and how that doesn't create major compatibility issues for mods that aren't made for Talisman in mind
Restart. You can press alt+f5 for it to instantly restart
how that doesn't create major compatibility issues for mods that aren't made for Talisman in mind
🙂
is there a way to change card enhancement with a function
card:set_ability("m_modprefix_key")
the reason why is to allow the numbers to bypass the lua number limit
for a spritesheet you only need 1 pixel distance between 2 sprites right?
No, there should be no distance.
oh okay!
thanks
Mods, get him
<@&1133519078540185692>
what's the key for steel card bro
m_steel
🔫
That was also the best I could figure out.... still no idea how Non-talisman mods and Talisman mods work together if they expect different things from G.GAME.dollars
thanks gothic
They just don't. It crashes
Unless the non-talisman-requiring mod adds compatibility for talisman
most devs are aware of Talisman so they add compatibility themselves
why the hell does my animated joker move to the left by one pixel every frame 😭
lmao
I mean the animation itself not the joker lmao
this should coverts cards into hearts polychrome steel kings right?
spritesheet is wrong maybe?
or the defined size in the atlas
if card is a valid playing card, yes
They just don't. It crashes
most devs are aware of Talisman so they add compatibility themselves
Those were my best guesses, mostly I was hoping there was a different answer but.... well good to know ^^
we are also hoping there's a different answer someday lol
Hehe, hopefully ^^
Is there any way to make a card show different text during collection and when you buy it
when there's a general compatible version of talisman, probably never
yes, return a different key in loc_vars
oh yeah set_seal should do the last trick
i dont even know if there's anyone actively working on talisman rn
anyway edgy
x9.99e256 what
Something odd: When I add a third joker, it always becomes foil?
Game.main_menu = function(change_context)
local ret = mainmenuref2(change_context)
local newcard = SMODS.create_card({key='j_hanging_chad',area = G.title_top})
G.title_top.T.w = G.title_top.T.w * 1.7675
G.title_top.T.x = G.title_top.T.x - 0.8
G.title_top:emplace(newcard)
newcard:start_materialize()
newcard.T.w = newcard.T.w * 1.1 * 1.2
newcard.T.h = newcard.T.h * 1.1 * 1.2
newcard.no_ui = true
local newcard = SMODS.create_card({key='j_brainstorm',area = G.title_top})
G.title_top.T.w = G.title_top.T.w * 1.7675
G.title_top.T.x = G.title_top.T.x - 0.8
G.title_top:emplace(newcard)
newcard:start_materialize()
newcard.T.w = newcard.T.w * 1.1 * 1.2
newcard.T.h = newcard.T.h * 1.1 * 1.2
newcard.no_ui = true
return ret
end```
No idea why it would
yeah
Create card will be auto rolling an edition and because the game hasn’t set a seed it always uses the same default one
So I found out why, my dumbass forgot to update the x2 image 😭
So I'd have to set the edition manually somehow, right?
No, you just use Card()
is there a way for a deck or a stake to set certain boss blinds for ante? Like if i wanna do ante 1 you play this blind
wrong area, oops

Would that be just under the SMODS line?
Sorry, I'm very new to this
No, it would be something like```lua
local newcard = Card(G.title_top.T.x, G.title_top.T.y, G.CARD_W, G.CARD_H, G.P_CARDS.empty, G.P_CENTERS.j_modprefix_key, { bypass_discovery_center = true })
Would it be possible to somehow remove all decks except for one an every challenge from the game? (it's for a joke mod for my friend)
Talisman support is unfortunately a case of "Talisman got in early so now everyone must subscribe to it"
Oh so I'd add Card( before G.title_top.T.w and add the ) after newcard.no.ui = true?
No, you would replace local newcard = SMODS.create_card(...) with what I sent.
bump just wanna know if possible if anyone has tried
Yes.
Oh, so no SMODS necessary then
Does anyone have an answer for that?
whats the code? if so how did you make a blind a specific boss?
It would probably require patching.
how would i make a joker do something every 0.25 seconds?
check out how entropy spawns the 'endless entropy' boss blind
that's at least one im aware of that has an override condition
omg thx that will def help
use update and check either G.real_dt or G.TIMERS.REAL
Could someone help me find where i can hook into the collection rendering to debuff some jokers?
Sooo I have this problem that tthe game crashes when I try to give a joker with a tarot card, but a specific pool only (and yes the pool is the same) Does anyone have a solution for this?
key = 'givehdjoker',
set = 'Tarot',
object_type = 'Consumable',
name = 'finushd',
loc_txt = {
name = 'FinusHD',
text={
'Erstellt einen rndm',
'{C:attention}Finushd Joker{}',
'{C:inactive}(braucht Raum){}',
},
},
pos = {x=0, y= 0},
order = 99,
atlas = 'consumatlashd',
unlocked = true,
cost = 4,
use = function(self, card, area, copier)
local card = create_card('HDJoker', G.Jokers, nil, nil, nil, nil, nil, 'finushd')
card:add_to_deck()
G.jokers:emplace(card)
end,
can_use = function(self, card)
if #G.jokers.cards < G.jokers.config.card_limit then
return true
end
end,
}```
like, show them as debuffed in the collection?
I would look into how the Banner mod does it
oh thats exactly what i need, thanks
what's the crash
can i see the objecttype
I've been curious about custom main menu cards, but one thing I notice is, using the same code as above with Perkeo, jokers with floating sprites appear to be off-centered
so many discussions about main menu cards
i want my main menu to have 70
make de mods
Hehe, well it's mostly the previous discussion about main menu cards that made me look this up ^^
As far as I can see in the search bar though, it doesn't seem to happen that often ^^
do you mean the pool?
yes
pools = {['HDJoker'] = true}, I have this for every joker I made
thats not enough, you need to make an SMODS.ObjectType
wdym?
you need to make an objecttype for that pool to be registered
oooh okay how do I do that?
i dont have an example rn https://github.com/Steamodded/smods/wiki/SMODS.ObjectType
...didn't you point to mine as example once?
thanks for the help!
this should dip below 0 at some point
currently oscillates between 17 and 3
making it go from like +20 to -5 would be funny
i think this is enough money for that
a couple of times but i always github search it and i dont want to do that on my phone :3
-# Phone, yeah, valid.
lmaoo
N go to sleep you're sick
im working
i did, im working from home but im not sick enough to not work..
is there ANY possible way to make a card edition add or minus a value
(eg: add +5 mult when discarded or something)
You can't give mult outside of scoring.
iom saying like
the card gains mult
and when its played it gives all its mult
Then yes.
is there a way to print functions that are called?
Yes.
how would one do that?
print(function())
where should i put that to print EVERY function that is called?
Then no.
Is there a way to prevent playing card to to spawn with a custom enhancement in the shop or in packs ?
Yes.
what is it
in_pool = function(self) return false end
kk thx
would u happen to know what function kills you if you cant draw any cards?
Game:update_selecting_hand()
Hi. A friend of mine is testing my mod and for some reason they get like 0-1 fps (according to db+) and he got this crash when opening his mods folder. could someone help please? (I honestly dont think this happened because he opened the folder but i still dont get the problem)
Oops! The game crashed:
[SMODS _ "src/game_object.lua"]:3462: attempt to index local 'start_colour' (a nil value)
Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-0614a-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows
Steamodded Mods:
1: Fates Mod by ItsGraphax [ID: fates, Version: 1.0.5]
2: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.4.2, Uses Lovely]
Lovely Mods:
Stack Traceback
===============
(3) LÖVE metamethod at file 'boot.lua:352'
Local variables:
errhand = Lua function '(LÖVE Function)' (defined at line 575 of chunk [lovely debugplus.console "debugplus/console.lua"])
handler = Lua function '(LÖVE Function)' (defined at line 575 of chunk [lovely debugplus.console "debugplus/console.lua"])
(4) Lua method 'update' at Steamodded file 'src/game_object.lua:3462'
Local variables:
self = table: 0x1c785710 {1:0.92904714116297, 2:0.409622191288, 3:0.35617639871202, 4:1, prefix_config:table: 0x1c799828, original_key:warning_bg, registered:true, colours:table: 0x1c2ce9e0 (more...)}
dt = number: 0
timer = number: 0
start_index = number: 0
end_index = number: 1
start_colour = nil
end_colour = table: 0x1c13af88 {1:0.99607843137255, 2:0.37254901960784, 3:0.33333333333333, 4:1}
partial_timer = number: 0
(for index) = number: 1
(for limit) = number: 4
(for step) = number: 1
i = number: 1
(*temporary) = C function: next
(*temporary) = table: 0x1c494ca0 {1:table: 0x1c494e18, 2:table: 0x1c62e4c8, 3:table: 0x1c45bfe0, 4:table: 0x1c45c758}
(*temporary) = number: nan
(*temporary) = number: 1
(*temporary) = string: "attempt to index local 'start_colour' (a nil value)"
tell me if you would need an extended version ^_^
Code?
thats the fun part. there is probably no error on the mod's side since the crash happens in smods, but it is in my game:update hook so here is the update hook:
local game_update_ref = Game.update
function Game:update(dt)
-- pre hook
local ret = game_update_ref(self, dt)
-- post hook
-- update websocket client
client:update()
-- wait for poll screen
if self.STATE == self.STATES.FATES_WAIT_FOR_POLL then
self:update_wait_for_poll(dt)
end
-- game timer
local countdown = math.floor(60 - (G.TIMERS.REAL - FATES.TimerStamps.COUNTDOWN))
if countdown > 0 then
FATES.Timers.COUNTDOWN = countdown
else
FATES.Timers.COUNTDOWN = 0
end
-- return hook
return ret
end
If the crash comes from SMODS, most of the time it is not an SMODS problem.
bump:
- moving the stuff in the return table's func to before it and removing the func made the stuff in the func work, but not the message. so it doesn't like this specific return
- i wondered if it was a syntax or specific issue with the way i was forming this message/localize call, so i tried an
eval SMODS.calculate_effect()with this return table and it worked as expected - i tried doing
return { message = 'Test' }outside of any context at the end of the calculate and that worked as expected - i wondered if it was an issue with changing a joker into another joker via set_ability, but it persisted when i tested it by spawning it from collection
- there's no issues with printing the return table, behaves as expected.
- tested this during a blind to the same problem
- tested other return tables in other contexts and they work as expected
- tested trying to return any kind of valid joker return table during
context.remove_playing_cards, game seems to just not want to do anything with tables returned during this context. seems to be a problem unique to me?
here is the current calculate function with the return that is misbehaving highlighted:
how do i fix my return table not working as expected? the problem is that nothing is happening. it's as if i'm not returning anything
idk if i remember correctly but dosent localize to put it in brackets
it's a table call
you can do either localize{} or localize({})
the former just does the latter
oh bruh
well what does it show then
add an or "BROKEN" to see if the returned value is nil
how do i use a vanilla shader as the shader in my edition
i.e. i want my edition "really negative" to use the negative shader from vanilla
no change
Does shader = "negative" not work?
oh wait i forgot to make it a string 😭
nah doesn't work
i get a crash telling me it attempted to index a number value
its not a number, its no value
desperate bump. been trying for hours
then how can i make it work, if at all?
What does the update_wait_for_poll function look like?
its a custom screen
G.STATE
I've made like a new G.STATE Screen
between cash out and shop
getting the ui to work correctly wasnt the big problem. it was finding out how to add a g.state since no one has ever done that
i actually wanted to keep the mod a surprise
but oh well
well it looks incredible
and i have alot of trouble with ui but i think this is the motivation i need to finally learn it
making a new screen is hell
even just this for me is not working as it should
i will never understand why thunk didnt make a html/css like system
are you destroying playing cards?
...how do you think i'm running into the problem...?
like maybe?
try removing the context check at all and see if the message shows on any other occasion
yes. it does. i established this.
What version of steamodded are you using
smods-1.0.0-beta-0614a
is this something that's been fixed in dev since?
I don't know
sry tldr. it may be that destroy_cards dosent accept message as return
no, because someone else with the same setup confirmed to me earlier that theirs works #💻・modding-dev message
SMODS.Joker {
key = 'testw',
loc_txt = {
name = "w",
text = {}
},
calculate = function(self, card, context)
if context.remove_playing_cards then
return { message = "Test! " }
end
end
}
This works perfectly fine, I'm on a dev build of smods tho
i'll take a look
i did also try with minimum enabled mods, but i'll try agian
how can i check what rarity pool a joker is in
actually can i just
view an entire rarity pool with debugplus
how can i do that
how can i do something AFTER all joker effects have triggered? e.g.
i have a joker that draws a card to hand at the start of the round, and i have implemented a change that stops hand size =0 from killing you. instead i want all joker effects to trigger THEN itll check for how many cards are drawn, then if its 0 will kill you
eval G.jokers.cards[index].config.center.rarity
what did i do wrong ?
loc_vars = function(self, info_queue, card)
return { vars = { G.jokers and math.max(3, (G.jokers.config.card_limit + #G.jokers.cards) + #SMODS.find_card("j_awak_li", true)) or 1 } }
end,
calculate = function(self, card, context)
if context.joker_main then
return {
xmult = math.max(3,
(G.jokers.config.card_limit + #G.jokers.cards) + #SMODS.find_card("j_awak_li", true))
}
end
end
}```
How can I change the color of a part in the description of a joker like a part change from {C:green} to {C:blue} if a joker is present.
Show the full joker code.
You can return key in loc_vars to redirect the description and name to a different localization entry.
SMODS.Joker {
key = "li",
loc_txt = {
name = "{C:dark_edition}The Abrupt One",
text = {
"{X:mult,C:White}X2{} Mult",
"for every filled joker slot",
"{C:inactive}This joker inculded",
}
},
atlas = "li",
soul_pos = {x = 0, y = 1},
rarity = "awak_li",
pos = { x = 0, y = 0},
cost = 50,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
loc_vars = function(self, info_queue, card)
return { vars = { G.jokers and math.max(3, (G.jokers.config.card_limit + #G.jokers.cards) + #SMODS.find_card("j_awak_li", true)) or 1 } }
end,
calculate = function(self, card, context)
if context.joker_main then
return {
xmult = math.max(3,
(G.jokers.config.card_limit + #G.jokers.cards) + #SMODS.find_card("j_awak_li", true))
}
end
end
}```
oh yeah i didntt think about this
Do you have a rarity with the key li?
i forgot, i havze custom rairities for everuy joker and forgot to put his rarity x)
wow
im writing at night don't worry
okay these are supposed to be removing each joker it lands on out of their own rarity pool and into the common rarity pool, why isn't it working?
the rarities visually update, but they dont move pools

Just in case anyone runs into the same issue as me, I figured out what was causing it. Apparently using take_ownership on the base joker causes Malverk to close the game if I press the Texture button in the options menu. I assume it's because the base joker texture is used on the GUI screen. Using take_ownership on any other jokers works without issue. Not 100% sure if I'm missing something, but reported it to the creator regardless. Hopefully this helps other people!
Try using SMODS.remove_pool and SMODS.insert_pool
how would i implement SMODS.insert_pool here? SMODS.remove_pool seems self explanatory, i can just use that instead of table.remove, but i dont know what to do with the current G.P_JOKER_RARITY_POOLS[1][card.ability.extra.current] = center part, simply replacing it doesnt seem to be correct
SMODS.insert_pool(G.P_JOKER_RARITY_POOLS[1], center, true)?
Do you have Talisman installed?
...
i don't wanna bother with dependencies tonoght, sorry for the bother tho,
ima check on itlater
i dont believe so
You should probably set card.ability.extra.current then set center
what do you mean
current dev build of steamodded and minimum mods enabled make no change - the game still does nothing with the return table
what is minimum mods enabled
just the one mod with the joker and debug plus i imagine
debug plus, my mod and malverk.
What else does your mod have
i dont understand 
Reverse the order of the lines in the image.
PLEASE IM SUCKING SM AT THIS I CANT FIND A SOLUTION 😭
alright it seems to be better now but it still crashes after a few rerolls
would the opposite of card.ability.extra.chip_gain
be card.ability.extra.chip_loss
in terms of what, exactly 
i do hook SMODS.calculate_context but only to add a specific thing during context.end_of_round
i also have a bunch of other hooks like draw_from_play_to_hand
but nothing that should specifically disrupt context.remove_playing_cards, especially in a way that only specifically prevents return tables from doing anything.
i have patches, but again, nothing that should be touching this specifically
Perhaps.
well, it works for everyone but you, and the one thing you have that we don't is your mod
try it without your mod
After scoring or after any joker effects?
after all my jokers triggers
since there isnt any scoring in this context
i hate rarity manipulation so much holy shit
absolutely impossible to work with
this is the code at the moment
i actually expected my mod to be the culprit.
...it in fact, isn't.
hey, where is the function stored that gets called once you lose / you end the game
...i'm even more confused that this works
why does context.remove_playing_cards care about the source of the destruction
you where deleting the card via db+?
end_round
state_events.lua
yeah
oh lol
More like why would debugplus bother calculating the context when it's not meant to be a gameplay mod
It's meant for debugging purposes
i guess i'll raise it in the debugplus thread since this is just weird
i need help again, my joker is supposed to act like an inverted Stencil, X50 mult for each filled joker slot, it works fine with numbers under ten but with nulber bigger than ten it just acts like a simple X<10
this joker excluded too*
ima go to sleep i haven't checked the time, drop your help if you want i'll read them tomorrow
okay I see, this does nothing because eval_card doesn't actually use the return value
I didn't expect debugplus to actually try and trigger that context
the math is completely wrong, you want just
xmult = 50 * #G.jokers.cards
if you care specifically about slots being filled, and not cards that are overflowing for some reason then
xmult = 50 * math.min(G.jokers.config.card_limit, #G.jokers.cards)
you dont need to count the joker itself since it should be in the joker slots already lol
What's the difference between ipairs() and pairs()?
ipairs will loop thru consecutive integer indexes starting from 1
pairs will loop through all the keys
pairs is also not guaranteed to be in order
i'm not sure i get how that's different. could you elaborate? /genq
also, please @ me if responding :)
Had to look it up but /genq apparently means genuine question
you can use pairs with any kind of list but it's not necessarily ordered, so you want to use ipairs if you have an array from 1..n to guarantee order (it also has the application where you can use ipairs to go through a table from 1..n while ignoring the other named keys)
i say list because im very python brained i mean table
how can i make it so if i have a specific joker, all jokers sell value becomes 0.
if you're familiar with the concepts, ipairs treats the table as an array, pairs treats it as a dictionary
i see. that makes sense to me. i appreciate it 
is there a best practice for using one over the other when looping through your hand or jokers or whatever for balatro related purposes?
local oldsetcost = Card.set_cost
function Card:set_cost()
local g = oldsetcost(self)
if self.ability.set == "Joker" and next(SMODS.find_card("j_modprefix_key")) then self.sell_cost = 0 end
return g
end
i understand that. i'm coming from javascript so i'm still getting used to the whole "everything is tables" thing lmao
in javascript everything is objects tho
IMO the best practice is to use ipairs if you know you're dealing with an array
like G.jokers.cards for example
and objects are practically tables
everything was tables the whole time!?
great thanks
yeah, fair point lmao
why tf does it crash w that
G.GAME.chips - G.GAME.blind.chips >= 0
talisman 😱
i believe talisman makes G.GAME.blind.chips into a table
talisman 🫢
you'd wanna run to_number() on it
returns nil
are you doing to_number(G.GAME.blind.chips)?
i forgot the underscore 😭
sry
happens to the best of us lmao
(to_big(G.GAME.chips) - to_big(G.GAME.blind.chips)) >= to_big(0)?
pretty sure you'd still need to run to_number() but don't quote me on that
You could, but you would want to use to_big because it will still allow the numbers to bypass Luas limits I think.
oh yeah, always use to_big when comparing in game numbers if you want or need talisman compat
any ideas why i'm getting an a nil value error when i try to access the ability field on this joker?
SMODS.Joker {
key = "cultContractJ",
atlas = "PLH",
rarity = 3,
pos = { x = 2, y = 0 },
config = { extra = { repetitions = 3, suit = "Hearts" } },
cost = 8,
blueprint_compat = true,
loc_vars = function(self, info_queue, card)
local suit = card.ability.extra.suit or "Hearts"
return {
vars = {
card.ability.extra.repetitions,
localize(suit, 'suits_singular'),
colours = { G.C.SUITS[suit] },
}
}
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and context.other_card.is_suit(card.ability.extra.suit) then
return {
repetitions = card.ability.extra.repetitions
}
end
end,
update = function(self, card, dt)
if G.hand and card.added_to_deck then
for i, v in ipairs(G.hand.cards) do
if not v:is_suit("Hearts") then
v:set_debuff(true)
end
end
end
end
-- todo: add joker display compatibility @chore
}
context.other_card:is_suit
yeah just noticed it too lmao 
does anyone know if cards are actually drawn in draw_from_deck_to_hand ? i have this but it just kills me no matter if cards should be drawn and G.hand.cards should be populated
this is probably an event problem
wrap your stuff in an event so it runs after the drawing card events
do events happen after stuff outside of events run?
yes
ahh so thats what theyre used for, do i need to use a special trigger = '' thing?
i think the default one should be fine
I'm trying to make played cards become queens, but they are being debuffed in the "cards previously played this ante" boss after being changed to queens, how could I fix this?
Here's the calculate function that I have so far:
calculate = function (self, card, context)
if context.before and context.main_eval and not context.blueprint then
local found = 0
for _, scored_card in ipairs(context.scoring_hand) do
found = found + 1
assert(SMODS.change_base(scored_card, nil, "Queen"))
G.E_MANAGER:add_event(Event({
func = function()
scored_card:juice_up()
return true
end
}))
end
if found > 0 then
return {
message = "Slimed!",
colour = G.C.MONEY
}
end
end
end
it might be a similar bug to this?
https://github.com/Steamodded/smods/issues/699
Oh, ok. Thank you
Is it possible to put shaders (i.e. polychrome) over a badge?
Like a mod badge?
a mod badge or a rarity badge, either or
No.
so this works for default interactions, but i have a joker that works off of context.first_hand_drawn and the joker doesnt get a chance to trigger before it kills you
so i think the solution would be to call whatever function checks/triggers jokers then check for cards?
and it's not possible for any kind of badge?
Yes.
you're already doing that, calculate_context does that
two questions: what does the joker do? does it matter that it triggers if you're losing?
the joker force draws a specific card if it isnt drawn in the first hand, and i would like the interaction where even if you have hand size 0 you dont die with the joker
well i dont think there's an easy way to do that without implementing your own hand_buffer or something
the event will always be too early for another card to be drawn
would there be another function i could use to check for G.hand.cards that would be late enough for the card to be drawn first?
no
oh wait i didnt fully understand what you meant
still no afaik, the problem is that there's no way to know that cards will be drawn in the future while also checking if cards were just drawn
you would need a hand_buffer like the joker_buffer or the dollar_buffer
(or hard-check for your joker)
would there be documentation on this?
no, it's not like an api thing, it's just a value that holds how many cards will be in the hand after events are played
look at how the vanilla cards use the buffer
basically the joker wants to increase the buffer by the amount of cards to be drawn
then you check for #G.hand.cards + hand_buffer < 1
you need to have an event inside an event inside the joker to clear it out
in events?
would the joker on the context be the thing to add to the buffer?
i think you can do blocking = true in returns
ah thanks
ill get on that tysm
debuffing or setting getting_sliced or hooking card:can_calculate
maybe
sure
thanks
even with this and checking for #hand + hand buffer it still kills with the joker
oh shit event
i forgot
you should also print what hand + buffer is
Entire day was spend on implementing all small things:
- text label if there's no appropriate card center to display
- alert, vanilla (!) or custom ones, where you can put anything, including DynaText
- pagination
Next step - support different card sizes (booster packs, halfsie joker etc), more visual adjustments, and first actual features
I should make own thread actually, but I'm lazy 
okay so my hand buffer never increases even with the joker there
oh i just noticed that you arent checking if hand_buffer is nil
do you set it to 0 somewhere
i added it in init_game_object
oh, thats the opposite of what you want
the increase shouldnt be in an event, the decrease should be
also you should just set it to 0 when you reset it
how many fps do animated atlases have? or can i somehow change the fps of it?
updated code and "triggered" doesnt print
did it print before?
no, but heres the state_events code
the hand buffer is in the wrong side of the inequality
omg i just nloticed that
idk about the print, that seems to be a different logic error
and still, doesnt work
but from the code the idea is correct
so maybe it has to do with the luggage card logic
i mean the print should print regardless of any hand_buffer stuff in that case
its weird that it isnt working...
and i made sure that it isnt game overing before any of that happens
@red flower brings a tear to my eyes
i will take it for myself
MINE
I'll just have to hard check for my joker :c
lol
what checks for cards in hand being 0 then trying to draw cards?
how could i check the score limit for talisman in a different mod?
i remember this being difficult to find because it had a weird syntax but i dont remember exactly where it was 😭
Anyone ever had an issue where enabling quantum enhancements in smods causes a hard crash/game close when selecting a joker once in the blind?
No.
There are some functions you can't use during context.check_enhancement that hard crash the game though.
and get_id() is one of them I'm assuming
Yes.
That'll do it. Thank you
oh question, do i do operations like to_big(var x) + to_big(var y) or to_big(var x + var y)
because i know talisman makes everything tables but i'm pretty sure you can't add tables
No, you do them like to_number(x) + to_number(y)
Yes, but talisman uses metatables to make that possible I think.
i'm here again to try to ask for help again on my sisyphus prime joker again because again, it won't multiply its values after beating a boss blind.
i couldn't ask for help last time so i'm doing it again this time
Its so… beautiful
hello, i have a question, is there any way I could make the small blind and big blind become boss blinds? In mechanics and appearance
Yes.
how?
i tried for 2 hours
i really dont know
i wanna make a deck with 10 jokers slots, but all blinds are boss blinds
Try looking at Enter the Gungeon from Cryptid
whats this? a deck?
but, ty
No, it's a challenge.
ok
i thought i had the answer but it still does not work. what am i doing wrong?
does anyone know how to fix the text at the bottom?
How do I add to the base chips and mult preview before you hit "play hand"? I'm not sure I'm doing this right.
i'm grasping at straws
Yes.
Development resumes after few days, for now it looks like this https://discord.com/channels/1116389027176787968/1389425026075332689
how would i check if you've scored naneinf without talisman and on vanilla score limit talisman?
are you gonna tell me?
of course not that's somethingcom "unhelpful 🤔 ❓ on every" 515
they only have four means of interacting with the world
Yes.
im sure you could find out the number before naneinf (not sure but you could try) and do something like "if scored chips > number before nameinf" (OBVIOUSLY not actual code
hey @daring fern i tried looking at the cryptid code, but i didnt understand it, can you help me ?
cryptid code is really confusing in my experience
ye, is a insanity
a mixer
never ever ever look at the cryptid code for reference
aikoyoris shenanigans helped me more then cryptid
my biggest help was vremade
vanilla remade
it was the only place i thought had what i was looking for, it was my only chance
also you should be more clear with what youre trying
So i tried putting this in a function file and what it does is it makes jokers in shop become 0 dollars but make their sell value the same. Was this intentional or am i just tweaking?
what are you looking for
i want a make the small blind and big blind become boss blind, in mechanics and appearance
a deck with this mechanic and 10 jokers slots
btw, sorry for mistakes, my english is dont very well
i still don't know why my joker does not work
sorry
Yes, I changed the code to be correct.
i mean i got the trigger function right
ok thanks
im going to be honest: i dont think cryptid has this either
cryptid has, the enther the gungeon challenge
i think i've seen it done before but i can't remember where
not the deck, but the hardest part, the blinds
oh
uhhh challenger deep is doing something similar as well (hopefully with more readable code)
@mental nacelle
this is my only problem
if context.end_of_round and context.main_eval and not context.blueprint and G.GAME.blind.boss then
card.ability.extra.xchips = card.ability.extra.xchips * card.ability.extra.xchips_mod
card.ability.extra.interest = card.ability.extra.interest * card.ability.extra.dollar_mod
card:juice_up(0.5, 0.5)
play_sound('sisyphus_yesthatsit', 1, 0.5)
return {
message = "Yes, that's it!",
sound = "sisyphus_yesthatsit",
colour = G.C.GOLD
}
end
challenger deep ?
hello
can you help me? i really dont can :(
hello
bump
idk, sorry
decks aren’t really my strong point but challenger deep technically has stuff for that
Yes.
i'm sure if you have a way to make every blind a boss anywhere somebody can string together spaghetti to put it on a deck
i mean the code is janky
sorry, but what is challenger deep?
but, you can help?
this is basically a challenge, I just want to know how to do the blinds part
are you just saying yes to evertyhting
No.
challenger deep is a backend mod that allows support for stuff like replacing blinds
this is a shade? lol
do you actually need the card background for enhancement or just the enhancement itself
oh ok
you have to understand that something can do one of four things:
- reply yes
- reply no
- react ❓
- react 🤔
The enhancement is the card background.
but, does it work with deck?
oh shit
or somenthing challenges
using challenger deep, if you applied the following to the run it should give you 3 boss blinds per ante:
G.GAME.modifiers.second_boss = true G.GAME.modifiers.chdp_third_boss = true G.GAME.modifiers.disable_small = true G.GAME.modifiers.disable_big = true
code block fail
oh ok
your deck would not work correctly without challenger deep installed
i can use this in the my deck ?
bump again
calculate = function(self, card, context)
if context.selling_card or context.destroy_card then
card.ability.extra.xmult = card.ability.extra.xmult+card.ability.extra.xmult_gain
return {
message = localize('k_upgrade_ex'),
colour = G.C.RED
}
elseif context.joker_main then
return {
xmult = card.ability.extra.xmult
}
end
end
why does the joker upgrade like 6 times whenever a hand it played
Yes.
it’s pretty late, so i’m not explaining very well, but if you read steamodded’s wiki you can get a good gist on where to put stuff
Because context.destroy_card runs once for each card.
ok
would it be like a API? would i have to include it along with with my mod's files? sorry, im pretty new to this stuff, im only good at programming games, not mod :(
are you gonna stop being cryptic and actually answer the question
well he's not wrong
ok, sorry for disturbing you and really ty
you don’t have to include challenger deep in your mod, but for the deck to function correctly (with the code i sent) it’d have to be installed
ah i see, what would i use then if i want to check if a card is destroyed or sold?
i need to optimise chdp’s code someday
A playing card or joker?
