#💻・modding-dev
1 messages · Page 637 of 1
it thinks those ends close something earlier that didn't get closed properly
Remove one of the ends :)
Either one
okay if you're getting a syntax error just post the entire SMODS.Joker
`SMODS.Joker{
key = 'lbpjalapeno',
loc_txt = {
name = 'Uncle Jalapeño',
text = {
'Gains {C:mult}+3{} Mult',
'whenever a card',
'is {C:red}destroyed{}'
}
},
atlas = 'Jokers',
rarity = 2,
cost = 5,
blueprint_compat = true,
eternal_compat = false,
perishable_compat = false,
pos = { x = 3, y = 0 },
config = {
extra = {
mult = 0
}
},
calculate = function(self, card, context)
-- Gain mult when a card is destroyed
if context.remove_playing_cards and not context.blueprint then
card.ability.extra.mult = card.ability.extra.mult + 3
end
-- Apply stored mult during scoring
if context.joker_main then
return {
mult_mod = card.ability.extra.mult,
message = "KABOOM!"
}
}
end
`}
you've got an extra }
readd the end, remove one of the curlies
And an end for the calculate function
those arrows match beginnings to ends
that one } isn't closing anything, and that one if doesn't have an end
try getting a code editor with brace highlighting it really helps
like alot alot
well
`SMODS.Joker{
key = 'lbpjalapeno',
loc_txt = {
name = 'Uncle Jalapeño',
text = {
'Gains {C:mult}+3{} Mult',
'whenever a card',
'is {C:red}destroyed{}'
}
},
atlas = 'Jokers',
rarity = 2,
cost = 5,
blueprint_compat = true,
eternal_compat = false,
perishable_compat = false,
pos = { x = 3, y = 0 },
config = {
extra = {
mult = 0
}
},
calculate = function(self, card, context)
-- Gain mult when a card is destroyed
if context.remove_playing_cards and not context.blueprint then
card.ability.extra.mult = card.ability.extra.mult + 3
end
-- Apply stored mult during scoring
if context.joker_main then
return {
mult_mod = card.ability.extra.mult,
message = "KABOOM!"
}
}
end
end`
they have one already fish
try adding it to your code editor
oh
built in with vs i think thats cool
i use np++
if context.joker_main then
return {
mult_mod = card.ability.extra.mult,
message = "KABOOM!"
}
} -- DELETE THIS IT DOESN'T HAVE A CORRESPONDING {
end
put one } below all the ends
just like. go through your code looking at all the {s and ask yourself, "where is the } that closes this?"
you should read up on lua basics
think of the joker as one big table in a {} aswell (because it is)
yeah probably.
GOT IT.
key = 'lbpjalapeno',
loc_txt = {
name = 'Uncle Jalapeño',
text = {
'Gains {C:mult}+3{} Mult',
'whenever a card',
'is {C:red}destroyed{}'
}
},
atlas = 'Jokers',
rarity = 2,
cost = 5,
blueprint_compat = true,
eternal_compat = false,
perishable_compat = false,
pos = { x = 3, y = 0 },
config = {
extra = {
mult = 0
}
},
calculate = function(self, card, context)
if context.destroying_card and not context.blueprint then
card.ability.extra.mult = card.ability.extra.mult + 3
end
if context.joker_main then
return {
mult_mod = card.ability.extra.mult,
message = "KABOOM!"
}
end
end
}
i really recommend putting code in a code block
markdown really hates making it possible to demonstrate this so here's a screenshot instead
if some_lua_code then
--put it in a code block like this
end
got it
so the joker works!
kind of
it doesnt add mult to itself.
it only just activates.
i guess itd be cuz of the destroying card context
have you, in fact, destroyed any cards
okay yeah you want a different context for this https://github.com/Steamodded/smods/wiki/Calculate-Functions#contextremove_playing_cards
destroying_card is a context, it's just the wrong one
i feel like you had the correct one before
k
yeah whyd you change it
thought it'd work.
but yes it works now.
oh this next one's gonna be fun.
"Trigger Steel Cards regardless of position"
(except in deck)
I have a seal that isn't being affected by mime and I'm not sure how to fix that
key = 'Seafoam',
atlas = 'Jokers',
pos = { x = 4, y = 3 },
badge_colour = HEX('5acf95'),
loc_txt = {
label = 'Seafoam Seal',
name = 'Seafoam Seal',
text = {
'Creates a common {C:attention}Joker{}',
'at end of round',
'if {C:attention}held{} in hand',
'{C:inactive}(Must have room){}'
}
},
loc_vars = function(self, info_queue)
return { vars = { (G.GAME.probabilities.normal or 1) } }
end,
calculate = function(self, card, context)
if context.playing_card_end_of_round and context.cardarea == G.hand and #G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit then
G.GAME.joker_buffer = G.GAME.joker_buffer + 1
G.E_MANAGER:add_event(Event({
trigger = 'before',
delay = 0.0,
func = function()
local new_card = SMODS.add_card({ set = 'Joker', area = G.jokers, key_append = 'ocean', rarity = 'Common' })
if new_card then
new_card:juice_up(0.3, 0.5)
play_sound('card1')
end
G.GAME.joker_buffer = 0
return { message = '+1 Joker', colour = G.C.ATTENTION }
end
}))
return
end
end
}```
there are two options:
A. spaghetti code a held in hand check then let played steel cards benefit from the joker giving it mult
or
B. hook
good idea
spaghetti code and hooks aren't mutually exclusive, you can have both!!
YI
keep in mind. this is only the current jokers.
i
i have to add a booster pack with cards and seals next.
ssssO
FUN
Seals are similar to jokers, except playing card
Is there anything in a Planet card's specification within G.P_CENTER_POOLS that lets me see whether or not the card's been discovered?
G.P_CENTERS[planet_key].discovered will be true if the planet with the key planet_key has been discovered
for instance, G.P_CENTERS["c_earth"].discovered will get the discovered status of Earth
this will also work for any object classified as a Center
i.e all consumables, jokers
bump
For anyone who wants to know, the reason mime didn't trigger this seal is because the message I returned { message = '+1 Joker', colour = G.C.ATTENTION } was nested inside an event instead of being in calculate. So I just changed the first return to return true and put the message in the second return
What does blocking = false on an event actually do? I thought it'd let you play the game and just run in the background until it returns true, but I'm wrong
Why in the world does modifying the UI do this?
how would you check if the player is using a curtain deck?
if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect.center.key == 'b_modprefix_key'
how ddo i make a joker do something at the end of ante
you could always do after boss blind
?
when i use it, it seemly triggers twice?
Show code
calculate = function(self, card, context)
if context.after and not context.blueprint then
print(card.ability.extra.hands_played)
card.ability.extra.hands_played = card.ability.extra.hands_played + 1
end
if (context.ante_end) or context.forcetrigger then
if card.ability.extra.hands_played < 4 then
for i = 1, 3 do
local consumable =
SMODS.add_card {
-- For a random one
set = "Consumeables",
area = G.consumeables
}
consumable:set_edition("e_negative")
end
end
end
-- any ante change should reset the counter
if context.ante_change then
card.ability.extra.hands_played = 0
end
end
Add and context.ante_change
works 😇
@admins
is there any way to change collection order besides registering the objects in a different order?
Have you checked smods wiki?
yyea
Eh idk
bump
im just going to rewrite it to change reg oder
order
yyou have to call the check for unlock i think
I have the code and everything but it doesn't work
Is there an easy way to add a line of text to card description? I have a joker that adds xMult to playing cards and it would be nice display it, but generate_UIBox_ability_table and generate_card_ui seem like a nightmare to work with...
Can you share what you have? You shouldn't have to do anything fancy to get the xMult to show
SMODS.Joker{
name = "Fairytale",
key = "cv_fairytale",
loc_txt = {
['name'] = "Fairytale",
['text'] = {
"All cards in deck",
"gain {X:mult,C:white}X#1#{} mult",
"each hand. Buff {C:attention}resets{}",
"when card is scored"
}
},
config = {
extra = {
Xmult = 0.03,
drain = {}
}
},
pos = {x = 8,y = 1},
cost = 8,
rarity = 3,
blueprint_compat = true,
eternal_compat = true,
unlocked = true,
discovered = true,
atlas = 'CVjokers',
loc_vars = function(self, info_queue, card)
return {vars = {card.ability.extra.Xmult}}
end,
calculate = function(self, card, context)
if context.cardarea == G.jokers and context.before then
for i = #G.playing_cards, 1, -1 do
local c = G.playing_cards[i]
c.ability.fairy = c.ability.fairy or 0
c.ability.fairy = c.ability.fairy + card.ability.extra.Xmult
c.ability.x_mult = c.ability.x_mult + card.ability.extra.Xmult
end
elseif context.individual and context.cardarea == G.play then
if not context.blueprint then card.ability.extra.drain[#card.ability.extra.drain + 1] = context.other_card end
elseif context.destroying_card and not context.blueprint then -- Does not destroy cards but uses this scoring faze to reset .fairy from them
for i = #card.ability.extra.drain, 1, -1 do
local c = card.ability.extra.drain[i]
c.ability.x_mult = c.ability.x_mult - c.ability.fairy
c.ability.fairy = 0
end
card.ability.extra.drain = {}
end
end
}
Here is the code
the joker basically adds 0.03 mult to all cards in deck
the mult is on them not on joker
try adding perma_x_mult instead of x_mult. basically the xMult version of Hiker's chips
hmmm was perma_x_mult added in smod? I dont see it anywhere in base files
seems like it
Definitely browse the smods wiki, you do end up finding some neat features
how do you detect if a playing card was retriggered (regardless if it was in played hand or not)?
yeah! like if a playing card with red seal gets retriggered or a face card is retriggered with sock
any card retriggers
i have a method for scoring
actually, the scoring method can also work for in hand
This Joker adds +1 mult to any card that gets retriggered in scoring hand
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
if (context.other_card.count or 0) >= 1 then
context.other_card.ability.perma_mult = (context.other_card.ability.perma_mult or 0) +
card.ability.extra.mult
return {
message = localize('k_upgrade_ex'),
colour = G.C.MULT
}
end
context.other_card.count = (context.other_card.count or 0) + 1
end
if context.joker_main then
for i = 1, #context.scoring_hand do
if context.scoring_hand[i].count >= 1 then
context.scoring_hand[i].count = nil
end
end
end
end,
ooh
is context.other_card.count referring to how many times a card is retriggered?
thats what im guessing
you can add and context.cardarea == G.hand and not context.end_of_round to take care of the cards held in hand
yep
you would also have to add a reset to cards held in hand under context.joker_main
I'm having some trouble understanding how rarities are handled for object/consumabletype. I want to make a consumable group that has essentially different rarities
Anyone who could help better explain it would be greatly appreciated.
does context.scoring_hand mean any card that triggers, like gold/steel cards, or just played cards that get scored?
just played cards that get scored, no held in hand effects
checking for more locations
You would have to hook SMODS.trigger_effects and check if there are effects and do what you want to do in the hook.
Making a unlock condition where if I the player goes to max debt (-$20) the card is unlocked, but it doesn't work any help
check_for_unlock = function(self, args)
return args.type == 'money' and G.GAME.dollars == -20
end
Do you have Talisman installed?
yep
also just in case I checked the documentation of talisman and some of the code in cryptid
and to_big(G.GAME.dollars) == to_big(G.GAME.bankrupt_at)
key = 'consecutive',
func = function(hand)
if #hand < 4 then
return {}
end
local counts = {}
for _, card in ipairs(hand) do
local v = card.base.id
counts[v] = (counts[v] or 0) + 1
end
for v, n in pairs(counts) do
if n >= 2 and (counts[v + 1] or 0) >= 2 then
local result = {}
for _, card in ipairs(hand) do
if card.base.id == v then
table.insert(result, card)
if #result == 2 then break end
end
end
for _, card in ipairs(hand) do
if card.base.id == v + 1 then
table.insert(result, card)
if #result == 4 then
break
end
end
end
return result
end
end
return {}
end
}```
```SMODS.PokerHand{ --LinkedPairs
key = 'Linked Pairs',
visible = true,
mult = 3,
chips = 20,
l_mult = 1,
l_chips = 20,
example = {
{'H_T', true},
{'S_T', true},
{'C_J', true},
{'S_J', true},
{'D_4', false}
},
evaluate = function(parts, hand)
return parts.giga_consecutive or {}
end
}```
ok so I have this poker hand and the hand is detect when I select the cards and everything is fine about that but when I play the cards only one score
return {result}
Yes, you need to return a table of tables of cards.
oh ok got it
Ok, it worked thanks
I want this Blind of mine to switch off when a certain rank is scored, but it's not working. Any pointers?
calculate = function(self, blind, context)
if not blind.disabled then
if context.individual and (context.cardarea == G.play) then
G.E_MANAGER:add_event(Event({
trigger = 'after',
blockable = true,
blocking = false,
silent = true,
func = function()
if LAPSEMS.contains(self.config.extra.table_of_ranks, context.other_card:get_id()) then -- This line produces a crash -- says `other_card` is a nil value.
card_eval_status_text(context.other_card, 'extra', nil, nil, nil, {
message = localize('ph_boss_disabled'),
colour = G.GAME.blind.config.blind.boss_colour
})
self:disable()
end
return true
end
}))
end
end
end,
Do local other_card = context.other_card outside of the event and use other_card instead of context.other_card
I've been having this really weird issue
I'm trying to check for when a card is triggering by hooking onto SMODS.calculate_effect and other similar functions
no way so am i what a coincidence
And for some reason when I check for triggering cards during context.individual, the first trigger on a card is always nil (I'm setting a "triggered" flag during SMODS.calculate_effect)
Yes, context.individual is triggered before SMODS.calculate_effect is called.
Is there any way to get when cards (both in hand and in play) trigger then in a way that doesn't cause any issues?
Like, is there some other context that runs after calculate_effect
No, you would hook SMODS.trigger_effects instead and do what you want to do in the hook.
Well trigger effects sorta runs every frame which is less than desirable
Since I'd preferably want something to run once when I put a card into play or when it's triggered from hand like a steel card
I mean, unless trigger_effects doesn't run every frame and hooking it inside of calculate messes things up
Yes, you would check if there are effects.
It doesn't but you shouldn't be hooking in calculate.
eqmult type effect not working???
code for pretty much all of these
local chips = SMODS.Scoring_Parameters["chips"]
chips.current = (smth)
update_hand_text({delay = 0}, {chips = chips.current})
if not Talisman or not Talisman.config_file.disable_anims then
MyDreamJournal.card_eval_status_text_eq(scored_card or effect.card or effect.focus, 'chips', amount, percent, nil, nil, "Chips = "..chips.current, G.C.BLUE)
end
return true
How do i make a new consumable type?
Is it normal that telescope doesnt work with my custom hand ???
ok thanks
this link should be pinned
Litteraly
Or like a rule that says "before asking, look at VanillaRemade"
yes, and it could even be a great transition to people asking/learning what stuffs mean :)
there is stuff i try finding in vremade and dont find it but it was just hidden lmao
Yeah
Idk if its in VanillaRemade but I was trying to find PokerHandPart but didnt find it. It could be a nice addition to VanillaRemade for understanding what every parts do.
for now at least, you can check in vanilla code for the functions get_highest (effectively the definition of the high card pokerhandpart), get_straight (same for straight), get_flush (same for flush), and get_X_same (the first table that this function returns is used as the definition for the _2, _3, _4, and _5 pokerhandparts). and then look at smods src/game_object.lua for the pokerhandpart _all_pairs (it also involves get_X_same)
but yea i do think it'd be nice to translate those vanilla functions into direct pokerhandpart definitions in vanillaremade
(here's the relevant section in smods src/game_object.lua btw)
Oh nice thx. I never know where to look for shit like "do I look in lovely dump or in smods folder"
And Im always lost in these
btw the way the SMODS.four_fingers function is used here is really weird lmao
the function does indeed take an argument but it just. doesn't do anything with it. it does not matter what you pass in
top 10 functions of all time
Yes, because it's used for hooks.
local oldsmodsfourfingers = SMODS.four_fingers
function SMODS.four_fingers(hand_type)
if hand_type == 'flush' then
return 3
end
return oldsmodsfourfingers(hand_type)
end
i meant in like an actual mod
because it feels like the only use case is for specifically modifying how the vanilla Four Fingers joker works for one of the two hand types
anything else and you would be better off writing your own utility function
i guess its because it reduces both flushes and straights? though its probably not the best for extending the effect
hm yea, i guess if you have another joker effect that specifically only lets you make straights with 4 cards, or only flushes with 4 cards, then the hook to four_fingers would be useful
but it still feels very offputting, and i feel like there's a better way to go about it
at that point i guess the function name is the issue for me
How do I make this say use like how arcana or spectral packs do it
Show booster object
Hlep
Oh so gives double xmult if both are scored
I mean twice and double isn't exactly the same in case of multiplication but yeah kinda
You're setting card.ability.extra.retrigger to 0 before returning so repetitions will always be 0
Nvm they got it
i love plants vs zombies 🥹
The SMODS.ObjectType should be a SMODS.ConsumableType
Fern, we love Fern
Yessir
i dont understand anything 😭
i read the smods docs lots of times and yet i still dont understand
OMG TETO REMEMBER ME? IM BACK but i wont do it this time cause busy
Yes I remember you
What's the next "I'm a fan" you're gonna say
Read the vanilla remade code smh
read it more
For ObjectType rarities, is this asking for specific object keys or rarity keys?
I forgot lmao
pretty sure its object keys
question for the mod makers, what do you usually do for the art?
do you do it yourselves or commission it out?
Former applies to most, I'd say.
aseprite ✍️ (do it myself)
only you know how you want your art to be, after all
very true
do you usually reference other images? or can we use the default balatro art and sort of build off of that?
Wasn’t it a whole galaxy or am I forgetting
Probably idk
Ill have to check later
Its not a galaxy
Ah
you can do anything you want lol
most people use reference images
and balatro art can help give some lines to stay on
but i've seen people use random images as joker sprites and i've seen people use slightly hue-shifted base sprites for jokers
do whatever ya want
depends on the card
if the card is based off something else, its almost like you have to make it look like that thing...
but for regular art im trying to stay somewhere in line with balatro but i suck so much its just a new art style
I've often drawn some of my cards based on specific images for my mod, though since it's based on representing some comics, it makes sense to use more iconic compositions
You can get context.scoring_hand[1] in context.before like this
if context.before and not context.blueprint then
local first_card = context.scoring_hand[1]
local enhancement = SMODS.poll_enhancement { key = "seed", guaranteed = true }
first_card:set_ability(enhancement, true)
end```
How do I get the localized name for an enhancement?
Best to check if context.scoring_hand[1] ends up existing first...
-# Looking at you, "None" hand.
how do i move a card from the discard area to the top of the deck
Does anyone have tips for making stickers? I've tried, for example, making them only for jokers or with a rate of say 0.3, but they appear on EVERY card, even on jokers when I say sets = {Joker = false} and/or rate = 0. In vanilla remade, two of the remade stickers have some card.config.center.perishable/eternal_compat, but non of this in the rental, so idk where the joker-only should come from. I dug that @static valley has had similar issue with no apparent answer
when the sticker has a custom should_apply function, it completely ignores the rate you set for the sticker. you need to account for it in the function
i made this joker idea b4 joining the community, but sadly everyone and their mother has done this joker effect 😭
there's only one thing i dont like about this and its the fact that sixfold is the name of the mod
wdym
nvm
six folds is pretty much all you'll get with a normal piece of paper
i forgot like almost literally no one here knows about blackout revival
maybe seven
sevenfold...
you probably couldnt fold a playing card more than 6 times tbf, theyre thicker than paper
ngl both of yall could have just posted in modding-chat
its weird not debugging someones shit here
oh sorry, ill post it there instead
buh
how do you check if every card in a played hand is a different rank?
the easiest would be check that there are no pairs (not next(context.poker_hands["Pair"]) but if you want something more robust loop through every card in the hand and make a table with the rank keys (playing_card.base.value) and if the key already exists then there's a duplicate
Does anyone know a context that occurs when chips are added to your total after a hand is scored? context.after occurs just before this step
the only context I find that comes next is context.hand_drawn, which is a step too late for me
context.after is after that
make sure you're using events
card.ability.extra.hand_tick = false
card.ability.extra.replenishments = card.ability.extra.replenishments - 1
G.E_MANAGER:add_event(Event({
func = function()
ease_hands_played(1, 1)
return true
end,
}))
return {
message = "+1",
colour = G.C.BLUE,
}
end
Do I need to use after in the event?
no that should be fine
do you want it to happen after all the cards in play are discarded?
Thanks N, I've pieced it together now (I put an if statement within the event)
At least the art is heat
that's all thanks to @brisk tree 🔥 🔥
Yes
is there a way to make a card visually bigger?
And permanently keep it visually bigger?
Yeah, if you’re not talking about scaling on the fly, you can set a display_size property to the card object
why is this art so fucking peak 🌹❤️
sick art
Is it going to be harder if it needs to be on the fly?
Slightly yes but still possible
You can do so by doing math on card.children.center.scale.(x or y)
Actually no that's not correct, you'd be doing math on card.T.w and card.T.h for height and width scale respectively
is there sth i dont understand about .toml? is it not being loaded or sum? because this should work
Where is the file located and what's its name
wait the name matters?
ic
this joker is supposed to check if the first hand in round is a single heart card, delete it, upgrade itself by +12 mult, then add that mult to the hand score. right now it's doing everything except adding the mult to the final score
It should be card.ability.extra.mult not card.ability.mult
ohmyg od thank you so much
or
okay i dont think that solved it but i DID miss that card.ability.mult typo so thank you!!
it still isnt adding the mult to the score though which is peculiar
i think i found the source of the issue
but i still dont know how to fix it
context.modify_hand
is this something a joker can use?
according to print(mult) this is triggering right as i play the hand, even before it deletes the card
(also sorry for talking over you rose)
you see it always does that without fail
you're good, no worries 👍
because shit is not calculated when you see it appear
it is all precalced
this is why events exist
ooooo
so you can get the neat order on screen
how can i take advantage of events here
wait theres the uhh
yeah but i'm not certain thats the issue
ah whoops
Yes, context.destroy_card happens after context.joker_main
i'm just saying its printing before because everything does that lmao
how do i make it trigger after destroy_card
You would increase the mult in context.before instead.
HOLY SHOOT IT IS, why aren't more people using this? 
Increase card.ability.extra.mult
wait but wouldn't i need to add all the other checks alongside context.before? or am i putting that if statement inside if context.destroy_card?
if not context.blueprint and #context.full_hand == 1 and context.full_hand[1]:is_suit(card.ability.extra.suit) and G.GAME.current_round.hands_played == 0 then
if context.destroy_card then
return {remove = true}
elseif context.before then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
end
end
oh word, thank you! i'll give this a try
gonna try adding context.cardarea == G.play and context.main_scoring to the larger if statement
that stopped the crashing, but the joker's mult stil isnt being added to the score
while i understand not wanting to repeat statements it's always better practice to put the timing context before the information checks (i.e. making before and destroy_card the outer if)
i'll give that a shot
also don't put function calls in returns unless you actually need to return the value
but i dont know if it'll trigger in the order i want it to? like i want it to be: single heart card is played in first hand > joker deletes heart card and upgrades its own mult > joker adds mult to hand score
the order of the ifs is irrelevant, contexts run in a specific order
destroy_card is always at the end
you can try using SMODS.destroy_cards() instead in context.before
alright
how does this look
No, remove the and context.cardarea == G.play and context.main_scoring
anyone know how to fix this? this happened today when im trying to mod but i think disabling the yahimod just bricked my balatro
it works!!! thank you so much!!
i tried most ways as from deleting the mod, deleting the roaming, deleting the game and reinstalling
most didnt work
what's the card area for in hand cards
wtf
bro basically deleted his pc
😭
have you tried deleting system32
real
omfg 😭
im fr being serious unless its the fact its actually just removing everything i had in balatro
all bc of a weirdass error im having rn
also %^^^^^!^@^^^^
im also serious
who the hell deletes all their file and shit as the first fix😭
well idk, this is my first time encountering this errror
not entirely the roaming
idk what to do for you
the balatro folder in the roaming folder
at this point deleting system32 might be the peak solution
just factory reset your computer 💔💔💔
oh
idk man
i have NEVER seen anyone deleting shit outside of Mods folder
like why
probably just replicate and recreate your balatro folder
could work
how would I make a tarot card give mult when used
depends on how you want to do it, because you cant use a tarot while scoring so either you have to use it before and store the value or you need to "switch on" your tarot so it scores during the next calculation
you can use keep_on_use and then use calculations like a joker and destroy the card when calculation ends
the confections in balatro goes kino do something like that
is it possible to detect if you're hovering over a joker?
iirc it's like G.CONTROLLER.hovered.target
<@&1133519078540185692>
How many times we keep getting these damn bots?
Too often
Gonna ask around again, does anyone have decent existing solutions for modifying the values of text inputs without somehow misplacing the cursor/input position
I've been ripping my hair out over this
Put input in oblect and when you need create new input and rerender it
Oh you need keep cursor pos too, hm
oh my god this exists?
YESSSS
context.scoring_hand
even more, G.CONTROLLER.dragging.target exist
what's ref table and ref value?
this but replace the ui bits with Other things
i used the ui doc for this because i feel like it explains it better
basically ref_table is the table that ref_value is in and ref_value is a variable
i think
i just spawned this mf
So if the ref table is G and the red value is GUAC, then whatever is in G.GUAC…
more like if ref table is G and the ref value is "GUAC" specifically
but yeah thats the general idea
mhm
in cases where ref_table is the value (a table) and you wanna get an entry from that table (for example ref_table[1]) you'll use a number (quotations) as the ref_value
how would i make my joker not debuff itself
i'm thinking simply not allowing it to target itself, though i don't know what i would put
if G.jokers.cards[i] ~= card?
it works!!!
(unless it's just itself and one other joker, but the player has earned the benefits of self debuff if they can only survive with only 1 joker past anti 8, as it's only possible to get at the end of anti 8.)
how to check for triggering playing cards?
i arted again
how do you create a random tag
add_tag(Tag(get_next_tag_key('seed')))
i feel so happy inside when i spend an hour on trying to fix code
hey how do i make a tag similair to the uncommon and rare tags
ok this is a certified me forgetting vanilla remad
e

How do I add passive effects to stickers, e.g. a juggler effect? the functions add_to_deck and remove_from_deck aren't supported by smods.sticker
GUYS
WHATS THE CONTEXT FOR DISCARDING
like not checking per card just checking for if you discarded
context.pre_discard
how do i check when a consumable is bought
and how do i check for the type of consumable
if context.buying_card and context.card.ability.consumeable and context.card.ability.set
yes, get_weight
awesome,,,
That is an option, but since this is sometimes per-frame updates it would be best to avoid that
uhh
how do i work this mechanism
like edit an editions weight with a different card
anyone know why this only works for the first ante when the run starts but when it goes to the second ante the hidden blind re-appears?
okay this doesn't seem to work
probably because it's the effect of an unrelated Joker and not the card itself
Code?
hey i want to make a joker that extra x2 to card per trigger like joker Hiker , how can i do that?
x2 their +chip?
gain x2 mult when scored
ah
how can i code that
okay
thanks
how do i get a list of the game's jokers
should be on the wiki
if you're talking about base balatro
idk man]
I think he meant a list of all registered jokers within the game
yea
so it should include mods
oh ok
try to access collection ig
well idk
cant help rn cause gotta do family stuff soon
G.P_CENTER_POOLS.Joker
does anyone know how I would make code run right after a hand is played?
Outside a card specifically
Is there a specific function that runs that?
Use the mod calculate.
but calculate only works inside of specific classes, doesn't it?
SMODS.current_mod.calculate = function(self, context)
if context.after then
end
end
G.GAME.LAPSEMS_poker_hands_played_this_ante never fills up with poker hand names. Might anyone tell me why?
SMODS.current_mod.calculate = function(self, context)
if context.press_play then
G.GAME.LAPSEMS_poker_hands_played_this_ante = G.GAME.LAPSEMS_poker_hands_played_this_ante or {}
if not LAPSEMS.contains(G.GAME.LAPSEMS_poker_hands_played_this_ante, context.scoring_name) then
G.GAME.LAPSEMS_poker_hands_played_this_ante[#G.GAME.LAPSEMS_poker_hands_played_this_ante + 1] = context.scoring_name
end
end
end
am i missing sth? does get_new_boss() not get called every ante?
Yes, context.press_play doesn't have context.scoring_name
What does?
context.before
localize({type = 'name_text', key = 'j_modprefix_key', set = 'Joker'})
Now the "Hand will not score" text flashes inconstantly without filling up. What do I do to stop that?
get_loc_debuff_text = function(self)
local random_hand = pseudorandom_element(G.GAME.LAPSEMS_poker_hands_played_this_ante, 'bl_lapsems_nose')
return G.GAME.blind.loc_debuff_text ..
localize {
type = 'variable',
key = 'k_lapsems_blind_example_hand',
vars = {
localize(random_hand, 'poker_hands')
}
}
end,
-- 'k_lapsems_blind_example_hand' = " [i.e.: #1#]",
now it just displays ERROR
Yes, it would be placeholder_joker.key
the code inside of calculate doesn't seem to run at all
what version of smods do you have
yea that's ancient lol
Damn lmao, didn't know
latest version came out a couple of days ago, update
the mod calculate feature was added in late august, updating should get it working
How do I update Steamodded? Is there some special procedure to go through, or do I delete the folder and download the updated version in its stead?
haha it works, who knew the issue was the steammodded version
Also, this Blind's "Hand will not score" text flashes over and over again without settling on one hand. How do I get it to instead display a random poker hand whenever a new selection of cards is made?
get_loc_debuff_text = function(self)
local random_hand = pseudorandom_element(G.GAME.LAPSEMS_poker_hands_played_this_ante, 'bl_lapsems_nose')
return G.GAME.blind.loc_debuff_text ..
localize {
type = 'variable',
key = 'k_lapsems_blind_example_hand',
vars = {
localize(random_hand, 'poker_hands')
}
}
end,
-- 'k_lapsems_blind_example_hand' = " [i.e.: #1#]",
where can I modify the maximum selected/played hand size?
and can I apply a change to that value through the card back apply_to_run() config function?
SMODS.change_play_limit(number)
How would I go about ending a blind early (and potentially also removing cash out)?
just delete and redownload
sorry I haven't gotten around to helping with the boss blind, I'm on vacation rn
afaik get_loc_debuff_text shouldn't be used for effects, just to return the text
debuff_hand is where you want to randomize
You would need to change the state from blind to shop probably
On VanillaRemade, I see this functionG.FUNCS.cash_out({config = {}}) but I can't find any other resources on it
sadly this is a bit more advanced, you would need to look into where the game sets G.STATE and patch that
there's no easy way to change game states as of right now and it can be a bit jank if you don't change the right things
I adapted it from The Mouth, which points out the one hand type you're obliged to play this round. How do I get The Nose to do something similar?
the exact same way but when it sets the only hand do it randomly
oh i didnt read the description
you need to just save the hands
I already save the hands.
SMODS.current_mod.calculate = function(self, context)
if context.before then
G.GAME.LAPSEMS_poker_hands_played_this_ante = G.GAME.LAPSEMS_poker_hands_played_this_ante or {}
if not LAPSEMS.contains(G.GAME.LAPSEMS_poker_hands_played_this_ante, context.scoring_name) then
G.GAME.LAPSEMS_poker_hands_played_this_ante[#G.GAME.LAPSEMS_poker_hands_played_this_ante + 1] = context.scoring_name
end
end
end
what part are you having difficulty with, the debuff or the text?
The text. It flashes inconstantly with the example hand-to-play constantly changing. I want it to stick with one hand until the card selection changes to a hand that's been played this ante.
what do you want the text to display
Hand will not score
Poker hand must have been played previously this Ante [i.e.: #1#]
...with #1# being the localized name of a random poker hand that's been previously played.
then do this
in debuff_hand or context.debuff_hand (whatever you use) set the random hand that the text will use
how can i make a calculate function using joker_main repeat a return multiple times?
SMODS.calculate_effect
takes the same table as the return values but continues afterwards

Looks like that did the trick.
Color correcting the jokers on the right........
Greedy and Wrathful feel like they're ever slightly off, whereas I can barely tell Lusty and Gluttenous aren't vanilla
Onyx Agate also is pretty noticeable
is there a way to change how often certain rarities appear
finally getting back on cudgel stuff
@rocky plaza the cudgel boss blind is still broken
heres the cde
**code
idk why its rendered as a text file
lemme redo it as a lua
hold on
@rocky plaza what do i do
I'm looking at it rn
thankies
A little more obvious with Seeing Double but I think that's alright
theres a lot that needs to be fixed so i'll send the fixed version as well as comments explaining what i fixed and changed
Found a solution that kinda works but works well enough for me, but now I gotta know how to get the deck you're playing
G.GAME.selected_back.effect.center.key
thanks pookie
...
You know what? Fuck you. Flower Pot uses the Diamonds palette
hiiii
oke lets check it out
ahhh, i see
so it looks like i forgot to add "round end" "round disabled" contexts
i will keep all of this in mind 🥺 thank you so much 😭
specifically, theyre not contexts
the code for when the blind is defeated or disabled go in different functions from the calculate function
sup, anyone got resources for how to make replacement texture for balatro? a random reddit thread said to come here
o i see i see
what kinda texture pack do you plan on making?
i was planning on making one that makes all the jokers cats
thats literally it lmao i thought itd be cute
maybe maybe diamonds cat eyes, hearts cat paws, idk about spades and clubs
make every card follow that palette
For jokers, use malverk https://github.com/Eremel/Malverk
For playing cards, see https://github.com/Steamodded/smods/wiki/SMODS.DeckSkin
ty!
I'm doing this just to pare down the size of vanilla palettes mostly
these all look lovely! :O
thank you!!!!
I inherently have to make some compromises to make my palette editor work but I want them to look close enough to vanilla that if you don't see a comparison you don't see the difference
Does anyone have the code for cryptid's green seals? the ones that function on being played and unscoring
does this seem balanced (costs $5)
nevermind i think i found it
if context.main_scoring and context.cardarea == "unscored" then
end
would do what you want
cool thank you
consider cryptid as like a last resort code reference
Is there a way to use SMODS.add_card to also change what edition the card to be added will have? Asking in the context of consumables
#⚙・modding-general I think, and nah
true lol
It used to be my first resort LOL
My first resort is vanilla remade
pass edition = "edition_key" into the call
But I’ve dug into some pretty random mods to try and find examples of highly obscure roughly similar concepts
Thank you
Yeah that's mine now too
I just could not find documentation for SMODS.add_card for whatever reason
theres docs for it
under the utility section
also the calculation section of the smods wiki was recently rewritten
Missed that section that explains it
I was looking all around the game objects things
anyways, time to work on some jank ui stuff
how do i mess around wth how poker hands are calcuated///
What kind of card
I mean Joker card, what is the Joker trying to do
You'll have to go to function get_X_same I think
pretty much anything that is requires a non-specific rank would be affected here
As well as function straight
lovely patch...
Yeah probably. I used hooks
where would i find an example of an atlas object in the vanilla remade mod
Okay finished the main suit palette
how do you change what file is loaded outside of the game
trying to load my main save file crashes
Some of them are more egregious but I think they're close enough to vanilla to work
cool
what does it do
i hate boss blinds which affect things outside of their blind
Huh..... I'm actually not sure how to change the default atlases for playing cards
they're retaliating because of the chicot bug
i think it says smth about it on the atlas object page on the wiki
me when i accidentally make my joker and atlas files jsons instead of luas
i was wondering why there was so much red text
Time to overwrite get_front_spriteinfo to death
haahahahahaahah
🍅
you cannot
there are some upcoming jokers that should make it easier to get larger hand sizes
hi folks, anyone have an idea of how i would go about adding a set of items that function like vouchers but arent included with them? like i dont want them to show up in the shop with vouchers or in the voucher tab in the collection, but i do want them to be in the voucher menu during a run or in a similar menu of its own
bump
like should i be using SMODS.Voucher for something like that or should i create a SMODS.Consumable
since youre creating an entire new object type with custom collection and menus youre probably best off extending SMODS.Center
makes sense, thank you
you mmmmight be slightly better off extending smods.voucher and then futzing around to undo some stuff that vouchers do
extending smods.center is cleaner in the end, but requires you to re-add some stuff that vouchers do too
maybe i should just try extending smods.center and put together a guide on how to do that properly lmao
where is a array of suits/a array of suit keys stored?
Kills ur palette toggle for fun
you're copying card into G.hand, but im pretty sure that second argument is supposed to specify a card to copy onto, not an area
that better have a wildly low chip requirement
x1 base
WHY 😭
You're telling me they were off all this time?
oh wait nvm, needle is also X1 base
actually another question, will this work with high contrast?
is there a way to make a card count as any rank for joker effects?
im making a joker that changes the wild card effect to counting as any rank instead of any suit
currently, no
but quantum ranks any day now
i mean. if you constructed the entire function and also took ownership of all jokers that cared about rank to make them use the function
then no
i mean could you maybe have the card loop thru all ranks instead of posing as all of them at once
or, no that;d break stuff like hack wouldnt it
Card:get_id() is the current canonical method of checking rank, and it returns one number
dang
No, there is a way.
quantum ranks tomorrow
👀
what is this
It's the only way to do quantum ranks whilst still being mostly compatible with mods.
how do i make this work for my joker?
im still pretty new to lua and balatro modding and looking at this file is making me confused
It replaces every card:get_id() == id with ids_op(card, '==', id)
I didn't write this code, also other people have used this code before.
calculate = function(self, card, context)
if context.change_suit and context.other_card:is_suit("Diamonds") then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_mod
end
is there a reason this is doing jack shit
change_suit only happens when a card actually changes suit (e.g. starring a diamond won't do anything)
also i have no idea whether context.other_card is the card before or after the suit change
There we go, seeing double's gradient is now procedurally applied from a flat color base sprite
You should check if context.new_suit == 'Diamonds'
But is that compatible with wild cards

so i put the multirank.toml file in my mod's lovely folder, and then put the ids_op function into my mod's main.lua?
You would put the multirank.toml in a lovely folder in your mod, then you would take the function from the second link and modify it to check for your joker.
i want the effect to apply to not the joker
but to the card being added
ohh awesome, ill see if i can do that and then check back with you
i appreciate all your help! thank you so much! 😊
Change card to context.card
if you end up doing this id love to see it
No.
You would do if (context.other_card:is_suit('Diamonds') or context.new_suit == 'Diamonds')
Why would context.other_card:is_suit('Diamonds') on its own not work
Because the card hasn't changed suit yet.
there's a lot of parts with the "SEALS" key(?) (i think it's the mod key) in the function code and i dont know which parts to delete and what to replace them with
gonna prank my dad when quantum ranks get merged
Does anyone know where the check for having 0 or less hands giving you a game over is? I'm working on an effect that gives you -1 hand when setting a blind, but if you end up with 0 you don't lose
hrm
local function perform_checks(table1, op, table2, mod)
for k, v in pairs(table1) do
for kk, vv in pairs(table2) do
if op == "==" and v == vv then return true end
if op == "~=" and v ~= vv then return true end
if op == ">" and v > vv then return true end
if op == ">=" and v >= vv then return true end
if op == "<" and v < vv then return true end
if op == "<=" and v <= vv then return true end
if op == "mod" and v % vv == mod then return true end
if type(op) == "function" and op(v, vv) then return true end
end
end
return false
end
local ids_op_ref = ids_op
function ids_op(card, op, b, c)
local id = card:get_id()
if not id then return false end
local other_results = false
if ids_op_ref ~= nil then
other_results = ids_op_ref(card, op, b, c)
end
local ids = {}
if SMODS.has_enhancement(card, 'm_wild') and not card.debuff then
for k, v in pairs(SMODS.Ranks) do
table.insert(ids, v.id)
end
else
table.insert(ids, id)
end
local function alias(x)
if SMODS.has_enhancement(card, 'm_wild') and not card.debuff then return '11' end
return x
end
if other_results == true then
return true
end
if op == "mod" then
return perform_checks(ids, "mod", {b}, c)
end
if op == "==" then
local lhs = alias(id)
local rhs = alias(b)
return lhs == rhs
end
if op == "~=" then
local lhs = alias(id)
local rhs = alias(b)
return lhs ~= rhs
end
if op == ">=" then return perform_checks(ids, ">=", {b}) end
if op == "<=" then return perform_checks(ids, "<=", {b}) end
if op == ">" then return perform_checks(ids, ">", {b}) end
if op == "<" then return perform_checks(ids, "<", {b}) end
error("ids_op: unsupported op " .. tostring(op))
end
card.ability.extra.card_id = pseudorandom_element(G.playing_cards, 'seed').sort_id
hey guys
i'm currently on version 1224
i would like to inquire why config is a nil value
yes this is my own message, and my own screenshot
this is no laughing matter.
What is that line in the lovely dump?
holy shit tysm!! so i replace "mod" with my mod's filename?
this one?
No, mod is short for modulo.
ahh got it!
No, Mods/lovely/dump/functions/UI_definitions.lua
so while this joker is active, it patches all instances of the old id checks with these new ones and inserts all ranks into a wild card's rank table?
oh shoot i guess i'd also need to diable the wild card's current effect of counting as all ranks
there's no functions
i think i can actually just hook that as normal
hold on a sec
Yes, I can't fit the next(SMODS.find_card('j_modprefix_key')) checks in the message without going over the Discord message limit.
you're amazing, thank you so much 🙏
i hope i havent been a burden with all my noob questions haha
unless you mean in balatro, there is that
like the main balatro folder
the steam folder
Are you sure that is the right folder?
ah i thought i would just put those two functions in a if context.joker check in the joker's code
pretty sure
No, those go outside the joker's code, also context.joker doesn't exist.
context.joker_main** sry
if not inside the joker's code, do i put them in main.lua?
i dont know of any other place to put it
Yes.
gotcha!
No, you put the next(SMODS.find_card('j_modprefix_key')) check in every if that checks if the card is a wild card inside the ids_op function.
alright
(in joker's code) this in theory should disable the rank effect on wild cards
upon testing it doesn't. might've missed something, lemme try
No, you should be patching SMODS.has_any_suit
ack i didnt know about that, thank you
is there a way to specify which cards should be drawn next from the deck (Like a specific rank or suit)?
What is the goal?
A joker that makes the next drawn cards match the rank of at least one of the cards in the previously played hand
effect doesn't trigger on the first hand of round or if the deck doesn't have any cards that match the criteria
?
that is what i'm using, i've got that page open on the side
or, well i'm hooking it which ia different i guess
does simply hooking SMODS.has_any_suit not work?
Yes, because you need to make it so specifically wild cards don't make cards count as all suits, but other things can.
so what now?
right, but i thought that hook covered it?
No, because if a card is a wild card then it can't be any suit.
ah okay
In Game:init_game_object
[manifest] # Header for the file, this should only be here once at the beginning
version = "0.1.0"
priority = 0 # Priority for loading the file
[[patches]]
[patches.pattern]
target = 'lsp_def/utils.lua' # The file you want to patch.
pattern = '''
function SMODS.has_any_suit(card) end
''' # The line(s) you want to patch. In pattern patches it should be the whole line(s). Make sure it's unique in that file.
position = "at" # Where you want to patch it: 'before', 'after' or 'at' (this last one replaces the whole pattern)
payload = '''
if SMODS.has_enhancement(card, 'm_wild') and not card.debuff and next(SMODS.find_card('j_sxf_mr_rorschach')) then
function SMODS.has_any_suit(card) return false end
end
''' # What code you want to replace it with.
match_indent = true
how's this
i found the definition for has_any_suits in this file utils.lua
any documentation that explains how to use the patches lovely.toml file?
No, the pattern would be if k == 'm_wild' or G.P_CENTERS[k].any_suit then return true end and the payload would be if (k == 'm_wild' and not next(SMODS.find_card('j_modprefix_key'))) or G.P_CENTERS[k].any_suit then return true end
what about the target?
=[SMODS _ "src/utils.lua"]
thank you!
fsr the rank effect doesnt work with smiley face/scary face, but it does work for shoot the moon. i guess i also need to add the face catagory and not just have the specific face ranks?
@daring fern how would i go about that
Hook Card:is_face
got it.
does it matter if i do it in joker code or main.lua
i wouldve just put it in main.lua for consistency
Yes, you shouldn't hook inside of jokers.
oh! i had no idea, thanks for the tip :]
how come you shouldnt? does it cause any sort of issues?
I think they mean don't hook inside of the joker init object itself. You are free to hook inside of the files as long as they're outside of the object inits
ohh, i guess that also works! what would happen if you did it specifically inside a joker's init?
It just wouldn't work lmao
how would i change the enhancement description while this joker is active? just like changing "suit" to "rank"
You would take ownership of it's loc_vars and return key to redirect the localization to a different entry.
is there an example of that on the wiki?
i love when modded balatro crashes with no crash report
well, no
i mean
you can see the take ownership page
SMODS.Joker:take_ownership('joker', -- object key (class prefix not required)
{ -- table of properties to change from the existing object
cost = 5,
calculate = function(self, card, context)
-- more on this later
end
},
true -- silent | suppresses mod badge
)
this is for jokers
instead of SMODS.Joker it would be SMODS.Enhancement
SMODS.Enhancement:take_ownership("wild", {
loc_vars = function (self, info_queue, card)
if next(SMODS.find_card("j_MODPREFIX_JOKERKEY")) then
return { key = "m_wild_rank" }
end
end
})
and you would add an enhancement entry in the localization
m_wild_rank={
name="Wild Card",
text={
"Can be used",
"as any rank",
},
},
like that
oooh!
oh, i guess now would be a good time to port all the descriptions and names of my jokers into a proper loc file huh
i wasnt doing that up until now
like as general taboo or just actually impossible
oh what??
(deprecated meaning it won't be removed but it also isn't recommended for use and will not be worked on)
also this goes in main.lua right
yes
or wherever you've made that joker
(also remember to replace the MODPREFIX_JOKERKEY placeholder!)
how can i make the new wild card effect count towards poker hands? right now it really only works with joker effects, but the wild cards arent counted for actual poker hands (if i had 5 differently ranked wild cards, it wouldnt give me a 5oak, for example)
either a lot of manually-coded effort (check how cryptid maximized works possibly? and even then that's not exactly what you need, since it makes cards count as one extra specific rank) or waiting for the quantum ranks pull request to finally get merged (which will handle all the difficult stuff for you)
calculating how straights work with wild ranks like this in particular is kind of tricky. although entropy does have a joker that handles it with stone cards filling in gaps in straights
ahhh i guess that does seem complex
maybe i won't worry about that for now then, since wilds dont change the card's chip value with mr. rorschach in your deck
so they prob shouldnt affect poker hands either
might be confusing to players though, i'll probably add a note in the joker description
hey , are there any code to trigger joker from right to left?
is there another condition for consumables to be usable regardless of room?
because
can_use = function(self, card)
return G.consumeables and true or false
end
doesnt work
No, Maximized just hooks Card:get_id
i mean its pretty effective
it screws with poker hands
and it affects the face and number detection
plus probably more
it doesn't cover everything
though
that being said it isn't great for if you want multiple ranks
No, Card:is_face uses card.base.value not Card:get_id
why do you think i posted that lmao
i saw that those two contained self:get_id
Yes, it doesn't use Card:get_id to check for faces.
its right there bro
self:get_id
oh wait
what??
why doesn't it
lmao
ig its just the stone check
but that could be done with a simple rankless check
That's what the id > 0 does.
yeah but
theres a function for that
that get_id calls
whats the point
just use the function
bump
You mean you want your consumable to be able to be obtained without needing room?
uhh its like
this consumable creates another negative consumables regardless the room is full or not
i sold the joker that makes wild cards act as any rank instead of any suit, but they still get debuffed by the Plant
Does anyone know an effective way to override the atlases of Vanilla suits? Rather than using a deckskin, I specifically need to replace the default low contrast atlas
What does your Card:is_face hook look like?
I would assume the same way a texture pack does it
Nope
Technically so, but I had to directly edit the existing palette table/map for the vanilla suits, which doesn't seem to be currently supported with take_ownership (which just early returns if the key's already been registered)
I'm trying to use SMODS.Gradient, but something doesn't work quite right, can anyone tell why? The mod Balatro Gardens has identical use of the SMODS functionality, but when I try it it doesn't work
SMODS.Gradient {
key = "buried_treasure",
colours = {
HEX("f1f9ff"),
HEX("9ed1f2"),
HEX("b6ab95")
}
}
-- {C:CTEH_buried_treasure}
Make your key for the colour all lower case
you mean no underscore? doesn't work even like that
whaaat, is the mod prefix not case sensitive????
so it is not case sensitive in a niche scenario, otherwise is? I'd have to try
nope, never has been case sensitive
so it's always better to have it lowercase, unless I don't know about another niche scenario that would require uppercase
which I doubt there is
Nothing requires any casing requirements, in almost every situation your mod prefix will be exactly how you defined it, just for colour keys in text styling it is forced to be lower case (I don’t recall the reason why, might be some vanilla jank)
How do you check if a specific card is a Joker
if card.ability.set == 'Joker'
yeah I just found that out
this actually makes sense if you think about it
im trying to make a joker that triggers when the joker to the left triggers but I cant quite figure it out
It's context.other_card not context.other_joker
thank you
i've been trying to figure this out since last night, i cant make the seal score properly
im just trying to test right now with only the chips modifier and i cant figure it out
function(self, card, context)
hello again, been a long time since i've been there, i need help
how to i make a custom small text beside a jokers description like the screenshot (and how do i associate it with any joker) ?
no ideA
bump part 6
in the loc_vars function of a joker, add info_queue[#info_queue+1] = ...
what's in ... changes depending on what youre trying to do
for a joker itd be G.P_CENTERS.joker_key, for example info_queue[#info_queue+1] = G.P_CENTERS.j_joker
how have you been playing modded Minecraft for well over 4 days
thanks
thx
me neither
Rate the fit
gas
Hey all, I've been working on this mod; Balatro Time, for the past weekend and was hoping for some feedback.
https://github.com/KoenRB/BalatroTime
Also, if anyone knows someone willing to work on joker art, I'd gladly get some help 😛
(ofc artists will be credited)
game crashes upon opening the hand types menu, most likely coded the localization wrong:
en-us.lua:
Mahjong = "A standard Mahjong hand consisting of",
"4 sets of Pungs or Chows and a Pair.",
},
poker_hands = {
Mahjong = "Mahjong",
}```
pokerhands.lua:
```SMODS.PokerHand {
key = "Mahjong",
mult = 12,
chips = 160,
l_mult = 6,
l_chips = 60,
example = {{'S_A', true}, {'S_A', true}, {'S_2', true}, {'S_3', true}, {'S_4', true}, {'S_5', true}, {'S_6', true},
{'D_7', true}, {'D_8', true}, {'D_9', true}, {'H_5', true}, {'H_5', true}, {'H_5', true}, {'H_5', true}},
evaluate = function(parts, hand)
if not #hand ~= 14 then
return
end
if #parts._2 ~= 1 then
return
end
local pungs = #parts._3
local chows = get_chow(hand)
local chow_count = #chows
if pungs + chow_count < 4 then
return
end
end
}
...```
i'll test if it's because the game can't handle 14 items in the example array still crashes
the description should be a table
do G.jokers:emplace(card) after the create_card
k thx
you just made an obnoxious stalker joker... well done
use add_card instead of create_card and instead of emplacing
emplacing also misses add_to_deck
still crashes, updated:
["Mahjong"] = {"A standard Mahjong hand consisting of",
"4 sets of Pungs or Chows and a Pair.", }
},```
unless i'm copying the example from vanillaremodded wrong
"If the played hand is not any of the above",
"hands, only the highest ranked card scores",
},```
is it the same crash, and are you starting a new run
let me restart the run
oh yeah youre missing the prefix also
the prefix?
mod prefix
oh
[modtitle_key] then right
the id in the mod json I assume
also how do i make it immediately trigger instead of waiting for the end of the next shop
ah i'm stupid
idk
pos = { x = 2, y = 1 },
config = { max_highlighted = 2, odds = 2 },
loc_vars = function(self, info_queue, card)
local n, d = SMODS.get_probability_vars(card, 1, card.ability.odds, 'withering_chance')
return { vars = { card.ability.max_highlighted, n, d } }
end,
use = function(self, card, area, copier)
local targets = area.highlighted
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
play_sound('tarot1')
card:juice_up(0.3, 0.5)
for i = 1, #targets do
local c = targets[i]
c.debuff = true
c:juice_up(0.25, 0.3)
if SMODS.pseudorandom_probability(
card,
'geekedupplayingbalatroallday' .. i,
1,
card.ability.odds
) then
c.ability.repetitions = (c.ability.repetitions or 0) + 1
play_sound('bd_inapmit', 1, 0.7)
end
end
return true
end
}))
delay(0.6)
end
this doesnt do anything when used, am i doing it wrong
does the button just do nothing or does it do parts of the effect
does nothingw
when used
sick, lots of issues but at least that's squared away
could it be the odds?
i'm getting a crash that's saying something about "[SMODS _ "src/utils.lua"]:583: bad argument #1 to '(for generator)' (table expected, got string)" after i changed some code in tags
do i really have to make this object type this way-
bump
alternatively you can add to each of those jokers definitions this: pools = { MintCondition = true }
i see
maybe try moving odds sothat config = {max_highlighted=2, extra = {odds = 2}}, I think when applying consumables the info gets moved into extra causing a possible nil reference issue
nope
doesnt work
hmmm, no error either right? maybe if you paste the full obj I can try debugging locally for a bit
nope no error either
heres the obj
config = { max_highlighted = 2, extra = {odds = 2} },
loc_vars = function(self, info_queue, card)
local n, d = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'withering_chance')
return { vars = { card.ability.max_highlighted, n, d } }
end,
use = function(self, card, area, copier)
local targets = area.highlighted
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
play_sound('tarot1')
card:juice_up(0.3, 0.5)
for i = 1, #targets do
local c = targets[i]
c.debuff = true
c:juice_up(0.25, 0.3)
if SMODS.pseudorandom_probability(
card,
'geekedupplayingbalatroallday' .. i,
1,
card.ability.odds
) then
c.ability.repetitions = (c.ability.repetitions or 0) + 1
play_sound('bd_inapmit', 1, 0.7)
end
end
return true
end
}))
delay(0.6)
end
this starts at config, do you have the SMODS.<etc...> = function(etc...) lines too?
oh sure
thought its unnecessary
SMODS.Consumable {
atlas = "consumisprints",
key = 'hangedprint',
set = 'mistarot',
pos = { x = 2, y = 1 },
config = { max_highlighted = 2, extra = {odds = 2} },
loc_vars = function(self, info_queue, card)
local n, d = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'withering_chance')
return { vars = { card.ability.max_highlighted, n, d } }
end,
use = function(self, card, area, copier)
local targets = area.highlighted
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
play_sound('tarot1')
card:juice_up(0.3, 0.5)
for i = 1, #targets do
local c = targets[i]
c.debuff = true
c:juice_up(0.25, 0.3)
if SMODS.pseudorandom_probability(
card,
'geekedupplayingbalatroallday' .. i,
1,
card.ability.odds
) then
c.ability.repetitions = (c.ability.repetitions or 0) + 1
play_sound('bd_inapmit', 1, 0.7)
end
end
return true
end
}))
delay(0.6)
end
}
Anyone have documentation/examples for SMODS.PokerHandPart?
Using G.hand.highlighted instea of area.highlighted might be the fix, i got an error on the psuedorandom_probability func now, its at least cycling through the targets
i see
I'm trying to do some kind of fading effect on joker names (which clearly doesn't work right now but that's not the point), but if I use variables that are string concatenations, this happens: the Nth letter of each concatenated string is synched up with all other Nth letters of the rest of the strings, and if the entire string is a concatenation of singular characters, then the 'First' effect is in place (it treats them all as 'first letter')
Code: ``` name = Fade_Gradient({HEX("009CFD"),HEX("A267E4"),HEX("E8463D"),HEX("F7AF38")},'quad_dice','First',false,0) .. '{C:cteh_wild_seals}Second'..'{C:cteh_wild_seals}Third'
Here is also some video footage (all concatenation string is also weirdly spaced out :/ )
Maybe there is a way in Lua to remove this weird effect, any clues?
Even if you have the joker name be name = 'J' .. 'o' .. 'k' .. 'e' .. 'r', they would too be all synchronized, I haven't used the exact same implementation in the example (the Fade_Gradient functions kinda acts like a black box), but I think I delivered the message
bump part i forgot
I dont entirely get this but is the problem that the same gradient is always synced up?
is there a way to set the suit or rank of a card with a joker similar to how midas mask makes face cards gold
thx
No, the gradient is independent, even without any coloring the same applies, any new concatenations in a way resets the up-down movement
ah you mean the animation?
oh wait, no I'm dumb
that's normal, the game generates a new dynatext for each block
without color stuff works fine
yeah because the color generates a ui element
no real way to fix it without changing how the text is displayed
Get it to work?
the description shows nil for the suit variable and the change_base utility doesn't do anything
suit in calculate is not defined and in the description it should be #1#
forgot to mention i replaced suit in the change_base to G.GAME.current_round.wath_mod_rainbow_joker.suit
i recommend wrapping it in assert like the docs recommend if it still doesnt work
that lets you know what the error is
wrapping the change_base or the calculate?