#💻・modding-dev
1 messages · Page 284 of 1
the text box updates to display the correct number rn, but only when the joker is scored
so i dont think changing my config is gonna help because it doesnt change when the variable value is calculated
Oh so you have your ace tally in calculate?
yes
i wonder what would happen if i just
made it calculate that variable regardless of context
the problem is the last time i made something happen regardless of context it lagged the game a little
Maybe add a wait = 1 or something if it lags
yes
Keep the decription updated
of that
count the aces in the loc_vars function
oooh i can do that?
my way is currently working but if thats better ill do it
this joker counts face cards, but the logic should be the same
ignore everything outside the loc_vars and calculate function, haha, a lot of that is Kino specific
Yessir
cool concept! Is there a general theme for the jet jokers, ability-wise, or are you trying to keep it broad?
(I got a request to add Top Gun jokers so I'm doing research ofc)
how come this makes ghost cards? (being run in a joker)
Eh the effects I just kinda try to make sense with the Joker concepts
it's making ghost cards because i'm making it do that >:3 oooooooooOOooOOOOoooo 👻
put the destroy seal context as an and in the first one i think
Ooooh swaggy
You can see the current Jokers here
And some 'planned' jokers I have is
- F/A 18 E/F Super Hornet Joker (no idea what to do with it yet)
- F-16 Fighting Falcon Ground Attack (Similar to hiker? played cards get upgraded/enhanced/destroyed for some purpose)
- Valkyrie Bomber (idk... speeeeeeeeeeeeeeddddd)```
Half of it is finding cool images that I go "Yeah, that'd look cool as a pixel art card"
this hasn't worked but i have a horrid feeling i know whats causing it
cards with the loyalty seal have a 1 in 2 chance of adding themselves back to your hand, so i guess i gotta figure out how to make that check if the card's been destroyed
is there an easy check for if a card's been destroyed
idk why there would be but
card.destroyed should be true if it's going to be destroyed
oh neat
ok cupcakes joker is now complete
my first joker and its a reference to an mlp creepypasta, dare i say the mlp creepypasta
lol
Wait how do I set a joker as a custom object type?
rip
This would’ve made a ton of sense but RIP that it didn’t work
ok so cupcakes + certificate + some cards with the Element of Magic seal is giving me a nice steady supply of increasing xmult lmao
dfngjdfngkfdng this is driving my head through the wall 😭
waxed.fs is literally just the vanilla shine shader right now
and it's still not working 😭😭😭😭😭
did you rename all instances of the original shader name within the shader with waxed
This... This is horrendous...
if (v.ability.name == "Gros Michel" or v.ability.name == "Egg" or v.ability.name == "Ice Cream" or v.ability.name == "Cavendish" or v.ability.name == "Turtle Bean" or v.ability.name == "Popcorn" or v.ability.name == "Ramen" or v.ability.name == "Seltzer") and not v.debuff then
card.ability.extra.Xmult = card.ability.extra.Xmult + 1
end```
😭 i didn't realise i had to
sorry!! gonna try changing those
oh! i've got no idea why that worked :D
dfkjgnjdfkgnkdjg
Okay so
any png file in my folders just
doesnt work
shaders are really weird
i really don't understand shader files 😭😭😭😭😭
are there any good tutorials out there that you'd recommend?
nop
i struggled my whole way through
i did set up this block of variables to help me. comprehend
the commented out ones explain variables that are already defined
hey y'all. First time trying to mod anything. is there a template or something i could use?
There's an examples repo inside the steamodded organization in github
thanks ^^
im fucking shaking why isnt this shit working
everything is correct
im just
going to remake the entire folder
damn i just pulled certificate when i already have certificate and i dont have showman
ill take 2 free cards per round sure
preesh. also one more question. If i'm making a mod just for custom jokers, would i just need the assets folder for the sprites and a script for what they actually do?
Is it possible to run code similarly to a joker without actually having a joker?
Like, contexts and all
Did you load the atlas? :3
the problem is that the atlas DOESNT load
im gonna try using a different mod as a base hold on
did you call for it to load in your main?
yes
gimmie a sec
Of course
Felt that bestie
Hopefully that resolves it, double check everywhere it’s called for that mistake :3
that weirdness is balatro being stupid, not you being stupid
noted ^^
the thing where the shader name needs to be a shader variable is balatro-specific
(and very dumb)
ah, glad ^^"
Shaders scare me
question about the variable in the shader
my shader doesn't use one — how can i add it in, without having it be optimised out?
i have no idea if this works, i haven't been able to test it dfkjgnkjdfgnkfjd
ah wait lemme try something -w-
riiiiiiiight
gooooootcha
well, I fixed my atlas and the game loads but
now it just shows up at the default stuff ingame
why is he jimbaked
pffffff
Acid Jimbo
😭😭😭😭😭😭😭
Sleep paralysis demon
does anyone know the hex code for the defult backgroud of a "regular" joker
isn't it white? #FFFFFF?
i would assume but im not sure
i'm pretty sure it's white
k
Yeah just wite
actually, no, i'm certain :> ya
how do i add the node to the 'blind_tracker' table via get_UIE_by_ID?
{n=G.UIT.ROOT, config={align = "cm", minw = 1, r = 0.1}, nodes={
{n=G.UIT.R, config={align="cm", minw=2, minh=1.6},nodes={
{n=G.UIT.C, config={align = "cm",id='blind_tracker',minw=2, minh = 1.6},nodes={}
}}
}}}
local tracker = G.HUD_blind_tracker:get_UIE_by_ID('blind_tracker')
local node = {n=G.UIT.C, config={align = "cm",minw=2, minh = 1.6},nodes={
{n=G.UIT.O, config={object = blind_choice.animation}}
}}
Uhh need some help with something. I'm using the Joker.load() function because I need to set sprites for a custom visual effect as children of the object, but for some reason, even though the function correctly creates the sprites, they're considered nil by the time the draw function comes around?
Wowie
What file is the vanilla jokers and consumables in?
So I have this function to set the sprites on the joker, creating three children it needs to do the visuals. It correctly sets these values, so it has non-nil tables in bloom1, bloom2, and bloom3 by the end
if card.children.bloom1 then card.children.bloom1:remove() end
if card.children.bloom2 then card.children.bloom2:remove() end
if card.children.bloom3 then card.children.bloom3:remove() end
sendDebugMessage('creating sprites')
local role = {
role_type = 'Minor',
major = card,
offset = { x = 0, y = 0 },
xy_bond = 'Strong',
wh_bond = 'Strong',
r_bond = 'Strong',
scale_bond = 'Strong',
draw_major = card,
}
local sign_atlas_1 = G.ASSET_ATLAS['fnwk_neonsign_1']
card.children.bloom1 = Sprite(card.T.x, card.T.y, card.T.w, card.T.h, sign_atlas_1, { x = 0, y = 0 })
card.children.bloom1:set_role(role)
card.children.bloom1.glow_color = {1, 0.96, 0}
card.children.bloom1.custom_draw = true
local sign_atlas_2 = G.ASSET_ATLAS['fnwk_neonsign_2']
card.children.bloom2 = Sprite(card.T.x, card.T.y, card.T.w, card.T.h, sign_atlas_2, { x = 0, y = 0 })
card.children.bloom2:set_role(role)
card.children.bloom2.glow_color = {0, 0.92, 1}
card.children.bloom2.custom_draw = true
local sign_atlas_3 = G.ASSET_ATLAS['fnwk_neonsign_3']
card.children.bloom3 = Sprite(card.T.x, card.T.y, card.T.w, card.T.h, sign_atlas_3, { x = 0, y = 0 })
card.children.bloom3:set_role(role)
card.children.bloom3.glow_color = {1, 0.07, 0.05}
card.children.bloom3.custom_draw = true
end```
However, this draw function always says the three children are nil specifically if I call `set_love_sprites()` from `Joker.load()`, but it works normally when that function is called from `Joker.set_ability()`
```function jokerInfo.draw(self, card, layer)
if not card.config.center.discovered then
return
end
if not (card.children.bloom1 and card.children.bloom2 and card.children.bloom3) then
-- always returns here on reload
return
end
...
end```
And I'm... not sure what the difference is?
is there a way to only allow an edition to spawn on playing cards?
How do I get the current chips/mult this hand?
if you want your chips prior to the hand being played, G.GAME.chips
if you want the chips at the current point in score calculation, hand_chips * mult
so G.GAME.hand_chips or hand_chips?
hand_chips * mult, exactly like that
They're global values
Lua is weird so everything is global unless you specify otherwise, they're technically stored in the global table, which would mean G.hand_chips * G.mult would be equivalent
(I think)
Hello hello
Hello!!
Winterrr
The winterrrrrr
How fares the winter this day
Tearing my hair out over why setting sprites as children to a card during loading isn't working
Because nothing in the docs implies it's functionally any different
Well don't be tearing out the hair that's bad for you
Is there an alternative route to take if it is functionally different?
there's a separate set_sprites function that I've ignored using for whatever reason
And that works, apparently
cool
shrug
It's alright I'm going to take credit for solving it because I asked a question
Ur welcome bestie
:D
Thanks bestie!!!
card.lua?
https://github.com/Steamodded/smods/issues/598 wow I hate this
this boils down to the fact that nil or false == false and false or nil == nil
That's why I sometimes do not not (<expression>)
......... why exactly does the Negative shader draw in place of the card's center or front but also then draw a second version of itself atop it? None of the other editions do that
what would i use to see each card in my hand is certain suit or not?
like would it be context.other_card:is_suit:['Diamond']?
this?
im assuming this may work
or this
well ill see
Bump
doesn't help here as I'm specifically treating false and nil as different. otherwise this wouldn't matter
How much progress on a mod is required to start a post in : https://discord.com/channels/1116389027176787968/1209506514763522108 ?
There are several posts in there of just their ideas so, I'm sure the bar isn't that high
ok
sorry for adding to all the questions 😭 but how could you make a joker allow only a specific type of card/booster pack (planet cards/celestial packs for example) available in the shop? I imagine I could recycle some parts from the planet/tarot merchant vouchers but I really have no idea which parts I can use
i think i know how you do this
the game stores the base probability weight of all shop items as variables, so you'd wanna apply an effect to the run that sets the probability weight of all booster packs you don't want to have show up to 0
ill find the code for this in a few mins, currently recovering from a migraine
ah thank you! and don't worry, please take your time :)
dear smart people of the modding dev chat
would somone by chance have some extra time to look at my code and explain to me why it is not working??
my goal for this code is to see check if each card in a scorind hand is a diamond and if it is to give 1.5x mult and if a card isnt for it to give 0.5x mult. (think of anchient joker)
uh oh i dont see the booster pack probability weights in the same place where the base shop item probability weights are stored
these are them right?
would it be as simple as invidually setting each p_[booster].weight to 0? what context would this fall under?
it would have to set the weights to 0 when it is added to the player's joker list and recalculate them when it is removed
I think you can update the banned keys list mid-run, right?
your if statement could be cleaner:
if context.cardarea == G.play and context.individual then
if card:is_suit("Diamonds") then
--score X1.5 mult
else
--score X0.5 mult
end
end
would probably be better
apart from that i think you want to change the return statement for when it scores X0.5 mult to this:
return{
Xmult = card.ability.extra.Omult,
card = card
}
for the return statements in the calculate function, you have to assign stuff to a specific set of possible returns in the table, and Xmult is the one you have to assign if you want it to affect Xmult at all
if i understand it correctly ur totally fine to name ur variable that stores the 0.5 Omult but when you assign it in the return function you have to assign it as Xmult = card.ability.extra.Omult
yeah i worked that part out after i sent the message
i think this should work but there is a error at the end of each diamonds and usualy i would fix that with a , but that dosnt work :<
hmm what text editor are u using
ive never seen an error like that, might have something to do with u putting the conditions for ur if statement on a separate line
i honestly have been learning lua exclusively through this tho so no idea if that affects anything or not
same
missing then
yep if ... then and elseif ... then
vscode folks, is there a way to make vscode not complain whenever i use G or SMODS because they dont exist in my mod's directory
I think you can mark them as global variables in the error menu that pops up when you hover over them
how do i use the colours of custom suits in text?
{C:suit}
awesome thx
just replace suit with whatever suit you're going for
how does one go about iterating over consumeables held in G.consumeables?
you could do it a few ways, what are you trying to do with them?
then a for k, v in pairs(G.consumeables.cards) do loop would work best
v is the currently iterated card in this loop
k is the key, it would be the index if you where using ipairs
what would the key be if, say, i had a single Hanged Man?
I wanna say it would be 'c_hanged_man' but I am not 100% sure
ill play around with it, thanks for your help!
sendTraceMessage to the rescue
what is this crash?
ipairs would be better here as it's in order, G.consumeables.cards is just a numerical array
fair nuff
Actually G.consumeables.cards is best used with ipairs
k is just a number here
I just said that
I just said that :jimbo_spin:
I'm still not into the full nitty gritty of lua stuff but I know enough to make it bend to my will a bit
I'm going to fight you in a Lidl parking lot 
lmao
Why do you have that emote lmaoo
I don't
right
That's a fantastic quesiton
is this something in my mod? i dont see the mod name in there
left
center
above
below
top-left idk
between
bottom-right
Sounds like me testing every align 😅
that looks like a malformed loc_vars
do i send a screenshot?
This is a line in Balatro's code. Check misc_functions in your lovely/dump folder
yeah, of any loc_vars function you have in your code
no need
I know, but it'd be helpful for them to know how to access lines from error codes like this
just those 2
Missed an extra there
yeah the second image is the issue
you have vars = (...)
that's the wrong brackets
Oh yeah that's not a table lol
´ assembled_string = assembled_string..(type(subpart) == 'string' and subpart or format_ui_value(args.vars[tonumber(subpart[1])]) or 'ERROR')´
Also this
ooh, didnt even realize, tyty
tyy!
im going a little faster coding now so i might get to when i lost all my code yesterday soon
Hi guys, what am I missing here? I am trying to ensure that all cards that spawn in the store also have my custom edition applied. So far, all of my playing cards start with the edition, but not necessarily cards I see in the store
G.E_MANAGER:add_event(Event({
func = function()
if G.jokers then
local card = create_card("Joker", G.jokers, nil, nil, true, true, nil, "foxakashic")
card:set_edition("e_Fox_akashic", true, true)
card:add_to_deck()
card:start_materialize()
G.jokers:emplace(card)
return true
end
end,
}))
G.E_MANAGER:add_event(Event({
func = function()
for i = #G.playing_cards, 1, -1 do
-- G.playing_cards[i]:set_ability(G.P_CENTERS.m_glass)
-- ("e_Fox_ghostRare", true)
G.playing_cards[i]:set_edition("e_Fox_akashic", true, true)
end
return true
end
}))
end,
Is this code attached to a hook, a calculate function, a patch, what?
Oh I missed the first line, this is the full thing
SMODS.Back{
name = "Akashic Deck",
key = "akashic",
pos = {x = 0, y = 3},
config = {polyglass = true},
loc_txt = {
name = "Akashic Deck",
text ={
"Start with a Deck",
"full of {C:attention,T:e_polychrome}Akashic{} cards"
},
},
apply = function(self)
G.E_MANAGER:add_event(Event({
func = function()
if G.jokers then
local card = create_card("Joker", G.jokers, nil, nil, true, true, nil, "foxakashic")
card:set_edition("e_Fox_akashic", true, true)
card:add_to_deck()
card:start_materialize()
G.jokers:emplace(card)
return true
end
end,
}))
G.E_MANAGER:add_event(Event({
func = function()
for i = #G.playing_cards, 1, -1 do
-- G.playing_cards[i]:set_ability(G.P_CENTERS.m_glass)
-- ("e_Fox_ghostRare", true)
G.playing_cards[i]:set_edition("e_Fox_akashic", true, true)
end
return true
end
}))
end,
init = function(self)
SMODS.Edition:take_ownership("negative", {
get_weight = function(self)
return self.weight * 80
end,
}, true)
end
}```
i was able to make a functional glass card without needing to search again :D
whats the easiest way when applying a deck to choose 6 random cards, while ensuring the same card isn't chosen twice?
How do you get the effects of a card? like the ones you can use in calculate effect.
how do i make the name or description of an owned joker as a string?
/is there even a way?
Make a copy of G.playing_cards, pick one at random in it, delete it from the copy, repeat until you got 6 cards
lua does assignment by reference though right so thatll also delete the original card
and when i tried using a deep_copy function on G.deck.cards before im pretty sure it caused an infinite loop
eh i can just loop through, create a list of indices, then operate on that
would this work?
to get like the same amount of money but in chips
like if you have $20 you get +20 chips when playing this card
how would one go about converting a tarot card to another without deleting the card? i'd like to flip the tarot and have it converted, similarly to how suit changes are handled
is this doable given functions provided by smods or the base game?
is it defined as a method for each Center, or is it a standalone function? i've found examples but want to make sure i'm looking in the right spot
It works on any SMODS.GameObject, so Center included
okay thanks
can anyone tell me why this doesnt work? it's supposed to double the probabilities of only certain cards, in this case wheel of fortune
oh and i have this at the top of the joker file
due to lua metatables you're also affecting the original table
unless the code IS right and i was suppsoed to add something to the main file- come again
how do you make the code have this font?
tyty!!
np!! ^^
can you elaborate
didnt work, did i miss something?
oops
you just put it in front of them so it takes priority ya goof
first let me see
did
okok
still nothing
try quotes around the font name
i had it on mine but i didnt like that it wasnt monospace
like this?
courier new still needs quotes
oh okok
for some reason my mod's config isn't initialized
ur
added✅
there's no AntePreview.jkr in %appdata%/Balatro/config
still no
when creating a random joker i can just set rarity to = 2
yes
sooo
have you installed the font actually
yeah
no stay here i still dont havee it 😭
ah
Okay!
so its installed as in
ttf double clicked and install button pressed right
oooh
doing!
you didnt install it 😭
i thought installing meant liike having it in the pc like an image😭
there it issss, tyyy!
that's why i edited my message from "download"
i didnt even notice
does anyone know how to fix this?
somthing like that yeah
i dont think config.lua is an autoloaded file so. have you loaded it within your main.lua
it no work :<
also custom suit order works with the same setup
yes
wait why is yor joker one line
you might need to format it
sometimes they dont like being one line
its wierd
oh the file just appeared when i pressed quit
elaborate
problem solved itself
literally what
autocorrect fears you
so what exactly are your trying to do
for i = 1, #G.jokers.cards do
if G.jokers.cards[i].ability.set == 'Joker' then x = x + 1 end
end
this is how abstract does it
thats fucking stupid what the hell
i agree!
i was thinking why allat was necessary
people fucking put playing cards, vouchers and everything in G.jokers, so maybe thunk was onto smt there
but if you allow for that insanity what about jokers placed outside G.jokers
Well #G.jokers.cards is the number of jimbos
we just don't know :3
#G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit```
what is that "bonusodd" used for?
just an rng key
it was "lucky" before for everything but someeone told me i chould change
thats because you dont want to use the same rng sequence as lucky cards
so anytime i want to set the same probability i can just use the key instead of doing all the G.GAME.probabilities thing?
huh?
like, if i say pseudorandom("bonusodd") in anything it will be the same chance ?
no
oh okok
"bonusodd" is a sequence of rng values
these are used to seperate rng events to make seeds more consistent
ex. lucky cards rolling for hits won't affect what jokers you see in the shop
oooh
pseudorandom just returns a random number from 0 to 1
then i say what 0 is and what 1 is under right?
ooh, thought it was like a binary thing
so if you want something to be a 50% chance you would do pseudorandom("whatever") < 0.5
Joker buffer must be how many it's going to add
It's looking at if the added jokers and current jokers will exceed the joker limit
ooh, tyty!
I was wondering what that meant looking at the source code
also i figured this out
i think i was using that enum value before it was defined
this is surprisingly how most random functions work
ah, but you can also put your own min and max value in pseudorandom too
G.GAME.probabilities.normal is used to make probabilities modifiable by Oops! All 6s!
pseudorandom("seed",min,max)
yeah thats what im using!
is that still continuous or does that only give integers?
it can return stuff like 4.3848479383
so still continuous then
mhm
u can slap math.ceil/floor on it though probably not, that can affect the rng a bit
???
thats a cool way of correcting yourself ngl
like
4, 4.2, 4.5, 4.9, etc: if you use math.floor on it then it will all return 4, right?
how can i make the bonus and dollars into loc_vars so i can use it in the text? i tried but just gives "nil"
but 5 has a much lower chance to return 5 :p
so its something to probably be aware of
im not good at mathematics to see how much it actually affects your odds though
if you generate a random number between 4 and 5 and then floor it you will realistically only ever get 4
if you are going for a random number generator going from 1,5 with them being a whole number, u should probably do math.floor(pseudorandom("aa",1,6)) instead as a result
so that from 1 to 5, the five int numbers have equal chances to appear
but of course, theres a very minimal chance that it will hit 6 too soooo
help😭
whats bonus?
the bonus in bonusodd and the dol in dollarodd
you need to set that to your joker's then, not returning it
its an enhancement
oh yeah, you didn't set bonus in your extra
oh wait i can just set the values in extra and set bonus = card.ability.extra.bonus right?
yeaah figured, was easier than i thought, tyty
yeah
wait but if i set p_dollars = 40 wont it automatically give me the $40 when i play the card?
only if u make it return 40 in dollars
oh okok, ty!
local all_faces = true
for k, v in ipairs(context.scoring_hand) do
if not v:is_face() then all_faces = false end
end
this code checks all scoring cards in the played hand, and sets the variable to true if they're all face cards and false otherwise, but does anyone know how to make it check the unscored cards in the played hand also?
do I just change it to say played_hand where it says scoring_hand?
I honestly might not even implement this, but it'd be neat to know how to do it
everytime the card is played it says "+$0", is there a way to take it out?
tried changing it to played_hand and game crashed. so safe to say that doesn't work
am i missing something in here? trying to make the card score the amount of money you have
how do i keep the joker.label from including the J-ModName?\
someone had said earlier that the setup affecting the actual metatable is why this doesnt work, can someone elaborate? it's supposed to double the properties of certain consumables (in this case wheel probability)
like at the end of the round? cause that's a diff function
oh SCORe
hold on
yeaah, it will score a certain amount depending on how much money you have
certain amount of what
how would i use tailsman number tables or whatever they are for my jokers?
hi folks, anyone have experience with custom decks here? I am trying to ensure all jokers and cards that appear are of a certain edition. So fare, all of my cards in my hand have this edition but not cards or jokers in the store
example of it on a joker
ok so no tailsman then
chips!
not doing that for every joker and enhancement i have made
ok but you didnt mention chips anywhere in the code
doesnt bonus work as chips in the code?
are you thinking of "chips"
return bonus = G.GAME.dollars
wait i didnt understand
set chips equal to your bonus thing in the return
smods does it automatically
ooh, thought had to say bonus to refer to chips
wait but in the enhancement charts it says bonus is extra chips
anyone have that texture for the dr specterd scholar card
oh is this an enhancement 😭
yeah yeah, im doing like 36 enhancements rn😭
let me actually read up then
how do i add the silly into the game as his own sprite
as a joker?
just noticed you have this scoring with G.GAME.dollars. assign a variable the value of your current dollars and then set bonus to card.ability.extra.[variable you made equal to your current money]
this should get you started on balatro modding
okok!
i think i missinterpreted
gotta join his community iirc
to card.ability.blaalbla
well the mod has a relese for lovly
but it no work on smods
i want to make smods verson
but there is no textures
ooh okok
still crashing
what's the crash
is it because im saying "dollars = G.GAME.dollars"?
so ill say return {vars={dollars={G.GAME.dollars}}} ?
like in here?
local dollars = G.GAME.dollars
and then youd have to put that in your calculate
and your loc_vars (outside of the return)
okok!
is this right?
where did you put that
in loc_vars
return {vars={local dollars = G.GAME.dollars}}
oh wait is outside the return isnt it?
Is this giving Chips or Mult based on how much money you have?
chips!
at least it should, we are trying to make it work
return { chips = G.GAME.dollars } ?
lemme try
isnt that for jokers
chat help me out here
or did chips work on enhancements now
well what's the issue
didnt work
and what's the crash
any idea what is wrong?
What is this trying to do?
make you get the same amount of chips as you have of money
a enhancement!
oh
Not sure about the chips not being given, but for loc_vars, return { vars = { G.GAME.dollars or 0 } } ?
lemme try
like that?
the h_dollars its because it also gives youu $6 while holding
Should be it.
maybe cause youre calling their globals in calculate directly? idk for sure
still nothing
your main file where you code the mod itself
...something ain't adding up then, though, to be fair, I've not done any editions or enhancements myself, just Jokers primarily. Apologies. 😅
no worries!
im a little confused myself aswell, because it should be working with the return thing
I think I've got it for you @digital niche
oh how?
format_ui_value(G.GAME.dollars)
where do i add this
G.GAME.dollars is a table, this command converts it
SMODS.Joker { --Pair Pear
name = "Mult Joker",
key = "testJoker",
config = {
chips = 1.0,
pairChipGrowth = 2,
threeChipGrowth = 3,
fourChipGrowth = 4,
fiveChipGrowth = 5
},
loc_txt = {
['name'] = 'Mult Joker',
['text'] = {
'Gives mult equal to the current amount of money held',
"{C:inactive}Currently + #1#s{}",
}
},
loc_vars = function(self, info_queue, card)
return { vars = { format_ui_value(G.GAME.dollars)or 0 } }
end,
pos = {
x = 7,
y = 2
},
cost = 2,
rarity = 1,
blueprint_compat = false,
eternal_compat = true,
unlocked = true,
discovered = true,
atlas = 'FoxModJokers',
calculate = function(self, card, context)
if context.joker_main then
return {
chips = tonumber(format_ui_value(G.GAME.dollars)) or 0,
card = card
}
end
end}
ignore the config, and rename it to match, especially don't forget to change the atlas
Also I made it give chips, not mult, so change that too
im not using a joker, its an ennhancement
no but it was chips not mult lol
An enhancement is very close to a joker too. For your use case of the value changing, just add a calculate block
I don't know if you need an example of an enhancement. I have one if you'd like to see
not you too 😭
example of an enhancement with it implemented or an enhancement in general?
I meant in general
oh nono, i made a couple already, ty!
Put this calculate in your enhancement ```
calculate = function(self, card, context)
if context.joker_main then
return {
chips = tonumber(format_ui_value(G.GAME.dollars)) or 0,
card = card
}
end
end}
bumping this
(joker file on left, TOP of joker file on right)
oh i changed the joker_main to context.cardarea == Gplay or context.main_scoring
json for metadata, lua for coding
ok
go download a mod and look at it, is my recommendation. Neato jokers, for instance
still nothing 😭
oh, lol! It's an enhancement, it will never be called in joker main, lol. Sorry
if context.cardarea == G.play and context.main_scoring then
sendInfoMessage("I am being played", "grassCard")
return {
chips = card.ability.extra.h_x_chips
}
end
that's the context window you want
also tried using the context.cardarea and still nothin
i'm gonna bump this again with the clarification of reordering ALL jokers that appear in the collection, vanilla or not
kinda wish you could at least have it sort by rarity
so it would look like this?
WAIT NOT IT DID
ty so much @quartz ravine 😭
also.. is there a joker that gives you +mult for every blind you skip?
shouldnt be that hard to make
yeah but im just wondering if there is one already
Nay, verily, but the noble orb of XMult doth alone persist.
"atlas"?
basically a way to set your texture
if i left it blank would it be a normal texture?
oh sweet, happy it worked for you
in your mod folder you'll want to make a folder called "assets" and inside of it one named "1x" and one named "2x"
it would be no texture
oh you meant sprit
always make your card art at 1x. Then use the resize.py script to upsample to 2x
ok
thats what i did when i reskinned some of my collab textures
except i manually upscaled it
How do you duplicate a joker?
I don't know where I am going wrong
don't quote me but you could try copy_card
Alr, I will quote you though
throwback gives you X mult when you skip a blind
opinions?
kinda fw the artstyle tbh, definitely better than the crap I can make for my own lol
where the sprite starts
then theres me: repurposing vanilla art
lol I probably SHOULD be doing that
but..
i will just edit the vanilla enhancements a litttle
does anyone know how to make game reapply custom textures when switching between pixel art smoothing
the joker i copied doesnt match up with its position
Hello, new modder here
it the image is just 1 joker than its 0, 0
how might one send a message while in an event??
for one thing, I would save that spritbrok in your card.ability.extra, I think you would likely not maintain that value between context windows switching as it is written now
hello new modder im rafaelly
its the neatojoker spritesheet but im covering them
doing this currently, doesnt work
oh then im not sure
yo whaddup
found that texture
but maybe??
for reference i want the card to pay 20$ then destroy itself
it should be 6,1
it is not.
that ss though has 1 more on the top row to the right
damnit
I did something wrong and now they won't stop juicing!
hmm, I figured since it's all under calculate it would work but Ill add the extra lines, you think that will fix the crash?
mmm yup. its 🧃
they're just happy to be here :3
is there a way with debugplus to guarantee a probability?
so can anyone help me with this bottom part
No, I don't think that's your true issue. I would try commenting out the two ipairs statements and see if it stays more stable
they are in love
mod where juicing gets stronger the more it happens
get used it happens a lot lol
negative joker sticky - gives 1 more joker slot per stumpid jokers gained (discluding negative sticky)
starts at 1, must be doing -1 in the return for the atlas
help me out!!!! damn!!!
should it be a enhancement or joker?
its a joker
at least im fairly certain it starts at 1
idk man i didnt write smods
then idk
i need it to pay you 20 dollars then kill itself
i dont know what happened here i lost the juice plot
it works currently but i cant get it to give you a message that you got the money before it dies
HOW CODE
this looks like something it say aboutt my best friend
Could look at the example code at Gros Michel for "going extinct" aka the killing itself and it would depend on what triggers it on the money part
eternal is if it can have the eternal sticker, perishable is the same but with perishable sticker
no yeah the death part works
gotta put a return in
message = "your message here"
for returns yes
SMODS.Joker{
key = 'PNA',
atlas = 'jokers',
pos = {x = 1, y = 1},
rarity = 'Perkolator_Perkeo_R',
blueprint_compat = true,
calculate = function (self,card,context)
if context.individual and context.cardarea == G.play then
if #context.full_hand == 1 and G.GAME.current_round.hands_played == 0 then
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
local _card = copy_card(context.full_hand[1], nil, nil, G.playing_card)
_card:set_edition('e_negative', true)
_card:add_to_deck()
G.deck.config.card_limit = G.deck.config.card_limit + 1
table.insert(G.playing_cards, _card)
G.hand:emplace(_card)
_card.states.visible = nil
G.E_MANAGER:add_event(Event({
func = function()
_card:start_materialize()
return true
end
}))
return {
message = localize('k_copied_ex'),
colour = G.C.CHIPS,
playing_cards_created = {true}
}
end
--like this
return {
message = "DUPLICATED",
colour = HEX('56a786')
}
--message end
end
end
}
but this is before that
what about extra
its for card.ability.extra.(thing)
here
what
and extra shouldnt be a number, it should be config = {extra = {thing = number}}
like, if you want a enhancement that gives +30 cchips you would use:
config = {extra = {bonus = 30}}
loc_vars = (self, infoqueue, context)
return {vars = {card.ability.extra.bonus}}
then you can use that card.ability.extra.bonus to refer as +30 chips
if you want 4 chips its config = {bonus = 4}
extra cant be a number
Peak.
that should work anyways
oh wait i can just steal code
yes!
how do i code the joker's ability
its card.ability.extra.(thing)
what do you want the joker to do?
should i remove that?
also, i want him to give +2 mult (starts at 5) per every skipped blind
maybe it should start even actually
you should remove the (G.GAME and G.GAME.probabilities.normal or 1), this is used for probabilities, not for abilities
4 should work better
tried commenting out the ipairs statements same crash, deleted the lines from the file STILL crashes
so not the upper part before that though?
make this:
config = {extra = {mult = 4}}
loc_vars = function(self, infoqueue, card)
return { vars = {card.ability.extra.mult}} ```
start with this
infoqueue not info_queue?
we use extra = {(thing you are using)} because then we can refer to the value in the text even if its doubled or smt and will still show the right amount, also for other things ofc
typo, info_queue is right
?
you welcome!
Is there an easy way to replace the "Saved by Mr. Bones" text for a custom Joker that also saves the player?
...unfortunately, need to Lovely patch for that. I've went down this route already (https://github.com/TheOneGoofAli/TOGAPackBalatro/blob/main/lovely.toml) for one of the Jokers I did.
Mostly
*bumping this just one more time
question
how long of an animation can an animated joker have

im brewing war crimesxz
...depending on how you doing said animations, but I don't think there is one?
whats the way balatro does something like random.choice?
good.,, good.,
im trying to reverse my way to the blind changing code

Look for the various pseudorandom-like functions through source.
I'm scared
the majority of balatro's game flow is in game.lua, right?
mostly trying to dig around in there for aspects of the game lifecycle to hook into
also another random question: is it possible for a mod to bring it is own dll fiile to use
i might need it architecturally since i might need another non-http networking protofcol
Made this one on a whim but i got 0 clue what it should do
try asking the people in #🎨・fan-art , they love doing that
oh, so all the state changes are literally just in one file 
what is the context for skip blind?
where is take_ownership() located at in the documentation?
nvm found it!
the fact that i can only look at y'all questions and unable to answer any of them cuz im in class rn
💔
nooo 💔
youre killing me bepis
tyty!
good:3
ends your class with my mind
when im using take_ownership for glass cards, what do i put after SMODS. ? like i would put Joker for jokers but im using it for glass cards
i think i figured it out Enhanced
welp, thats not it
Trying to find a way to message for each card destroyed/removed I feel like I am missing something obvious here but I have been up for WAY too long lol
{
update = function(self, card, dt)
if G.mymod.change_glass then
self.config.x_mult = 1.5
else
self.config.x_mult = 2
end
end
}
)```
hey why isnt this working?
im trying to change the xMult of glass cards based on a variable
nope, glass cards
You're trying to take ownership of a joker
well what do i change Joker to then?
SMODS.Enhancement:take_ownership()
hey guys, this probably has been asked a ton so Im sorry, but im working on my first ever mod, and I think Ive suceesfully addes a joker, the thing I want to ask for help is if you could help me to give myself mynew joker at the beggining of the game so I can test it? thx in advance
oh, i mustive misspelled it the first time
try out this mod
https://github.com/WilsontheWolf/DebugPlus
its what most people use i believe
Does smods have the capability to do function hooking?
ty
i know lovely can inject code but it looks...intimidating
put your mouse over the card in the collection and press '3'
all functions can be hooked
Due to the way Lua works, yes. That said code injection isn't very difficult, just a little finnicky
So, let's say I have my mod file. Would do something like this?
local old = G.FUNCS.new_round
G.FUNCS.new_round = function ()
old()
// ...
end
sorry pidgin lua since im not familiar with the language efully
Ideally you store the return from old() and then return it at the end
oh yeah
(even if the function returns nil normally, just for the sake of mod compatibility, since someone else could hook the same function)
if so, where would i put this type of hooking logic?
Since it's a global function/table, it technically just goes anywhere
okay so just top of mod file gotit
Lua has very little in the way of like type or scope protection
If you declare functions used in the same file, you need to have them above where they're used in the file
just call something 5000 times and it'll become statically typed obviously
(yes i know that it'll have guards) (yes i know that luajit compiles traces and not functions)
okay this almost works, but the way im trying to change the Xmult value doesnt seem to work?
do Xmult instead of x_mult
thx
How could one retrigger a consumable when it's being used?
Can't tell you the whole thing but I would start with context.using_consumeable and then looking at the retrigger example for sock and buskin
@daring fern
the gray text is {E:1}?
no
like this?
No the gray text would be {C:inactive}
C:inactive
yea
oh tyty!
it should be X, not x btw
ah fair
why does message not trigger for each card broken/destroyed?
im thinking about making a small mod that lets you easily add music in balatro to replace main theme, blind music and such
using return stops the loop from running and everything afterwards
How would I do it from the consumable?
its not as simple as that, i think
someone tried doing the same, and i dont remember their name but another person explained that retriggers dont work the same way for consumables
message appears to only work in return blocks though
You are an incredible human being and I hope you find 20 bucks you didn't know you had in the laundry
thanks 😭
where does the source code choose what message cards should display when scoring?
like the 'X2' for glass cards
the
I've never made a mod before (but I have plenty of other mods installed already), is there a simple tutorial for me to follow to get started?
can i get help with the wording on this? this is the best i can think of but i feel like it could be better
the "unused discard" means how many you have left at the end of the round
How could I put my mod badge on things that have seals other than playing cards?
Well I’d say for the first line say retrigger the
Does this actually work omg
joker that scales with the size of your hard drive.
Thank you!
joker that actively punishes you for installing modern AAA games. we love to see it.
Joker that give +10 Chips for every hour in balatro (maybe too op)
what is wrong in here?
DAMN
what does boykisser do?
cool
I just realized that this is a pay to win joker (well, almost)
game crashes when trying to skip blind, says something about performing arithmetic in mult
"X 1 mult for every dollar donated to my patreon" lol
download 100 free games
ez
smods completely rewrites the glass shattering part of the evaluate_play function, which means ive spent the last 2 hours basing everything off code which doesnt exist 😭
nativefs
imagin a joker that gives xmult = to thhe amount of viruses u have installed
what is supposed to be happening but isn't also what does your config line look like
get +2 mult when blind is skipped, its crashin when blind is skipped but it was working before, also isnt returning the mult value when calculating ingame the points
also +1 virus at the end of every round
I'd like to reiterate the first part of that question "what is supposed to be happening but isn't"
when skipping blind it is crashing when should be giving +2 perma mult
can i use lovely to inject to modify one of steamodded's files?
i need to modify a smods function
whats the crash say
tried to perform arithmetic uaing mult (a nil value)
Light mode detected. Removing pupils.
its github I swear
Guys, I'm trying to make a Joker that replays other (specific) jokers. I've looked at S&B and Baseball Joker, but I still can't crack this one.
increasing mult while your skipping a blind?
can
that wont work
yeah
u gotta remove the return part
does anyone know the answer to this?
whas the pixel width n height of a booster pack
Dayum my joker won't work for some reason...
I've also looked at blueprint... Probably shoulda mentioned that too
u mean retrigger?
yea
I'm good with word
English is the only language I speak and I still speak it like my second
mmm did u turn on the retrigger_joker part in optional features
Hey im really sorry to interrupt anything
Does anyone know how to change UI like the Title Screen or the BG? I saw this code in the files but i wasnt sure how to change it since im horrid at coding 
wait, hoppin on pc
is it not 71x95
belis wtf
whos that
This dude(tte) is a machine. I straight up would have my brain leaking out at this point if not for them
@tawny narwhal put this at the top of your main.lua or smt similiar first
then in here, you will have to make sure that context.other_card is the joker you want to retrigger
Chad
it is it's just scaled up ingame because it's evil
you could have something in their ability.extra to tell whether they are a jet joker or not
like
...and context.other_card.ability.extra.is_jet_joker then
and it should retrigger all jokers with this
did i explain it well enough lol
it means lake, btw
SMODS.current_mod... Is that the prefix I should put in there, or is it literally "...current_mod..."
Ik
anyone? 
all i can suggest is looking at cryptid's code and see how they do it
since i havent done it myself 💔
Ok! Thank you!! <:]]
can someone help me with this? for some reason, its incrementing once per card held in hand, resulting in 41 retriggers if there are 8 cards held?
ohhh, am i missing context.individual?
You need to check for context.cardarea == G.jokers for the context.end_of_round
aah right right
or alternatively, context.main_eval
both work i think
for whatever reason the source code has neither of those
its smt added by smods
i see
is there a way to simply check if the played hand in a secret hand
to account for cross mod stuff
Do a for loop in G.GAME.hands and check if .visible is false and then check if its one of those hands.
would secret hands that have been revealed be considered visible in that case?
Do it at the start of the game.
yeah im just iffy if like that would make it not work if the hand is already played
lemme see how cardsauce does it
it has a joker thats "level up played secret hand" and it works with spectrums not found in the mod
It has it's own global.
yea
Did you find where this was defined?
im guessing i gotta write something like isSecret() that fires when the game starts and make my joker read that
i just looked in pepsecret.lua
luas weird
every joker has its own lua file in cardsauce
I think I'm screwing this up, currently doesnt retrigger the cards
it should be in calculate

