#💻・modding-dev
1 messages · Page 224 of 1
quantum enhancement
its an optional feature, i didnt look into how to use that though
Or you could just use in_pool
quantum enhancements don't do much for enhancement_gate, as far as I know
oh, i thought quantum enhancement is exactly for that?
or am i misunderstanding what enhancement_gate is for
Would it be better to have all my ideas in one mod or to separate them into separate mods based on theme?
Here’s what I did for this exact example (though this is for bonus or mult, not bonus and mult)
in_pool = function(self, args)
for k, v in pairs(G.playing_cards) do
if SMODS.has_enhancement(v, 'm_bonus') or SMODS.has_enhancement(v, 'm_mult') then
return true
end
end
return false
end
enhancement_gate is what limits jokers from spawning so that steel joker doesn't show up when you don't have a steel card in your deck. So quantum enhancements wouldn't matter for it, because enhancement_gate is just a string value it checks when trying to create the joker
oh it does check if one of your playing cards has that enhancement, haha
Perfect, thanks!
I do know the SMODS.OPENED_BOOSTER function. I just need to be able to grab a specific data (Unsure where) and check if its one of the four spectral packs. Anyone know how to do this?
cant believe that myself but i understood what the code means
just because i got knowledge in lua and know english
💔
dont know nothing abt the smods lua
use context.card.kind
I think my question got misunderstood. The context.card.kind gives back nil so I don't think that was it. I do want to use the SMODS function, but was curious how to grab data out of the SMODS function and use that to compare if its a spectral pack or not (Including the duplicate spectral pack or the jumbo packs)
there's no smods.opened_booster function, it's a context in calculate
can I see the code?
as far as i know at least maybe there is but you probably shouldn't use it directly
The SMODS.opened_booster does exist, and does give me the table data of the pack. Does, however, generate a very long list
oh yeah i remember that, you should still use context.card
Really? If thats the case, how can that be used to compare the opened booster pack and the required pack (In this case, all the spectral packs)
what version of smods do you have
If it hasn't been updated the past 4 days, latest
it is context.card.kind as far as I know, you could also use SMODS.OPENED_BOOSTER.kind but that should be the same thing
So, if I put context.card.kind in the print statement, when I open a spectral pack, should it return the name of the pack or the keyid or nil? Looked at a previous message about this in this cahnnel and found something related, but they were doing it for Tarot Packs
I think it returns 'Spectral'
it should return 'Arcana', 'Celestial', etc for the other ones
Its returning a nil for spectral. Unsure about the other ones. I can check the other packs really quick
They all return nil
I can quickly try SMODS.OPENED_BOOSTER.kind to see if that works
do you mean how to make the image or how to add it to the game?
image that will contain like 8 diff jokers so i will be able to get them using pos
do i have to like make it manually or smth
because making it accurate enough myself will kinda be hard
if all your images are the correct size you can use this https://www.finalparsec.com/tools/sprite_sheet_maker
Use this free tool to make a sprite sheet for your Unity game and optimize performance for your 2D game.
Unfortunately, doing that also returns nil. It may be bugged
Is there an easy way to make tags buyable and add them to shop?
Maybe Steamodded have smth for this, idk
try .config.center.kind maybe
How would I create a popup with two card areas that only accept a certain type of consumable?
Doing SMODS.OPENED_BOOSTER.config.center.kind did work. It gave me "Arcana" for the arcana pack. Thanks
yay
you will need to create the cardareas and put the cards there yourself
But how do I create a popup?
G.FUNCS.overlay_menu
bro 😭
so anyway everything gets multiplied but the base chips reset after each round i think?
What did you do? 😭
Yes
so apparently modifying a card's nominal value also changes its position in hand when sorting by rank
fascinating
it was a long windy road to get here
and i still make the dumbest mistakes sometimes
you'll get there is all im sayin
i got all the smods stuff pretty fast, the vanilla stuff is hard
digging through vanilla code and lovely dumps is the vein of my existence
bane=
?
hold on i gotta look this up
yee i dont even understand um
bane
everything
been typing it wrong my whole life bro 😭
what the fuck would vein even mean in this context
am i stupid
veins do let you exist
true
literally don't understand all that
like how in the world is that supposted to work like
💔
calculate is called in a bunch of places
a context tells you where it's called
the returns handle all the basic gameplay elements with the correct timing
do you know what called means?
no.
might wanna start there
then the problem is not smods, it's programming
dont think so
been thinking about making tutorials for this stuff
ik luau and lua
so you should know what calling a function means
that's where context comes in
calling a function is
functionname(vars here)
"calculate [the function] is called"
so that's what the game is doing, at a certain point it goes oh i gotta calculate effects and does calculate(varshere) for every card including your joker
just fyi i dont understand all that
not just the calculate
neither what G means what colour means
what card means, what context is
except for the if
💔
and local
ye
G is the game object so the thing that stores everything related to the game
so G.C.MULT is accessing mult color ?
yes
peak
G.C is a table with all the colors
yeah C is a table that defines global colors for stuff
yeah that creates jimbo
but no wonder how it works like
the first return is not updated tho
it should just be this now
return { xmult = card.ability.extra.Xmult }
yeah this whole calculate function seems very outdated
also instead of create_card it should be SMODS.create_card
usually for creating cards you would use this
so whats the diff
much easier interface basically
slide link
dont gotta write nil, nil, nil, nil, nil,
https://github.com/Steamodded/smods/wiki/Utility it's in here
yee thats also what i was wondering of
abt
or smth
my english kinda suck
why is there 4 nil's
💔
is there a globalthunk
smods.add_card would be even better here
so u can just do that in 1 line or smth
yeah add card does the emplacing for you and all that
yeah it does all 3 of those lines
Yup
peak
thank you smods very cool
So that massive block you screenshotted can actually be reduced to just a few lines
so how do u like
tell it to create um
a swashbuckler
like specify the joker u want it to add
SMODS.add_card{key = "j_swashbuckler"}
j_swashbuckler
so j is jokers that exist in game
basically you can check the game's source code to see all the vanilla joker keys
anyone got that "yipee" cat(?) gif
yes, not all of them have intuitive keys
j_ is the prefix for all joker objects
what about G.jokers
not the one im finding but im taking that
that's the CardArea for your jokers on the top of the screen
its your joker area
G.jokers is the card area where the jokers you have are placed
G.jokers.cards is a list of the cards there
there's also G.hand for your hand, G.play for played cards, G.consumeables for consumables
etc etc etc
https://github.com/Steamodded/smods/wiki the wiki has a lot of useful info like this
consumeables
if it was an ai it'd work better
sigh sorry bepis were gonna have to kill you now
😭
read all of them
try these first
god damn it
i did i like reading documentation
then if you're gonna make a joker read SMODS.Joker
aha but i also like reading code
:3
:3
i think card.ability.edition
its always been crazy
welcome to balatro community
thats another question
we are a bit silly
what card is in calculate function
card is your card
its card.edition.key i thiink
e_ + edition name
yeah and edition key would be e_foil for example
all the vanilla keys are here
weee
ive seen worse :3
every time i see vanilla code and im about to go insane i remember the vvvvvv switch case of doom
and i remember things aren't that bad
i love switch cases i wish we had them
💀
damn
also there's no continue...
yeah i saw smods using goto jumps
i have never in my life used continue
my automaticColoring function uses it
:>
i mean continue is like break but the opposite
i think it's ugly
seems useful
:(
that's an entirely different face
it kinda makes you have to sell your jokers if they're too strong but it's easy to play around so i think it's fine
the table is not indexed
For the events, are the variables given to it set when the event is created and queued, or when it runs?
i always wondered that but never tested it
I'm trying to change the rank and suit based on cards order, it does change them but only after the hand scores instead. How do i fix this? (this is an enhancement)
I'm working on my abduction system, and I'm getting some strange behaviour that I think is event related, but I'm not sure yet and if someone here knew, it'd be quicker than testing it 😛
abduction
naming it that is a marketing strategy, so that I can make a reddit post about my mod adding alien abduction to Balatro
i like the counter
It's been my nemesis since I came up with it, I'm not any closer to figuring out how to do UI stuff 😛
you should try copying my xyz material box but changing the box for a Sprite
debugging
But because it's a mechanic that is relevant over the entire ante, I want the number to be more obvious. Abductions take cards when triggered, and return them to where they came from after defeating the boss blind. So it's good to be able to see a number that reminds you that you're probably gonna get those cards back
Only thing I still have to decide is whether selling/destroying a card that is currently abducting cards will return the abducted materials or just destroy them, because either it makes selling cards to do deck fixing an unintended option, or you can sell certain jokers to cheat joker slots
I'll have a look. I messed around a lot with the jokerdisplay code, but that's a bit too large a tapestry for me to figure out what parts did what haha
yeah, that one is kinda complicated because I didn't want to patch stuff
the xyz material stuff i stole from cartomancer :3
im gonna be completely honest
i forgot how my code works
:3
im wondering how i made the whole "add thing to config and it auto works" 😭
Haha, it's thievery all the way done
Hi guys! I've decided to start simple with some custom suits & ranks.
why is there a repeater there
ghhhh
big
how tf does my code work
😭
from what im looking at, it shouldnt even work at all but it does
how???
what are you trying to do
soo uhh all of my jokers have functions which read those parts
and like, add them to this table
its straightforward, but the thing is that the table is not even doing anything
its just there
its not added in here
but for some reason, it still works
huh???
I think it sets the value when the event is created
How can i change something like weight for an edition locally for the challenge?
I know that i can use take_ownership but it works globally
idk about the weight part but you can use a custom rule to check if you need to modify the weights or not
hold on im in the middle of making this bullshit function but now im thinking wait wouldnt it make sense if theres some function that i dont6 know of that does this for me while also taking modded hands into account
hmm, okay, this turns out to be more complex than I was hoping. If I want the visuals for the abduction to happen only after scoring, I'd use an event, but using that event, I'm not sure which card area the card will be in, because it may change due a card changing card area 🤔
If I don't do it in an event, I get the intended effect, but the card's visually no longer present during scoring, which I also don't want to happen
can't you just use card.area
Each planet cards usually have their hand_type mentioned in their config
For modded planets it might be different
Can't you hands[planet_key]
fair, however i need to do the reverse, get the planet from the hand name
Check if a config and hand_type exists
Then get the name/key of it
And also check if the set is a Planet ofc
In case a joker uses hand_type
I thought I could, but if I call card.area:remove_card() inside the event, the card will not be removed from that area if it was a card that was scored. I think it's because the event will have checked its card area on creation, but the card's area will change to discard after scoring, even if it's not visually there
I guess I should check out how the timing on the destroy context works, that's also not synched with the visuals
Why doesn't this change the rank/suit before scoring hand of the card? (this is for an enhancement)
What am I doing wrong?
take out the ()
I'd have to test the exact details, but I think the way scoring works makes it so any changes to the cards aren't noticed at all. You can remove cards before scoring, and they will still score, as well
thx so much
How can I apply take_ownership only to challenge?
Why is spriting the hardest part of making cards...
what we think
my problem with that is that i cannot see where i can set suit
it does it correctly with a joker for me so it might be an enhancement thing
does it enter the first if?
15 LEVELS
these are meant to be like hella powerful lol
and how does it function?
i always search for that but i cannot find a proper explaination
it's a vanilla func so not the friendliest interface
basically create_playing_card({front, center}, area to place, nil, nil, {color})
i havent used it a lot but that's kinda how it works
i hate those random nils
I got it working somewhat, now just the hand thats being played isn't always updating (just the text the numbers are updating)
and what are front and center for?
G.round_eval:add_child(
{
n = G.UIT.R,
nodes = {
{ n = G.UIT.T, config = { text = "Next Ante:", colour = G.C.WHITE, scale = 0.5 } },
{ n = G.UIT.C, config = { id = "next_ante_preview" } }
}
},
G.round_eval:get_UIE_by_ID("eval_bottom"))
why are these two nodes rendered side-by-side instead of on top of each other?
front is the rank & suit
center is the enhancement or just base if it's unenhanced
and what is color for then?
i think that's for the materialize animation
how do i make my own collab? like, i found this, added minecraft and duplicated among us textures with the name collab_MC. but it doesnt show up in-game
for example spectral cards that create new cards use {G.C.SECONDARY_SET.Spectral}
while writing this added the missing C in collab_M, but that did nothing
ok. I assume its also possible to add red seals?
(also how do i choose a random rank)
you can add a red seal after creating the card with set_seal
think i can explain things better with a screenshot
How can i set the base of a card to be suitless/rankless?
you need an enhancement for that
Well, it is an enhancement, but I want it to have suits/ranks sometimes.
aaaand how do i use it? i dont understand anything whats written there
okay so lookup_string is a string thats formatted like suit_rank, suit being the initial of the suit (so H for Hearts) and rank being a number from 2 to 9, T for ten, J for Jack, Q for Queen, K for King and A for ace
so ace of hearts would be H_A
here's an example https://github.com/Steamodded/examples/tree/master/Mods/DeckSkinTemplate
enh is an enhancement, you can use poll_enhancement or if you don't want any enhancements just replace it with 'm_base' for an unenhanced card
then like i said you can add a seal and/or edition afterwards with set_seal and set_edition
... it works only on the steam version, doesnt it...
yes
yeah
oh so thats the problem
trying to get localization working but its throwing a hissy fit
its specifically these bits that mess it up and i cant figure out why
k_celestial_pack="Celestial Pack",
k_planet="Planet",
k_planet_comet="Comet",
k_planet_moon="Moon",
k_planet_unknown="???",
k_planet_q="Planet?",
},
labels={
planet="Planet",
},```
ive tried putting them both in individually and they ruin it then too
You have them in a row node
okay so if i want to upgrade the current most played hand by like 10 levels
uh how do i do that
my brain is kinda soupy rn
like that?
replacing G.UIT.R with G.UIT.C has no effect
that astronaut joker code (for increasing hand lvl) + obelisk (check what hand is played the most)
suit .. '_' .. rank
:3
i would reccomend using SMODS.change_base
You then need to wrap your text node in its own row node and change the column node to a row too
Return level_up = X and level_up_hand = whatever hand it is
and... the rest? Sorry for asking so much
suit should be just D, H, S or C
also to choose a random one do pseudorandom_element({put all options here}, seed)
wrong order
to get a random rank and get the card key for indexing into G.P_CARDS, pseudorandom_element(SMODS.Ranks, 'some_seed').card_key
that kinda works but now its misaligned
this is what ive got rn
G.round_eval:add_child(
{
n = G.UIT.R,
config = { align = "cm" },
nodes = {
{ n = G.UIT.R, config = { align = "cm" }, nodes = { { n = G.UIT.T, config = { text = "Next Ante:", colour = G.C.WHITE, scale = 0.5 } } } },
{ n = G.UIT.C, config = { id = "next_ante_preview" } },
}
},
G.round_eval:get_UIE_by_ID("eval_bottom"))
mixed rows and columns at the same level behave weirdly i think
would this work in use() rather than calculate()
like that?
(gosh i wished i could look into that more myself like i can with java)
i'm very new with consumables
not directly
:<
do i have to like set a flag on use and then handle it in calculate
vertex shader fried my peanut brain
replace the seeds with actual unique strings
change L6W.C.secondary to an actual color, that doesn't magically exist in your mod
m_base should be c_base
and setting a seal doesn't work like that
wrapping the column in its own row changes nothing
balatro ui code is so spaghetti
card:set_seal('Red')
you helped me way more than i could do myself, be proud 😄
do listen to mr john smods tho they know way more than i do
john smods you beautiful man can you help me with my localization file
like that?
(dont know seed generators D:
Is there a way to add symbols into descriptions?
wdym
you can try pseudoseed('yourseedhere')
I'm trying to have the card message be "🍒🍒🍒"
got another misbehaving ui element here
G.round_eval:add_child(
{
n = G.UIT.C,
nodes = {
{ n = G.UIT.O, config = { object = blind_sprite } },
{
n = G.UIT.R,
config = { align = "cl" },
nodes = {
{ n = G.UIT.T, config = { text = number_format(blind_amt), colour = G.C.RED, score_number_scale(0.5, blind_amt) } },
}
},
}
},
G.round_eval:get_UIE_by_ID("next_ante_preview"))
the text node doesn't appear at all
yeah but for that i need a seed in the first place D:
look at bunco for custom fonts
can just be any string of your choice
just any text string is fine
no seed generator, just a string will do (like 'some_seed' which I put as a placeholder)
wait wat
the game itself handles randomness with the global seed
e5 and e5 look so good until you realize its just x1.25 because all gains from the joker is halved :3
it's turned into a seed internally based on the game seed
lol
the string effectively creates different randomness pools
I ment "WHY THE HELL HAS YOUR JOKER MULTIPLE PAGES OF EXPLAINATION" but ok

Question: Which 0.5 and which 1 do you like more?
top left and top right
Top row is from my old D&DG designs and Bottom are more based on K6T's
top left by a mile
not sure abt the 1 tbh
top right feels empty
but bottom right uses a completely different “1” than 10
Problem with the 1 from 10 is that it's squashed
I'd have to make it 3 pixels wide
idk, looks weird
ok, then another thing:
key = "Vegetables",
primary_colour = G.C.GREEN,
secondary_colour = G.C.RED,
loc_txt = {
name = 'Vegetables', -- used on card type badges
collection = 'Vegetables', -- label for the button to access the collection
undiscovered = { -- description for undiscovered cards in the collection
name = 'Vegetables',
text = { "A card that contains healthy food" },
},
},
shop_rate = 1,
cards = {
["j_lilith_apple"] = true,
}
}```
Dont ask, i just want this thing to work at all
something particually wrong here?
theres a missing scale = here 🤦
btw if you start the block with ```lua, it adds pretty colors 🤩
use pools on your object center instead
does this concept suit look okay?
also not code but apple is not a vegetable
hi, this code broke sometime because of a steammodded update i think?
its just supposed to change the rank of the card to an Ace
cannot think of a recent smods update that would break that
i will probably just call it food later
anyway, i got this error here:
weird
please send the actual error
this is section of the traceback
please explain deeper, i cannot see something that i recognise as a object center
Do Cardarea:emplace and cardarea:remove not work when they're called inside of an event?
Hello! Is there a reason the value shows up as nil? I'm trying to remake a joker similar to egg. Thank you in advance :3
the loc_text doesn't grab the values that are stored in config, but those returned by loc_vars!
oh!
im pretty sure they do
so I'd need to add a loc_vars?
I don't see a reason for them not to work, yeah, but I guess it's an issue due to the sequencing then. If I call them in an event, the playing card's cardarea doesn't change, for some reason
yeah mine are jokers and consumables so they shouldn't change location
*goes afk for half an hour
Gave me an idea for effect
<@&1133519078540185692> I dunno who else to ping to get rid of

Thank you my Egg Friend
Thank you, moderation
$#1#
Loses $0.10 - $1 at end of round
Destroys once at $0
For some flavor text you could replace $ with ETH and it works the exact same
Because at worst you have it for 3 rounds
I'll keep that in mind! I'm planning to just make an "evil egg" for this one but this seems like a much more logical idea
I guess I'll poke Eremel or Aure when they're around, see if they can help me
I enjoy this idea. Especially the ETH flavor text. Thank you for sharing
Meanwhile I'm strugling with bugfixing my mod. Stuff like Sigil and all that are crashing
But instead of doing the bugfixing, I'm just making another branch of my mod to work on the next update lol
what's the code to make something never have rental tags?
Everything in the text works well but it doesn't seem to change value at the end of the round. I copied this from the egg jokers data so it should be adding 3 right now (which it is not doing)
thank you in advance :3
change self to card
nothing seems to have changed as nothing happened ingame
could it be a formatting issue? like with commas and everything
How would i create a button that opens a popup?
change it in self:set_cost() too
oh! i had skipped over that
ui code is hell
proceed at your own risk
but also idk
this just says im calling change_base with invalid arguments?
at least something's loaded in 🥲
suit isnt doing anything there, i was just testing
what object is this in?
once more, nothing has happened upon completing a round. I'm lost since this is my second day using lua at all
hi chat
i guess thats really the only relevant part
```if context.before and next(context.poker_hands['High Card'])
and G.GAME.current_round.hands_played == 0 then
card:juice_up(0.5, 0.5)
play_sound('card1')
suit = card.base.suit
SMODS.change_base(card,nil,'Ace')
end```
how do you make cards shuffle again?
im trying to crossreference default game code but
no dice
it says shuffle is a nil value
shuffle like amber acorn or shuffle like at the start of a blind
G.hand:shuffle

thats just how the game is
dang
works against the wheel too
For the path for textures can you have it so its stored in a sub folder in the 2x folder
Like path = "subfolder\texture.png"? or does it have to be in the root of the 2x folder?
Don't know about balance but I know I'd enjoy it
if it hits a face card/if you have pareidolia thats an x4 with photo
and then theres chad...
also keep in mind that cards get turned face up when played
yeah
i added a check for that to make it work
turns out you can inject variables into cards
ok so
not so simple question
how hard is it to make custom rules for a challenge
not that bad
ok i am standing on a hose, what exactly do you want to say to me?
the thing you showed me is a joker, not an objectgroup
you set that on the joker you want to be in the objectgroup
when do you add it, I'm about to make a similar effect so it will be good to know
I'm setting rental_compat = false, but it's still showing up with a rental tag.
Anyone up to help?
follow up question: how do i make custom rules for a challenge
#1301750185486975018 has a decent example
ah, my bad, this should be a consumabletype, not just an objecttype
P.s yay my game doesnt crash anymore
i need this asap
My counter question is what are you trying to do with the rule?
all jokers are rental compatible (i.e. you can't specify that without adding the capability yourself)
they are hugging each other
very wholsome
quick question, i had made a booster pack earlier and noticed that since i had only one valid content for it, the rest would be jokers, i tried using the in_pool function as i read somewhere that causes duplicates to be valid, but i still get mostly jokers
in_pool = function(self, args)
return true, {allow_duplicates = true}
end
did i screw up there somehow perhaps?
maybe needs more padding?
in_pool is for the booster itself iirc not the cards inside it
right
wait, makes sense actually :o
well, then ill quickly send in my create_card code since thats likely where something could be off
create_card = function(self, card, i)
return {set = 'TagSet', area = G.pack_cards, skip_materialize = true, soulable = false, key_append = "tagpack", edition = {negative = true}}
end
i honestly dont know in detail what i did, i mostly took a look at certain other mods and the docs for answers ._.
sometimes i hate discord formatting
N, do you know if object nodes can have child nodes? I'm trying to stack the text onto the sprite for the display
use ```
they should be able to yeah
will do, one sec
ah, i bet it's a syntax error somewhere then
How can I check for when specific tarot cards are being used?
just 60 chips for allat is crazy 😭
context.consumeable.config.key == 'c_death'
context.consumeable
all cards are drawn face down
as in all playing cards
thats barely a custom rule
that should be an easy one
feels fairly balanced to me
Is it possible to make it so the text box for the collab sets wider to fit more text?
probably
it can literally end your run
anything is possible if you're insane enough
id rather use like 4 planet cards than risking my run 😭
the benefits are really marginal when you consider that some boss blinds can potentially put your run to an end
also makes Boss Tag totally useless
btw where in the source code are vouchers stored
For DeckSkin what is the suit_icon used for in-game?
Bit confused where it is used
custom suit progress :)
No way, we are getting the rock paper scissors deck
rock looks angry
ace has an eye in the middle
hey peeps anyone can help me turn my textures into a texture pack?
#1318248620125851749 for more stuff on it
how do i make cards be drawn flipped?
this... seems too easy, where is the error?
Like as a boss blind?
Ironically someone suggested not as a suit but technically a rank with that
Because there's this deck
Instead of Jack Queen King it's Man, Woman, Ace
That's fun. I'm just doing my own thing tbh
ik, just a fun thing i wanted to mention
https://gyazo.com/91eb2195a4c20020544910623ad7a289 might have fucked up smt :3 (audio warning)
I’d take a look at how blinds do it and then hook into whatever code handles it and check for your rule
whats ace then
||boy, girl, nil||
Ace is Ace
lol
J -> ♂️
Q -> ♀️
K -> 🇦
A -> ❓
do NOT dereference my gender
it won't go well
I will not dereference your gender lol
...🔟♂️♀️🇦2️⃣...
oh so this is a deck with only 12 ranks
mhm
Shinku's Card Binder is all about the weird and unique like that
6 suit decks, 12 suit decks, New Ranks, Odd Ranks, Ports, UNO
MF UNO
LUIGI'S PICTURE POKER
got it working! Kinda want it to be further up in the right corner, but no clue how to do that
There's a pseudo random generator in balatro
so how would i put that into my code?
pseudorandom()
ok
There you go, what ice said basically
so i put that into the extra?
No, you want to put that in your calculate function. It does take parameters though, but you could control-f your lovely dump and see how it's implemented in smods
that's very dependent on what your joker does
i hate myself for asking again, but i have to:
if you wanted to not use the balatro psuedorandom, idk if this works but you could try math.random(15), since that's a basic thing in Lua with the mathmatical library
how do i detect when my joker has been sold?
I recommend you check your dump for how misprint does it, PEAK
okay
there's a context for that, which allows you to check if the sold joker is the joker triggered as well
trying to find misprint code rn
I couldn't get that to work i did make this work👍
misprint has a min_mult and a max_mult, which it passes on to pseudorandom so that the randomly generated number is a whole number between those two
okay
thanks
so i put the min and max into config?
than the pseudorandom into calculate?
do you know what the config does?
can someone say me what string i have to transform?
you'll have to send the code that causes the crash
Judging from the error, though, you're probably just dealing with a syntax error in your localization
myfirstjoker's text isn't bracketed
I'm assuming you have that same syntax mistake happening at more places
I'm not sure how you've programmed the vegetable object, but I haven't encountered descriptions contained within a loc_txt element yet
ah, found it
👍👍 it was .config.center.key i forgot the center
how do you keep the xyz ui updated? I see you create it on summon effect, but that would mean it disappears after you exit and restart the run, right?
capitalization error
i wish the Environment would tell me that before i start the game😭
yeah all the xyz jokers recreate it in update
im thinking about making that a bit more modular
aah, that makes sense
I couldn't find a way to render the text atop the sprite as a child node, btw, so it's just two separate roots that get stacked 😛 I haaate UI 😄
I had a really dumb idea cuz it's too complex but I kinda wanna do it, since it slots in really well into the features I already have planned.
I guess I can always save it for later
if it works 🔥
Now to the next step, which is going back two steps and trying to figure out how to fucking get this abduction effect to work, haha
maybe you can save the areas in G but name them after the card
like G.kino_abduction_[j_key]_[unique_id]_area
For those curious, it'd be resource farming. Since there's potion brewing, I felt it would slot in really nicely. It'd be a bit complex, so I'm gonna save it for later but.
then you save the name of the area in the card

