#💻・modding-dev
1 messages · Page 470 of 1
the chips on the left would apply all the extra chips, then when the normal chip amount from the card scores, it gets rid of all the extra chips
ohh i get it now
you can't score in context.before sorry i didn't catch that beforehand lol
samplejimbos bad
I'll just replace it
i changed it to context.main_scoring and it worked
thank you
💪
winter my goat
do a hotfix update for my mod now
uhhhhh sure
all your fixes are hot dilly
oh stop it you :b
what
The texture isn't working
I'll add a description later
What's the coordinates for these
0 0 and 1 0 respectively
whats wrong with this, i dont understand (geniuenly)
can you show more?
dunno why people are afraid to screenshot the entire screen lol
code or error
code
after context.blueprint on line 100 is a then
its supossed to be a joker that gets 5 mult from every rank 2 card played
this may be pretty obvious for someone but im pretty new at this
ok yeah,
- those commas are wrong
- message = "Yeah!" won't do anything outside a return block
The "unexpected symbol" error is because of the commas, since they're not in a table declaration
i do recommend getting the vscode lua extension and reading a bit more on lua basics
does anyone know the prefix for boosters
(like how jokers are j and consumables are c)
p_ iirc
i got a very very very little bit of expirience because i modded fnf lua before
god fnf modding...
psych lua FUCKING sucks
as in 'pack' fyi
its not good
what's that
Also it took me until literally today to learn that showman's key isn't j_showman
fnf engine with lua api
j_caino vs j_ringmaster
who wins
ring_master
yea i did some work on kade and psych and they were dookie
i like heirophant
indeed
The joker doesn't work
hi something
yeah, was trying to make a joker texture pack a few days ago and i was so devastated the j_showman didnt work
@red flower The joker isn't x10
rather than a video I'd like to see the code
Do I need an entire script for the joker to trigger?
Idk how to code in lua like what do I need to do
if context.before
do xmult thing
anyone know a way to make a joker give -1 joker slots? or better yet, require 2 open joker slots?
Nevermind I think I figured it out by looking at triboulet's code
G.jokers:change_size(-1) in add_to_deck then revert it in remove_from_deck
to require 2 slots to buy it you would need to hook G.FUNCS.check_for_buy_space
and probably something else for packs im not remembering rn
do buffoon packs handle it differently?
you can't score in context.before but also you're missing an end
then what DO I use for score
what is the recommended program for coding in lua? i have vs core and sublime text atm
im assuming the one from sumneko
yes
anyone know which context I would use if I want the joker to trigger on the final hand of the round? i can't seem to find the right one lol
G.GAME.current_round.hands_left == 0
How should i make the dimensions for a joker in the code that is smaller than regular (similar to wee joker), i know how to change its pixel size(kinda) but idk how to decide what i multiply 71 and 95 with? Its dimensions is 21:26
is there something im doing wrong then? because doing SMODS.Atlas gives me an error
is it an error or a warning
i'm making a cursed op meme joker and i just want to ask
is Emult supported by talisman or do i have to code it in myself
it is supported
warning, not error mb
No, it's emult
is that fine or?
Yes.
aight
that's not a problem but if you want to get rid of it you can open the entire mod folder or add this to the folder with the appropriate paths https://github.com/WilsontheWolf/DebugPlus/blob/master/.luarc.json

and is this its own thing or do I have to do like context.G.GAME.current_round.hands_left == 0 or smth like that?
if you want it to score like a normal joker, then under calculate you do "if context.joker_main and G.GAME... etc
people seem to be getting this error in my mod, im not getting the error myself, and it sems to happen whether i wrap it in to_big or not, what could possibly be going wrong here?
You need to put to_big around both.
in the line before you're doing dollars_spent or 0 so it means it can sometimes be a number
heyy does anyone have any examples of how i can have my joker have that little section that says (active) when the criteria is met ?
It crashes with unexpected symbol near end
like luchador or are you thinking of something else?
the end below xmult should be a }
like invis probably
here's a chunk that shows how the message is formed
by section i was guessing in the description not in a message but idk
luchador
the first error of many...
attached .txt is the error, all im trying to do right now is add a placeholder joker just so i know it works
it's a syntax error
yeah because i want to make a joker that gives 2 xmult ion first hand played
i see my error
other jokers that activate on the first hand just do a little jiggle if you want to be accurate to vanilla
like dna and trading card
ohh i didnt think of that, thats a good point
but otherwise you'd have to look at loyalty card's code
anyway all of those are in vanillaremade
Isn't everything closed up?
im not too good at reading through it yet.. is it in the localization ?
you would go to the jokers.lua in src (if we're talking about vanillaremade)
it's usually in loc_vars
you're missing a comma before that line
thanks everyone ! im making good progress on my mod !
how come I keep getting this crash?
for talisman compatibility with jokerforge, will regular smods code play nice with talisman-proof code or do i need to basically generate two types of each code block depending on if talisman is wanted as a dependency or not?
You would just do to_big = to_big or function(x) return x end and it would be fine with Talisman code.
say is there a way to make it so a joker can't be sold but CAN be destroyed
or a way for it to tell in regards to remove_from_deck HOW it is being removed so i could do a workaround
Yes.
-# how so if i may ask
Hook Card:can_sell_card
but is there a smart way to handle this if i wanted the code to work with both talisman and without talisman
hmm everything looks right here so i honestly don't know
If you have that line, and you put to_big() on everything that is required it would work with and without Talisman.
thank u for your insight, its 3am where i am rn and talisman related debugging is kicking my ass
on an unrelated note
this is me just trying stuff out but how i would check for the number of cards in a hand that share a rank
pcard:get_id() == 2
hmmm alr then ty !
is that for all cards that share a rank?
No.
You would put each cards rank in a table and count the results.
enlighten me pls
local ranks = {}
for k, v in pairs(context.full_hand) do
ranks[v:get_id()] = (ranks[v:get_id()] or 0) + 1
end
so then for this, say i want to do an effect on the pair of a full house
the game would have to keep track of there being only two cards of the same rank
man my brain hurts thinking about this
crash #2
if need be, i can send my current batch of code
learning to mod i think im winning
dorito cards 
no, the game just checks if there is more than zero three of a kind and more than one pair
okay. so how would i go about destroying the two cards that are part of the pair? i think you showed me earlier but i wasn't sure exactly how to implement it
the easiest would be looping through context.scoring_hand and counting the ranks like something said and then destroying the one that has a count of 2
Hello guys, I need playtesting and feedback for my mod that optimizes the game by running score calculations in coroutine batches
https://discord.com/channels/1116389027176787968/1390156487078182922

this is the code for my mod blind, the ideia is to invert hands ands discards, but for some reason, when i enter the blind, it resets hand and discards to default
SMODS.Blind {
key = 'inversion',
atlas = 'losted_blinds',
pos = LOSTEDMOD.funcs.coordinate(3),
discovered = true,
unlocked = true,
mult = 2,
dollars = 5,
boss = { min = 1 },
boss_colour = HEX('FFD700'),
set_blind = function(self, card, from_debuff)
local hands = G.GAME.round_resets.hands_left,
local discards = G.GAME.round_resets.discards_left,
G.GAME.rounds.hands_left = discards,
G.GAME.rounds.discards_left = hands
end
}
does anyone know why?
might want to use ease_hands and ease_discards instead?
No, it's ease_hands_played
gn chat
gn pixel
nan of hearts
i kinda fw NaN ngl could be like
functions as a shortcut for straights but otherwise lacks a rank
as it stands it just puts me into -nan chips and basically makes it impossible to win 😭
G.GAME.round_resets.ease_hands ?
i figured it would do something like that as is xwx
could probably poke around and look at how the nil rank suited cards from entropy work
what is ease_hands_played ?
ease_hands_played((-G.GAME.current_round.hands_left)+G.GAME.current_round.discards_left)
ease_discards((-G.GAME.current_round.discards_left)+G.GAME.current_round.hands_left)
ease its a method or function ?
oh ok
ty
idk
is there any documentation about it or that include it on steammoded?
none that i aware of, other than the link i send
how do i use it?
bruh
sorry, im dub
ease_hands_played(number)
what does it do?
ease_hands_played adds/reduces number of hands
ease_hands_played(1) adds hand by 1
ease_hands_played(-1) reduces hand by 1
oh ok
ty
What am I missing ? The game crash when I'm launching it
Log?
text should be a table.
oh yeah 🤣
omg it was only that. I am sooooo dumb
bump
heyy im back again to ask, this question is a little weird because idk if balatro has a way to detect this but is there a way to use the amount of cards that arent scored in a joker
i want to make a joker that gives +1 xmult for every card that is played but not scored
if context.cardarea == "unscored"
woahh ur so fast omg thanks
why did it write ERROR and how can I be able to pull card ?
You need to put group_key = "Name Pack" in Localization > misc > dictionary and select_card = "consumeables" in the booster definition.
oh the temptation...
^3
^^2
but I want to be able to use or pull, is it possible ?
Yes, but it would be more difficult.
oh okay I'll see what is the best
Is there a function to get the last played poker hand or is that something I'd have to add manually
G.GAME.last_hand_played
oh
thanks
hey, you can help me ?
You have an extra end
my code is like this, but for some reason it's not even being recognized by the mod
local blindInfo = {
key = 'inversion',
pos = { x = 0, y = 19 },
atlas = 'losted_blinds',
discovered = true,
unlocked = true,
mult = 2,
dollars = 5,
boss = { min = 1 },
boss_colour = HEX('FFD700'),
config = {},
set_blind = function(self, card, from_debuff)
ease_hands_played((-G.GAME.current_round.hands_left)+G.GAME.current_round.discards_left),
ease_discards((-G.GAME.current_round.discards_left)+G.GAME.current_round.hands_left),
end
defeat = function(self, card, from_debuff)
ease_hands_played((+G.GAME.current_round.hands_left)-G.GAME.current_round.discards_left),
ease_discards((+G.GAME.current_round.discards_left)-G.GAME.current_round.hands_left),
end
}
return blindInfo
probably a syntax error, idk
You need to use SMODS.Blind
One of the ones in calculate
oh, no, im making this mod with my friend, he doing it in a way where each blind is a separate file inside the blinds folder, which is inside the items folder, and then he loads each one individually, i already made sure to put this blind in the right place, in fact, if i remove the code inside its function, it gets detected
You're missing a ,
where?
Before the defeat function.
?
No.
method to detect if joker as an effect?
exemple: if this joker is negative then...
SMODS.get_enhancements
i think
ty
i use this method to detect enhancements in the cards
Hello i'm... very new to modding, How do i make my custom seal do something when discarded?
do you have any ideia what it could be?
I have the seal, but it does nothing at the moment and doesnt have description
if context.discard
i think
mind providing code block to check if I did it right?
I should go to sleep tbh
loc_vars = function(self)
return { vars = {} }
end,
modify_hand = function(self, cards, poker_hands, text, mult, hand_chips)
local changed = false
for _, card in ipairs(cards) do
local enhancements = SMODS.get_enhancements(card)
if enhancements and next(enhancements) and not card.debuff then
card:set_ability('c_base', nil, true)
G.E_MANAGER:add_event(Event({
func = function()
card:juice_up()
return true
end
}))
changed = true
end
end
if changed then
G.GAME.blind_message = {
message = localize('k_losted_enhancements_removed'),
colour = G.C.RED
}
end
return mult, hand_chips, false
end,
this is my blind
like the joker vampire
ok, idk if this work in your instance
Here's an SMODS translation of Purple Seal that should help you out https://github.com/nh6574/VanillaRemade/blob/1b4ea069ada01eb25fd41d79e6b951960879f87f/src/seals.lua#L72
oh, this is very good
This helps a lot, thank you!
VanillaRemade is a fantastic resource and I wish I had it while I was learning (hence why I contributed to it lol)
for some reason it's not even being recognized by the mod
local blindInfo = {
key = 'inversion',
pos = { x = 0, y = 19 },
atlas = 'losted_blinds',
discovered = true,
unlocked = true,
mult = 2,
dollars = 5,
boss = { min = 1 },
boss_colour = HEX('FFD700'),
config = {},
set_blind = function(self, card, from_debuff)
ease_hands_played((-G.GAME.current_round.hands_left)+G.GAME.current_round.discards_left),
ease_discards((-G.GAME.current_round.discards_left)+G.GAME.current_round.hands_left),
end,
defeat = function(self, card, from_debuff)
ease_hands_played((+G.GAME.current_round.hands_left)-G.GAME.current_round.discards_left),
ease_discards((+G.GAME.current_round.discards_left)-G.GAME.current_round.hands_left),
end,
}
return blindInfo
anyone do have any ideia what it could be ?
vanillaremade is incrible
Why aren't you making an SMODS object???
its not because of the "local blindInfo"
@sturdy compass
read
Why are you/is your friend not just using SMODS.load_file() instead?
It's a far simpler method of loading external files
idk
he the one handling this general part of the mod, i give small help with what i can, idk much yet, actually i dont even understand how he did it, but i think its really good
Check for .edition.
It looks to me like he copied cryptid's loading method which breaks a lot of standards and should very rarely be used as a reference mod. Here's what it looks like using Steamodded's loading method
I cannot recommend switching to that more to guarantee your objects are loading properly
wow
Most of that is just debug messages too so it could be cut down by a lot
wdym, i dont understand, sorry
oh ok
I mean you should switch to this loading method because you will run into less issues with it
you or your friend
whichever
ooough is there an easy way to test my modded seal without having to wait until it shows up
Get DebugPlus
ok
i asked to my friend
THank you!
ty for advice
btw, sorry for mistakes, i dont speak english very well
but, @sturdy compass , you can help me with my blind ?
its not the loading method, since the other 3 blinds are fine, and if i remove the function from inside this blind, its load normally
With how you have it set up, I cannot help you get it recognized, hence why I gave you the suggestion of changing your loading method
but is not the loading method
currently trying to figure out how to set a seal on a card with debug plus 😭
ooh
hover tab
If you need more keybind tips just hold tab to open the menu. It has a bunch of buttons as well as keybind instructions
can you help me?
I've told you, I cannot help you with how you're attempting to load it and I doubt many others can as well
Just wondering about a thing
Like if I do like
evaluate_poker_hand(hand)["Straight"][1] for example
I think it returns a hand of cards
How do I return the scored value of one of those cards
is not the loading method bro
I'm telling you it is, trust me
my others blinds are fine
what is this then?
Where do the blinds get loaded in the code
in includes/hooks/items
its a syntax error probably
or other error in my code
This is a very unorthodox mod structure and I have no idea what you are showing me
Great if it works for you, but I cannot help
all is loaded in items
ok, sorry and ty
probably is error in my code
but ok
SMODS.destroy_cards(G.hand.highlighted)
So instead of destroying selected cards how to modify it to destry cards of a specific rank
How do i get the index of the card discarded when im using context.discard?
nvm i think i got it
nvm i dont think this is working...
nvm it DOES work
lets gooo :D
Is there a way to get the amount of cards in a specific hand
is m_mult the thing used for mult cards?
wtf why do i have a mystery card im not even on a boss blind
can someone help me out, im trying to make a joker thats almost exactly like certificate but instead of a random seal its just a random card that always has the mult enhancement, is that possible? like what would it look like?
Can someone explain to me SMODS.DrawStep? Like. When/how can it be called?
Is there anything missing in my seal implementation that might cause issues?
Just remove the enhancement part from the code
Yes, SMODS.add_card({set = "Playing Card", enhancement = "m_mult"})
I ask for use with evaluate_poker_hand(cards)[hand]
Another desperate bump
thank you !
@daring fern Is there any method to check if classes or suits are equal?
and, is there any method to check if retrigger?
You could check out the docs. I know almost nothing about it, but you can define a draw step with SMODS.DrawStep (DOCS) and define it how you want and use love.draw()
You mean ranks and suits? Also, no.
Ty! I'll look at the docs then
ye
and just ranks and just suits?
isolated
something ranks or somenthing suits
SMODS.destroy_cards(G.hand.highlighted)
So instead of destroying selected cards how to modify it to destry cards of a specific rank
example, i play the 5 kings, but suits dont equals
i can check this ?
Yes.
local pass = true
for k, v in pairs(context.full_hand) do
if not v:is_suit(context.full_hand[1].base.suit) then
pass = false
break
end
end
if pass then
-- do things
end
```?
SMODS.destroy_cards(G.hand.highlighted)
So instead of destroying selected cards how to modify it to destry cards of a specific rank
yes
for ranks, do i just use iv_ranks ?
to check if all cards have the same rank, do i just do the same thing, but replace iv_suits with iv_ranks? or is there another method?
local destroy = {}
for k, v in pairs(G.playing_cards) do
if v:get_id() == 13 then -- 11 for jack 12 for queen 13 for king 14 for ace
table.insert(destroy, v)
end
end
SMODS.destroy_cards(destroy)
i want check if all cards have the same rank and same suits
like a flush five
but, flush four, flush three, flush pair, etc
local pass = true
for k, v in pairs(context.full_hand) do
if not (v:is_suit(context.full_hand[1].base.suit) and v:get_id() == context.full_hand[1]:get_id()) then
pass = false
break
end
end
if pass then
-- do things
end
get_id for rank ?
Yes.
oh ok
really ty much
Is there any method to check if a card has been triggered before?
like, i play two queens of hearts, and on the second queen of hearts, an event occurs
bruh, ok
.
or no ?
@daring fern is it there ?
No.
is it just me or do my custom sprites have weird aliasing?
bump
how would i go about adding this to this
if context.first_hand_drawn then
local _card = SMODS.create_card { set = "Base", seal = SMODS.poll_seal({ guaranteed = true, type_key = 'vremade_certificate_seal' }), area = G.discard }
Put it after local _card =
this is supposed to make a poker hand for if you run a 6, then a 9, with a 4, then a 2, then a zero after. but it seems to just show up whenever i play 5 cards at all, what did i do wrong?
(please dont question the hand itself................)
what are you specifically asking for
there is no 0 in balatro
also
I'm trying to check if the size of the hand is a specific size
Like if there's four cards in the hand
why 69 and 420
i added one 
for

card.base.rank doesn't exist.
oh.
apparently #hand runs into UB and just returns 0 for some reason
so I'm hoping there's an alternative
so what's the alternative that... does exist?
card:get_id()
How would I go about checking if a certain modded sticker is currently on a card
if card.ability.modprefix_key
Thank you ill do this first thing tomorrow
is this for a calculate function?
i dont get it
if you can make the last hand you played with your current cards, it plays it
this gets all such possible hands of that type
but is is for a joker etc
it's a button
Is there anyway to print outputs in lua like in python
it's just a QoL thing
ooh k
i guess you need to check a variabke in G.hand or smtn
there must be a variable for thid
yea thats what i was wondering
like
evaluate_poker_hand(G.hand.cards)[G.GAME.last_hand_played] does give all the hands which are the same hand type as your last played hand
but it also includes hands above the highlight limit
so I wanted to not do that
Is there documentation on what functions and vars exist in a card instance?
print out G.hand.cards in db+
Yes display output or something else to understand the code
oh god it's all the same color
i might as well ask then
How do i get the suit of a card? And does it come as a number or string?
it should give all hands available including higher ones
i'm crashing cause im indexing nil here when selecting a 5th card while playing
this code is inside my custom poker hand
yea thats what I mean
I don't want to play like a 20 card hand tho
card:is_suit()
like this is cool and all but I want it to be a possible hand
base hand?
wdym
?
Thank you!
like just 5 xard hands?
well if it's a straight, yeah
a high card only needs to be 1 card
yea
hm,
lemme think rq
do you know what cards are im each hand
Hm, those id's stay consistent, right? Cause my 0 card has an id of 15
that's what I'm thinking of figuring out
because then I could just take the size of that array

sry
How do i ensure that get_id() alyways returns the right ID for my custom rank?
imsaid print()
dont ignore me :)
im concerned it wont always be 15 with other mods
Thanks
do you set the id manially?
I can do that? How?
😭
I'm trying to patch the set_cost() function, but I'm kinda stuck as when the function is called, anything I added seems to just get ignored, like even when I changed it to simply be an unconditional self.sell_cost = 100 to globally change all Jokers to 100 sell value to test, nothing seemed to happen. Does anyone know how to do this sorta thing correctly, because I'm lost on this one.
try putting a print in the payload? Also i think just hooking/replacing it with smods is easyer
is there a tutorial for doing that?
^4
oh cool im so very glad suit_map doesnt work with SMODS.Atlas but works with SMODS.Sprite:new WHY
how would i get a joker to detect when a blind/round is complete? i want to make a plant based mod
nvm its cause my of my mod prefix
context.end_of_round
forgot to add it to Triangles when i updated my mod to the more modern format
what
Check your lovely/dump folder, at the file you modified see if it correctly applied
If its here and it still doesnt work, theres a lil chance the function is overriden by SMODS or another mod
You'll have to use an hook if so
Bump
it does appear to be there in the dump folder, but isnt working ingame, so I guess that is the case then.
What is wrong with my translation?
Whats an UB?
I never made a rank myself but have you checked how other mods that add one does it? I know Unstable does
Like undefined behaviour
It doesn't act as you'd think it should
Didnt know this acronym ty
Try putting some prints mayhaps to see where it goes wrong?
Ofc it comes from C 😅
for more than one joker, in my code would i put key = 'joker3' ?
Not really sure what to print
hand is a table with almost 60 values I think
reason why it's not 'joker2' : followed the tutorial in the modding starter pack thread
Usually I put the key as a lowercase no special characters version of its name, Balatro does so in its code too (sometimes, looking at you Showman)
And somehow it turns into 0?
Yes
The weird thing right
Uh lemme send
local function get_all_hands()
no_hand_size_limit = evaluate_poker_hand(G.hand.cards)[G.GAME.last_hand_played]
hand_limit_accounted = {}
if no_hand_size_limit then
for _, hand in ipairs(no_hand_size_limit) do
if #hand <= G.hand.config.highlighted_limit then -- Apparently #hand doesn't work and just returns zero? Replace with something equivalent
hand_limit_accounted[#hand_limit_accounted + 1] = hand
end
end
end
return hand_limit_accounted
end
G.FUNCS.play_last_hand = function(e)
G.hand.highlighted = get_all_hands()[1]
G.FUNCS.play_cards_from_highlighted(e)
end
play_last_hand works perfectly fine
as long as get_all_hands() works
that is to say if I get rid of the hand size requirement and just return no_hand_size_limit, it's fine and works as intended
so you'd think you just take the size of that to get the card count but no
I think you're getting the wrong right results
Ill do some experiments w this when Im on pc if you dont figure this out
oki
How do i set a rank as a face card rank?
oh nvm im stupid
its litterally right there in the docs
can someone explain how i would set up code for the round counting on the invis joker, im staring at the code and it's not clicking
Look at VanillaRemade's version of it instead
i am, and it looks like hieroglyphics to my noob coder brain
Can you send a screenshot of the whole invis VR code?
it was too large to fit in one ss
im honestly impressed with the balatro dev(s) and any modders that can understand this. my brain hurts looking at it
I don't know what I did but I think it works now?
yea that works fully
that is incredibly dissatisfying
Ill explain the essential
-
In config you setup your values with the count (invis_rounds) and the total (total_rounds)
-
In calculate, when whatever condition is met (here context.end_of_round), you increment your count then check if your count is equal to the total
The rest of the block in end of round is to make the card juice up forever or show a message that goes "1/2"
behold.... Peasant Rank
so all i really need from it would be these two blocks?
this is the best thing i have added to balatro
yes
Alright so I tried hooking the set_cost function, but it seems that it still doesnt actually do anything ingame. The status text also doesnt appear. anyone know what I'm doing wrong?
okay, thank you!
That's not how it's done, this is what a hook look like
You save the func in a local
Type the function you want to hook in
do stuff it in and call the saved local func
Hiii. Does anyone know how to apply a sticker via a Joker effect?
your_card:set_perishable(true)
or set_eternal or set_rental
Okay but. What if its a modded sticker
Oh SMODS has a func for that, Card:add_sticker(sticker, bypass_check)
I suppose sticker goes modprefix_stickerkey
another one
I did this to update my config tab, hope that it's helpful
Got it. Thanks a bunch!
How would I go about creating a new card section
high contrast peasant cards
like how there's G.jokers, G.hand, G.consumeables, etc
o
JoyousSpring has a custom cardarea if you need ref too idk if it's a little too extreme knowing N's code
is it always tab_but_config?
okii
thank u
well thats goofy, where my sprite
x, y fail 
add a buffer pixel around your sprite to prevent these whacky lines
okay
also bumping this since i cant find anything anywhere
You tried using loc_vars or you need something else?
why is this marked as my mod?
Did you take ownership of something?
Nope
It only shows on blue seal cards or stone cards?
the stone card may be a modded number
oh it's actually
really easy to make a cardarea
Ah that's probably it then
Funny that can happen
i am creating a Card object with triboulet as the center. I am then modifying its values to show a custom sprite. Then i put it into a g.uit.o node to position it. I was questioning how i could make the description box show custom text (and if possible rarity text too)
What if on your card you did card:set_ability("j_triboulet") ?
i did the pixel of transparent and fixed the offset, but it's still the line
i am... honestly not sure. It would probably just set card.center.key to j_triboulet, but simce im modifying trib it shows tribs text
it's possible your sprites are 1 pixel too much on the right
So it's bleeding trough
bleeding is an interesting way of describing this
Why not create your own Triboulet joker with those modifications?
But you don't allow it in any pool and hide it from collection
since it isnt a joker. Its an ui object to show a custom card on the ui. It gets deleted adter
I'm having an hard time trying to visualize the idea 😅 What is it exactly you're trying to do? Images would help
sorry i also dont get sometimes what im saying lol
Oooh so if I understand correctly now, you want Triboulet as one of the option?
so what i want is to remove the name and description from the ui and put it into the info box of the card
Nope
i just want to modify the text description box of a Card instance
thsts all
And it has to not be permanent?
no
since the card disappears once the ui is closed
its purely for asthetics
What if you were able to detect when the card is in your fancy menu, and you made it so that if this card is in the menu, it loads a different descriptions than it usually should?
My mod is crashing my game here, it has to do with my custom poker hands but I dont know why:
SMODS.PokerHandPart {
key = "funny",
func = function(hand)
if #hand < 5 then return {} end
local required_ids = {6, 9, 4, 2, 15}
local found_ids = {}
for _, card in ipairs(hand) do
found_ids[card:get_id()] = card
end
for _, id in ipairs(required_ids) do
if not found_ids[id] then
return {}
end
end
local positions = {}
for _, global_card in ipairs(G.hand.cards) do
local gid = global_card:get_id()
if found_ids[gid] then
positions[#positions + 1] = { id = gid, index = #positions + 1 }
end
end
local last_index = -1
for _, required_id in ipairs(required_ids) do
for i, gcard in ipairs(G.hand.cards) do
if gcard:get_id() == required_id then
if i > last_index then
last_index = i
break
else
return {}
end
end
end
end
local scored_cards = {}
for _, id in ipairs(required_ids) do
table.insert(scored_cards, found_ids[id])
end
return { scored_cards }
end,
}
SMODS.PokerHandPart {
key = "roundabout",
func = function(hand)
if #hand < 5 then return {} end
local scored_cards = {}
local suits_found = {}
local count = 0
local suits = { "Hearts", "Clubs", "Diamonds", "Spades", "cfawm_Triangles" }
for _, card in ipairs(hand) do
for _, suit in ipairs(suits) do
if card:is_suit(suit) and not suits_found[suit] then
suits_found[suit] = card
count = count + 1
end
end
end
if count == 5 then
for _, card in pairs(suits_found) do
table.insert(scored_cards, card)
end
return { scored_cards }
end
return {}
end,
}
The card only appears in this menu. Nowhere else. Im making a blank card with only a center so that it shows details
Again I don't see what's the issue with make a new Joker just for that purpose
hm?
You've tried from a new run?
OOOOOOH
Hi guys, how to make that a custom deck spawns without ranks 8 thru 10?
You mean making a new joker with dynamic text/loc_vars and modifying THEM?
look at how abandoned does it
Yea, just a copy of Triboulet but that'd be more easy to modify
I saw in vanillareload and it's a custom function, i can't track it
provided both my placeholder sprite sheet and code for the placeholder seed, im still getting the line
it musnt be trib specifically since im just copying the looks of trib and copyin g them
You put your value in a config table then fiddle with it in the loc_vars function of said object

You forgot the 1px space from the top and left
what are you grying
I could also mkae loc_vars copy from the config and modify the config
That's usually how it works so yes
yippe tysm
im gonna try that once i get to my pc
still getting the line
When you do changes it's best to do it so from a new run
What's the size of your card and the values you've put in your atlas
This was just me loading into the run after it had crashed the first time
Ooh
both cards are 71x95
atlas = 'Jokers'
pos = {x = 1, y = 0}
{x = 0, y = 0} is for the rose, which works flawlessly*
-# slightly tilted to the left, but its fine in game
This is the size for the area, but usually jokers cards are 69x93
so just cut a bit off the white and try again?
Yes
First pic is the size of the card, second is the area
You can see the values at the bottom
Tbh there's so many ipairs call I can't tell just by looking which one makes you crash
One of your values called in an ipairs is nil but which one idk, try doing some debugging by putting some prints
got rid of the line, it just doesn't exist anymore.
game detects that there is a joker and i can hover over where it would be, there's just... nothing
kinda funny ngl
-# featuring tilted rose
Can you show the pos of your second joker?
here's the code block if i missed anything else,
pos value is above config
i looked inside other .lua s in other mods, thats how i saw it
yeah, both are set to 'Jokers'
Can you show both your x1 and x2 spritesheet?
And both have the same file name?
Does your two jokers have the same key?
no, i have the placeholder rose as 'rose' and the placeholder seed as it's name without the space
-# though since im not using cryptid and dont have the seed card i coulda just put seed...
Can you DM request me with a zip of the mod, I'm clueless as to what the issue is rn
Ok the issue was the x wasn't equal to 1 unlike the one shown in the screenshot for some reasons 😅
Turns out this crash is related to my 0 rank somehow??? It's still crashing...
SMODS.Rank {
key = '0',
card_key = '0',
shorthand = '0',
nominal = 1,
lc_atlas = 'cfawm_0_rank_cards',
hc_atlas = 'cfawm_0_rank_hc_cards',
next = {
'2',
'A'
},
pos = { x = 0 },
loc_txt = {
['en-us'] = {
name = '0',
text = {
"{C:chips}+#1#{} Chips",
}
},
},
suit_map = { Hearts = 0, Clubs = 1, Diamonds = 2, Spades = 3, cfawm_Triangles = 4 },
}
Does your hand work if you don't use this rank?
code removes seals and gains Xmult, but for some reason when it removes seals thier effects trigger?
Try removing the seals in context.before
so change context.joker main to context.before
No cuz you'll also need context.joker_main to give out the xmult
Btw you should return xmult not mult
deleted x by mistake it was xmult
stoped working at all
not removing seals and not gaining xmult
joker_main and before doesn't exists at the same time, they should be at the same level 😭
oh
if context.before ...
end
if context.joker_main ...
end
new stuff learned
Its actually unrelated to the custom hands entierly, I commented out my custom hands and the crash remains
It happens when I select 5 cards and one of those 5 cards is a zero rank
Btw G.playing_cards is all of your cards
Also I think some end are written improperly
yeah right
, it should be played cards not all cards lol
Add a end before context.joker_main line and remove one of the end at the same level of the last one
next usually only has one variable in it's table, maybe it's that?
Otherwise I got 0 clue I never made a rank sorry
should this be G.play or G.scoring_hand
WHY DID THIS FIX IT 😭
well guess aces cant be used with zeroes for straights
nvm
it didnt
it should work normally
depends if you want to only count scored cards of each played card
context.scoring_hand for the first and context.full_hand for second
Do you get a different crash? Also show your rank code
SMODS.Rank {
key = '0',
card_key = '0',
shorthand = '0',
nominal = 1,
face_nominal = 0.5,
lc_atlas = 'cfawm_0_rank_cards',
hc_atlas = 'cfawm_0_rank_hc_cards',
pos = { x = 0 },
loc_txt = {
['en-us'] = {
name = '0',
text = {
"{C:chips}+#1#{} Chips",
}
},
},
suit_map = { Hearts = 0, Clubs = 1, Diamonds = 2, Spades = 3, cfawm_Triangles = 4 },
}
The crash was the same exact one
(i removed next here)
Why do you have a face_nominal btw
face_nominal is usually used for face cards 😅
Seems to be an issue with whatever is Roundabout
Ah, seems now my custom hands are finally causing problems.........
SMODS.PokerHandPart {
key = "roundabout",
func = function(hand)
if #hand < 5 then return {} end
local scored_cards = {}
local suits_found = {}
local count = 0
local suits = { "Hearts", "Clubs", "Diamonds", "Spades", "cfawm_Triangles" }
for _, card in ipairs(hand) do
for _, suit in ipairs(suits) do
if card:is_suit(suit) and not suits_found[suit] then
suits_found[suit] = card
count = count + 1
end
end
end
if count == 5 then
for _, card in pairs(suits_found) do
table.insert(scored_cards, card)
end
return { scored_cards }
end
return {}
end,
}
Btw what was the next set to in your custom rank?
I just realized if you put Ace in next it has to be "Ace" not "A"
I cant tell what's wrong with it....
Does your poker hand have localization?
Yes
Like you made a PokerHandPart but have you made the PokerHand?
Yes
Ok
SMODS.PokerHand {
key = "Roundabout",
mult = 4,
chips = 35,
l_mult = 2,
l_chips = 15,
example = {
{ 'S_5', true },
{ 'cfawm_TRI_9', true },
{ 'D_8', true },
{ 'H_2', true },
{ 'C_7', true }
},
loc_txt = {
['en-us'] = {
name = 'Roundabout',
description = {
'A card from each suit'
},
}
},
evaluate = function(parts, hand)
return parts.cfawm_roundabout
end,
}
Can you go into your lovely/dump folder, click on cardarea.lua and show what's at line 192?
arent I supposed to... not do that?
The line appears to be updating hand text for the current hand you are playing
Do you have a planet card for your hand?
Could be useful to test if it's the localization that's faulty
Guess I'll go make a planet card real quick then.
Wait which one of these is for planet cards?
Looks like my game also crashes when i try to open run info so it seems translation related
Yea
how would I make a custom rarity?
oh wait
you also need planet cards for custom hand type?
thank you
Also check this out too https://github.com/nh6574/VanillaRemade/blob/main/src/rarities.lua
thank you bro
does this need my mod prefix?
config = { hand_type = 'Roundabout' },
sealkey_seal yea
Yep... might be a translation issue
By the way, should i be doing my translations with loc_txt or use a seperate file?
If you want to add multiple translation, a localization folder should be best
Okay, how does the localization folder work?
im trying to make a played seal change into another, but not working
You're trying to set a seal on G.play.cards

replace _S by context.other_card
be right back
every small amount of progress is met by a roadblock
I think I can see the issue, when you remove something from the start at index 1, the object at index 2 goes to index 1, then you move to index 2 and remove the object that was at index 3.
Try doing your thing in reverse order to avoid this issue
Im sad additions doesnt show ranks, poker hands, or suits added
new error :D
also happened upon selecting 5 cards eligable for the "Roundabout" hand
not with 0 though
SMODS.PokerHandPart {
key = "roundabout",
func = function(hand)
if #hand < 5 then return {} end
local scored_cards = {}
local suits_found = {}
local unique_count = 0
for _, card in ipairs(hand) do
local suit = card:get_suit()
if suit and not suits_found[suit] then
suits_found[suit] = card
unique_count = unique_count + 1
end
end
if unique_count == #hand then
for _, card in pairs(suits_found) do
table.insert(scored_cards, card)
end
return { scored_cards }
end
return {}
end,
}
somehow this line is getting nil
right
get suit isnt a thing
im back
just _S or the whole sentence?
Manipulating an iterable while iterating on it is prone to create problems
I'm used to it being a value and not a reference
I DONT CRASH ANYMORE 🎉
the one near set_seal
You mean an immutable?
Yes
is there a more "clean" way of getting the most played hand than
local hand_types = {
"Flush House", 'Full House', 'Flush', 'Pair',
"Straight", "High Card", "Three of a Kind", "Two Pair",
"Flush Five", "Five of a Kind", "Four of a Kind", "Straight Flush"
}
local max_played = -1
for k,v in ipairs(hand_types) do
if G.GAME.hands[v].played > max_played then
max_played = G.GAME.hands[v].played
hand_chosen = v
end
end
SMODS.smart_level_up_hand(nil, hand_chosen, false)
From paperback
function PB_UTIL.get_most_played_hands()
local hands = {}
for _, v in ipairs(G.P_CENTER_POOLS.Planet) do
if v.config and v.config.hand_type then
local hand = G.GAME.hands[v.config.hand_type]
if hand and hand.visible then
hands[#hands + 1] = {
key = v.config.hand_type,
hand = hand,
planet_key = v.key
}
end
end
end
table.sort(hands, function(a, b)
if a.hand.played ~= b.hand.played then
return a.hand.played > b.hand.played
end
-- Sort by base values if the played amount is equal
return (a.hand.s_mult * a.hand.s_chips) > (b.hand.s_mult * b.hand.s_chips)
end)
return hands
end
how to destroy card at end of the round of a specific rank using a joker
i have fugure out this much using calc_dollar_bonus = function(self, card) function to activate a command at end of the round but what would be that command
yay
I don't think you should use that for destroying a card, but I'm not sure
wait
ah gold cards don't do much useful
hmmm if it's open source, you could check what the Farmer of the Extra Credits mod does it
well, it gives money like gold cards do
it doesn't destroy anything
but for that, I assume you should go through all cards held in hand, then instead of checking for suit (like Farmer does), check for rank, and call whatever function destroys a card
SMODS.destroy_cards(G.hand.highlighted) i think by modifing this command i can do it
what rank are you trying to destroy?
instead of selected card if i give it a rank it might work
trading card:
return {
dollars = card.ability.extra.dollars,
remove = true
}
i have try it it just remove card during round which you discard
that is, within 'discard' context
random
is there aby command to select cards if soecific rank
does somebody know what these things on the backs of juggler and drunkard are??
||besides amogi||
i think the ones on juggler back are the colored sticks/bowling pins that are used in circus
ahh
as for drunkard i have no clue, maybe his sanity left him after he drank too much
ah
because I'm making the Junkie which gives +1 hand and should be similar to these two
junkie as in food junkie or somethig else?
Hey, i noticed my brown seal is returning control and drawing cards too early (most noticeable when chaining them), how do i fix this?
(For context, the brown seal discards the card to the right when it is discarded)
i finished all my jokers except for 2 and im struggling to get them going
i need help
first is this that makes a seal change into another
not working
UH!! OKAY SUDDENLY MY CODE WORKS NOW
note to self: that required putting the delays and draw card function in Events
Remove .key
Also it's just "Red"
wtf is the full key of cards that have a vanillia suit but a modded rank?
hi, if I have a sprite sheet in x2 is there an easy way to rescale it to x1?
i tried H_0 and cfawm_H_0 (cfawm is my mod prefix) and neither worked
Yes.
could you tell me what is it?
thnx
oh ya one more question ^^; why does Base work here, and why isn't it Enhanced instead?
SMODS.create_card { set = "Base", enhancement = "m_stone", area = G.discard }
what do Base and Enhanced mean?
did that, didnt work
Because it sets the enhancement after it is created.
If you want it to generate a natural enhancement I think.
cheers ^^ i'll check the source code too to make sure
oh ya you're right ^^ Base is if you don't want it to generate its own, and Enhanced is if you do
cheers!
It's Red not red
its not easy 😔 I meant it as what tool can I use to do that manualy (I have only 3 files to resize so I dont need a whole script for that)

at least I think so
You need to put context.other_card in a variable to use it in an event.
loc_ var = context.other_card?
No, local other_card = context.other_card
amazing art wow!!
this is the junkie? looks 🔥
thanks ^>^
I'm keeping all the difficult ones (which aren't just copy-paste-edit) for last :v
You look through G.P_CARDS?
i see now, the prefix for modded ranks goes here
Thank you!
I have the opposite problem (I need to scale down my sprite sheet)
oh, you made them in 142x190??
oh I figured it out ^>^
is there a way to implement exponential mult without the use of talisman?
yay Gay Jokers looks good now
yeah, bcs it looked better that way (+ it was easier)
so i wanted a joker that reads what seals are there in deck, stores them, chooses one of them randomly
and the give money based of how many of the selected seal there is
and each round seal changes
Hello. Again, how did I save data for any given card inside a run (and prevent it from resetting upon reloading the run or the game and what not)
if deck has onle 1 type of seal the joker will only choose that type
code is nowhere near done and i have no idea what to do

wowowow
Isn't there like, a literal operator built in lua for exponential?
there is
but
i'm not sure how to get the current mult
that's like my only barrier
It's just mult
is that really it?
Yes.
anyone?
sorry, I have no idea
haha yeah
code half stolen lol
cant think of how to do it
so far i made a table to save seals in
and random to selact a random seal
do you want all seals to be equal weight when selecting them
x2
yeah
Then you should compare each card to the table with the already listed seals, and if the seal is already in the table, don't add the card's seal to the table.
I don't know how well I have explained myself.
local seals = {}
for k, v in pairs(G.playing_cards) do
if v.seal then seals[v.seal] = (seals[v.seal] or 0) + 1 end
end
local _, index = pseudorandom_element(seals, "seed")
return {dollars = seals[index]}
```?
yeah that
it does this btw
as is or do i change something?

idk if there's any other way but you can save it to a cardarea
huh what
You replace everything in calculate with that.
what's the confusion
if the card is in another area already save the position or unique id
ok
I need to save the card's data in like, a separate list to later retrieve it.
I just need a place to save this list and not resetting when the game crashes or whatever.
Put its value in card.ability instead of card
What is it you're trying to save?
A whole card worth of data.
why
Let me explain the joker
whats the goal
afaik, you need to copy the joker and save it to a cardarea
Like G.jokers?
What if he saved it in G.GAME?
tried
for that you can really just save the ability of that joker and the key of its center
cards do not save unless stored in a cardarea
yeah but a new one
It says copy tho
most of everything is stored on ability anyways :V
It literally gave me a stack overflow and almost killed my puter
then don't deep copy it
You can save a whole card in a card.ability
I will try again.
Needs to copy everything, tho.
Use SMODS.shallow_copy instead
you cant save a function sadly
Like, an exact replica
I need the key and shit, abilities, and what not
if it doesn't exist in that memory location it exists in another so long as its in memory
you don't even need a shallow copy even
x3
As long as the user just sees two copies of a given card, I am content.
Including scaling values and other shit.
which you can do by just saving the ability table and bringing it back when you recreate the card
So, what do and where
card.ability.saved_ability = other.ability
card.ability.saved_key = other.config.center_key
-- later
local c = SMODS.add_card { key = card.ability.saved_key }
c.ability = card.ability.saved_ability
yeah
Let's see...
What's wrong with my planet translation? it wont show up in game, i already check Vanillia Remade
Planet = {
["cfawm_hd 189733b"] = {
name = 'HD 189733b',
text = {
"{S:0.8}({S:0.8,V:1}lvl.#1#{S:0.8}){} Level up",
"{C:attention}#2#",
"{C:mult}+#3#{} Mult and",
"{C:chips}+#4#{} chips",
},
},
},
SMODS.Consumable {
key = "hd 189733b",
set = "Planet",
cost = 3,
pos = { x = 0, y = -1 },
config = { hand_type = 'cfawm_Roundabout' },
loc_vars = function(self, info_queue, card)
return {
vars = {
G.GAME.hands[card.ability.hand_type].level,
localize(card.ability.hand_type, 'poker_hands'),
G.GAME.hands[card.ability.hand_type].l_mult,
G.GAME.hands[card.ability.hand_type].l_chips,
colours = { (G.GAME.hands[card.ability.hand_type].level == 1 and G.C.UI.TEXT_DARK or G.C.HAND_LEVELS[math.min(7, G.GAME.hands[card.ability.hand_type].level)]) }
}
}
end
}
please don't put spaces on your consumables
noted
code looks fine to me, does anything else in that same file appear?
Here's the source if you want to take a look
https://github.com/DogeisCut/BalatroCutsFirstAndWorstMod/blob/main/Cut'sFirstAndWorstMod.lua
hey y'all, is there a simple way to change on the fly the alpha/transparency of a joker?
isn't card.ability.extra a per-card field?
update = function(self, card, dt)
if card.ability.extra.delay == 60 / card.ability.extra.FPS then
card.config.center.pos.x = (card.config.center.pos.x + 1) % 40
card.ability.extra.delay = 0
else
card.ability.extra.delay = card.ability.extra.delay + 1
end
end,
oh, planet keys start with c_
Is that before or after the mod prefix?
before
card.children.center:set_sprite_pos({x=0,y=0}) iirc
next(SMODS.find_mod("modid")) checks if it's installed and loaded
(many mods have a global table you can check too)
thanks
Is the text on planet cards a specifc font or handrawn?
handdrawn
oh boy...
you can get basically all the letters from the texture atlas
gl <3
Again, is there a way to make sure the sold card is the joker itself and not any other random bs?
that works but it's context.selling_self too
Alright... this is okay for now
What's the name of the Joker? Could always use LUCKY
Balatro bluescreened my computer 🎉
I was working on a mod... I opened a celestial pack and it crashed right before it could finish opening...
Lucky 7
maybe Lucky is good too yeah
This is divine intervention to go to bed its 6 am and I haven't slept yet
I believe this means you've won the game. Rest easy, hero, the journey is over. 😛
...memory corruption, huh...
Yep! I am 99% sure my GPU is cursed.
;-; I made the image 71x90 instead of 71x95