key = "pink_seal",
badge_colour = HEX("f598ed"),
sound = { sound = 'red_seal', per = 2.0, vol = 0.4 },
calculate = function (self, card, context)
if context.main_scoring then
SMODS.create_card({
"food"})
end
end
}```
is something wrong with this?
set = "food" (if you made a set called that)
thats weird, a few minutes ago Visual studio said that was an error?
anyway, i give it a try
wasnt sufficient
name = "Pink Seal",
label = {"Whenever this card gets resolved, generate a Food Consumable"}
}```
tried to change label, to text, didnt help either
sigh
Is there a way to make any card rankless/suitless, also is there a way to make any card score? (without modifiers like seals or enhancements)
check out splash's code maybe
for rankless/suitless i'm assuming it would work like stone?
because stones still have an underlying rank and suit
Hi, can anyone help with an error I’m getting. My game was working with mods yesterday but when I added talisman and Maximus, Maximus wouldn’t even open on the steamodded version I had so I got a newer version and now the game opens but everytime I click a card, it crashes
You can add the relevant properties to any card
Idk code so idk what I’m doing but when I click a card it crashes and says it’s in functions/common_events.lua:566 attempt to index a number value
What are you trying to do?
im trying to make it so that all cards are drawn flipped
So I just added a few mods and I’m just trying to play a run but if I click a single card, it immediately crashes
For a blind or just generally?
How would i create a button that opens up a popup
I tried G.draw_card and Card:draw_card but it's not either one
I don’t remember exactly what it is but you could search for the calculate context call that has first_hand_drawn in
you make a function in G.FUNCS that opens an overlay menu and you pass it to the button parameter of your button
you can check the graveyard in my mod if you want reference
yeah but i dont want just the first hand
soo what is wrong with this single line of code ?
SMODS.add_card(set = 'Joker', area = G.jokers, key = j_swashbuckler)
💔
i want every hand
I mean to find what the function is called
the argument has to be a table, so wrap everything inside the parentheses in {}
ohh {} not ()
holy mistake
ty man
but theres other problem, it spwans random joker instead of swash
even worse, it also spawns random tarot
💔
They need to be strings
key has to be in quotes
they ?
the key
if context.hand_drawn then
for _, card in ipairs(G.hand.cards) do
if card.facing ~= "back" then
card:flip()
end
end
end
this is what I use
technically they don't come out flipped but they flip themselves in your hand
see thats what i dont want
i dont want them to flip in hand
i want them to come already flipped
Then you have something else spawning the tarot
i dont think so
local drawcardlocal = draw_card
function draw_card(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
drawcardlocal(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
if G.GAME.modifiers.cherrysmod_allflipped and card.facing == "front" then
card:flip()
end
end
this is what i have so far and it crashes whenever a card attempts to be drawn. any glaring obvious issues or?
tarot isn't mentioned anywhere
it says all values are nil
what's the log
Pls just return xmult =
Which mod
Joker display or joyous spring?
joyousspring
the button is defined here https://github.com/nh6574/JoyousSpring/blob/ac45ce313d0da2f8870e17d878c553508cc794ab/src/general_ui.lua#L482
so card.always_scores = true should work?
Yeah, how do i use the grave yard? is it open from the start?
You can also use the new context thet modifies the scoring hand depending on what you’re trying to do
What context?
modify_scoring_hand
I’ve not added it to docs yet though so you’d have to dive into the code to see how to use it properly
@red flower any ideas?
I think it's just returning add_to_hand = true adds it and remove_from_hand = true removes it
no, sorry
I'm literally making that effect later today tho
I just don't have the code in hand rn
If i c & p the code for the button, will it work?
Or do i need the ui too
Like the Popup
a minimal version should work if you delete the create tabs here
oh but if you mean if the button will appear then yes
hiya! question
i've written this ability:
If played hand contains a Straight, gains +1 Mult for each unique scoring suit (Currently +0 Mult)
i'm able to write the ability by making a table of all the unique suits in the straight, as it's scored
but how do i handle Wild cards?
wild cards count as any and all suits all at once
actually no
Because you’re checking if a specified card is being drawn
they can be used as any suit, but for any one joker, it can only be used as that suit
for multiple, they can have different perspectives
The game doesn’t normally draw a specific card
iirc. Flower Pot wouldn't allow a Spade, Club, Wild hand
the way these work is that it counts non-wilds first, then wilds
hi john 
for wilds, flower pot counts them as the first suit it can find that hasn't been accounted for yet
hi 
john i need ur help for a second
thanks ^^
wasup
im having issues
am i even hooking the right func
I don’t think you can do this with a hook either
I think you need to patch draw card instead
It’s called patching
taking the moment to push this since it's a new day
how would i format it? i looked at the tarots but i think that's just for playing cards. i looked at amber acorn since it flips jokers, how would i format that for k, v flip function to make mine flip?
I need help understanding ui and stuff
You need an event that flips cards, then an event that does whatever you’re doing to them, then an event that flips them again
is the amber acorn one the right idea? or would the tarot thing be better
(example: death)
I don’t know what you’re trying to achieve other than you said flipping cards sounded hard
realized i should also post the different ones
i just want the joker to do the flip/unflip anim so it'll mask the change of it into another joker
You don’t need any loop then
Eremel, outside of events, is there a way to get played cards to not yet update their visuals, before the scoring code happens? I've been trying to get my functionality of moving a scored playing card to a temporary out-of-play card area, but either the card's visually gone during scoring, or isn't properly moved if I use an event to do it
something like this i think
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
card:flip()
return true
end,
}))
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
card:set_ability(G.P_CENTERS[other_key])
play_sound("card1")
card:juice_up(0.3, 0.3)
return true
end,
}))
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
card:flip()
return true
end,
}))
maybe change the delays
that lowkey makes sense
good lord
give me a second to comprehend
i hope the formatting is fine because im on mobile :3
terrifyinh
Sounds like your event is mistimed
Ah, I guess that makes sense. I'll read up on the timings then
alright so from what im reading
the first event flips the card to face down
the second event changes the card BUT also plays the sound cause yeah i mean itd be awkward
third event just unflips it
did i miss anything
yeah thats correct
i had an effect like that and i did that
but then i removed the flipping
Yeah, no
A hook doesn't seem to work
If I put the edited value before, it gets overwritten
ok let me do that rq
If I put it after, the card has already been drawn and so it's too late
I'm gonna have to learn what the hell a patch is
patches are not that hard but they seem intimidating
what does a patch do exactly
it adds stuff in the middle of the code
now i DO notice it uses card, does that mean this is still going in the joker_main context? or does the event manager just use card
that was my first guess
and how do i make one
:(
oh this is in a separate function i made, just replace card with whatever your card is
I've currently set it up like this (I know delay doesn't matter for an immediate trigger, but it's there for swapping around), but no timing seems to successfully remove the playing card from the card area, and it just gets placed into G.deck after the hand is played, instead of my custom cardarea. If I remove the event, it does work, though it's visually jarring because the card's not visible, ofc
uhhh check the lovely github for documentation
you can use mine for reference https://github.com/nh6574/JoyousSpring/tree/main/lovely
like the joker's id?
i mean i was using your generate_ui before
which still does the self, card, yadayada setup
you could try using draw_card instead perhaps
why is the patch file .toml instead of .lua?
because it's not a lua file 🙂
lovely uses .toml files
oh i see
also seems to not work.
Yeah, I'll take a look at that, then. My other idea was to make being abducted a function of the card, see if it then does move properly
okay, looking at Flower Pot's code didn't yield a lot
the way i'd like to run this involves checking each card as they score, then displaying a message if it's a new suit
hmm wait no, maybe not
i could do it before everything
which would make Wilds easier to implement
how do i get all of the suits that are in the game?
i know some mods add suits to the game
cooking or cooked
okay so
i added lovely/challenges.toml to my mod
do i have to do anything else for the game to recognize it or?
as long as in the lovely folder then it should workd
the key in P_CENTERS needs to be in quotes
This case usage does not appear to be working G.hand.highlighted[i].always_scores = true
[manifest]
version = "0.0.~1"
dump_lua = true
priority = 0
# Challenge stuff
[[patches]]
[patches.regex]
target = "functions/common_events.lua"
pattern = '''
if pseudorandom(pseudoseed('flipped_card')) < 1/G.GAME.modifiers.flipped_cards then
stay_flipped = true
end
'''
position = 'after'
match_indent = true
payload = '''
elseif G.GAME.modifiers.cherrysmod_allflipped and to == G.hand then
stay_flipped = true
'''
is this correct?
not sure if the patch will work but you're putting an elseif after an end
in globals.lua
you can use another color
okay so the patch isnt doing anything
Oh, how would i change the text?
im trying to reference the default balatro folder
how's it looking
What do you want to do?
lovely/dump/functions/common_events.lua?
Anybody know how I can instantly win/lose a run? Using SMODS
you're referencing a lot of "jot_" things that are exclusive to my mod, replace those
before the return
i want to draw hatsune miko sideway but it doesn't look good because 95x71 isn't enough space
With what? Dont i need to predefine that?
yes
ty
omg toma
omg
your own functions
Would this work?
that's losing
you need to define G.FUNCS.mything_is
Thank you! And winning?
(bump)
Wait, where did you define the graveyard button
alr moment of truth
in the same place as the extra deck one
ok it works i just gotta force the game to save so you
or you mean the function? that's in the other link i sent you
I mean joy_open_graveyard
yeah that's in the first link i sent you earlier
still nothin
try doing a single line in the pattern and replacing "regex" for pattern
my challenge patches just happened to be regex which are a bit harder to write
oh wait
remember that thing you told me
where u said that i was putting an elseif after an end
that was intentional
that would crash the game
no because the if statement im targeting is inside another if statement
oh ok
i would try patching a single line first to see if you can get it working
i mean i think the crash is obvious
Would this work
no, the problem is that JoyousSpring is a table from my mod
just put everything inside the create_overlay_graveyard inside joy_open_graveyard
[[patches]]
[patches.regex]
target = "functions/common_events.lua"
pattern = "function draw_card(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)"
position = 'after'
match_indent = true
payload = '''
print "hello world!"
'''```
this should work right
oh is that what you meant by target lol
take out the lovely/dump then
😭
😭 how do i make game force save when i select card

