#💻・modding-dev
1 messages · Page 443 of 1
Anyone have a mod that adds custom enhancements, that's easy to follow and understand how it's done?
i will share the lua again
thank you very much
Thx, I will check it out
what is wrong with it?
why does it make negative spectral cards that take up space
You're not doing card:add_to_deck()
use SMODS.add_card instead
it has add_to_deck embedded inside
it's on wiki, but I'll crop the exact one you need
@daring fern does SMODS.calculate_effect allow for sounds to be played with it? if not, how could i add sounds to it?
sound = "sound key"
It allows.
It does, just put sound = "modprefix_soundkey" in it.
You just put sound = "tarot1" or sound = "tarot2"
thank you
@daring fern something's wrong with this code
it triggers for each cards held in hand
instead of
the joker itself
config = { extra = {x = 5} },
calculate = function(self, card, context)
if context.end_of_round then
return {
dollars = G.GAME.dollars * card.ability.extra.x-1,
message = "HECK.",
message_card = card
}
end
end
}
and context.main_eval
@formal parrot watch and learn
calculate = function(self, card, context)
if context.discard and not context.blueprint and not card.ability.extra.discard_triggered then
card.ability.extra.discard_triggered = true
local total_created = 0
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + card.ability.extra.cards_per_discard
for _ = 1, card.ability.extra.cards_per_discard do
local spectral_card = SMODS.add_card({set = "Spectral", area = G.consumeables, edition = "e_negative", key_append = "minos"})
if spectral_card then
G.consumeables:emplace(spectral_card)
total_created = total_created + 1
end
end
do i write it like this?
so remove G.consumables altogether?
All my homies use create_card
remove G.consumeables:emplace(spectral_card), yes
Btw bepis
and also total_created i guess?
Idk not on pc
oof
Yeah
unless you turn on bluetooth i cant help then :3
Arrrrr
If there like
A function im missing ?
Like emplace
I dont need to emplace them right ?
Ohhhhh
I got it
I was doing a for and
I have this outside the for
Thanks anyways bepis much love
Muah
How do i put a custom icon for my mod?
SMODS.Atlas{
key = "modicon",
path = "icon.png", -- the file in BOTH assets/1x and assets/2x
px = 32,
py = 32
}
Sound for what
whenever minos gets upgraded, he grunts, whenever he's being used to mult, he goes JUDGEMENT
What's the conventionally "correct" size for a mod icon? I've seen both 32x32 and 34x34 used
why not both
How can you
Make a card dissolve
Like when its destroyed
And change its sorite
Sprite *
I assume draw step and draw shader
i think 34 is a thing bc its the size of a tag
did i send something or not
No
discord fucking tweaking
Schizophrenic
how do i move this little fella
🤷
cooked
Or @midnight coyote
what context should i use to transform cards into a different suit?
Context.before or after
Depends on what you want after or before scoring
Logically after
okk
Any idea ?
G.title_top.cards[1].states.visible = false
it's G.title_top btw
card:emplace(G.title_top)
Ty
you can make a card with SMODS.create_card
this is how I add Alice
and then just assign the card object to a variable
no smods needed?
i see
pretty cozy right?
Hi anyone knows how to change a sprite of card like when a hand is selected and is being played?
i’m probably about to add a joker to the title screen
Yeppieee
balatro modding smodsless%
BRO HE SEND THE FUCKING CODE JUST NOW
the mod will break
Main.lua
thanks
I put it inside lib/functions.lua
it's super messy there since I store both helper functions and hooks
my code above isn't enough
add this too to make the card materialize along with Ace of Spades
You need to put it in a hook.
a hook to Game.main_menu
how to i set the hand counter to a number
ease_hands_played((-G.GAME.current_round.hands_left)+number)
-- Materialize the Joker
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0,
blockable = false
blocking = false
func = function()
if change_context == "splash" then
newcard.states.visible = true
newcard:start_materialize({ G.C.WHITE, G.C.WHITE }, true, 2.5)
else
newcard.states.visible = true
newcard:start_materialize({ G.C.WHITE, G.C.WHITE }, nil, 1.2)
end
return true
end,
}))
hold on
that event should also be inside the hook to Game.main_menu
the discard?

how could i replace the main menu colors and the card in the middle?
ease_discard((-G.GAME.current_round.discards_left)+number)
i see a lot of other mods do it but im not sure how
lastly, money?
to replace the color, do this inside the hook to Game.main_menu:
G.SPLASH_BACK:define_draw_steps({
{
shader = "splash",
send = {
{ name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
{ name = "vort_speed", val = 0.4 },
{ name = "colour_1", ref_table = Sagatro, ref_value = "badge_colour" },
{ name = "colour_2", ref_table = G.C.RARITY, ref_value = 4 },
},
},
})
(use your own color by adjusting ref_table and ref_value of colour_1 and colour_2)
oh my
ease_dollars((-G.GAME.dollars)+number)
just to be safe, did i hook correctly?
local oldmenu = Game.main_menu
function Game.main_menu()
G.SPLASH_BACK:define_draw_steps({
{
shader = "splash",
send = {
{ name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
{ name = "vort_speed", val = 0.4 },
{ name = "colour_1", ref_table = Sagatro, ref_value = "badge_colour" },
{ name = "colour_2", ref_table = G.C.RARITY, ref_value = 4 },
},
},
})
return oldmenu()
end
-- Draw your Joker into the Main Menu with hooking
local gmm = Game.main_menu
Game.main_menu = function(change_context)
local ret = gmm(change_context)
local selected_card = "j_modprefix_key"
local newcard = Card(
G.title_top.T.x,
G.title_top.T.y,
G.CARD_W*1.1*1.2,
G.CARD_H*1.1*1.2,
G.P_CARDS.empty,
G.P_CENTERS[selected_card],
{ bypass_discovery_center = true }
)
if not Cryptid then
G.title_top.T.w, = G.title_top_T.w * 1.7675
G.title_top.T.x, = G.title_top_T.x * 0.8
end
G.title_top:emplace(newcard)
newcard.no_ui = true
newcard.states.visible = false
newcard.sticker_run = "NONE" --fuck the stake
No, it should be Game.main_menu = function(change_context)
that's about it
but it should be Game.main_menu(change_context)
which part
i thnk its the
Game.main_menu = function(change_context)
instead of
function game
thank you!
also this is how you color the background?
i think so
@near bay yoo, survev tag, nice
I'm an OG survivr (not the current survev game, but rather the kongregate-copyrighted surviv.io)
I do return to survev once in a while to clear up the nostalgia
same here!
how do i make a joker destroy itself?
it's the color
card:start_dissolve()
i understand but is there data inside of it?
ohh thats what that means
a table of 4 real numbers ranging from 0 to 1 representing RGBA
how would i get a custom color in there then
or could i just put it in as a hex
or like... something
Balatro's source code has HEX function
just plug in a hex value (just rgb, don't use rgba)
HEX('ff0000')
actually, ref_table and ref_value are used for when you're getting the values from a reference table
you might want to store your desire color inside a table
how could you make a consumable to add an edition to a selected card?
something like G.C.YOUR_COLOUR = HEX('ff0000')
got it
im p sure that's a cardarea
tou should be able to move it like any other cardarea
how
if not Cryptid then
G.title_top.T.w, = G.title_top_T.w * 1.7675
G.title_top.T.x, = G.title_top_T.x * 0.8
end
this is for when Cryptid is not installed
also wait
G.C.color1 = HEX('ff0000')
G.C.color2 = HEX('4dcc8e')
local oldmenu = Game.main_menu
function Game.main_menu(change_context)
G.SPLASH_BACK:define_draw_steps({
{
shader = "splash",
send = {
{ name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
{ name = "vort_speed", val = 0.4 },
{ name = "colour_1", ref_table = G.C, ref_value = "Color1" },
{ name = "colour_2", ref_table = G.C, ref_value = "color2" },
},
},
})
return oldmenu()
end
why is there a comma
oops, didnt mean to flood the chat
wtf
changing G.title_top.T.x and y
i copied what you had
its 71 i promise
how does one create a specific joker
if not Cryptid then
G.title_top.T.w = G.title_top_T.w * 1.7675
G.title_top.T.x = G.title_top_T.x * 0.8
end
check #⚙・modding-general pinned
oh you were talking to them, oops lol
wdym
fixed that
but it still crash the eof one
that should also be inside the hook to Game.main_menu
ah
bump :3
why would you use a font in your text editor / IDE that isn't monospaced
like if i wanted to create specifically jimbo and not a random joker
local ret = oldmenu()
-- your hook here
return ret
you should return oldmenu(change_context) and also you're using Color1 instead of color1
pardon me, is this better
yea, i fixed that part
what's the problem now
you're still not answering my question of why you would willingly do this
my eyes my rules
1s, let me see if the other guys thing fixes it
i'm trying to make an "aura" type card but for a specific custom edition, it doesn't seem to work though
SMODS.add_card{key = "j_joker"}
Aura farming
you know what
I give up
downgrades to phone so I respond to errors much slower
Where do I post the original concept art of my spinel joker
but you posted in a channel that my eyes and everyone else's would also land on
sorry if i misunderstood, like this?
G.C.color1 = HEX('ff0000')
G.C.color2 = HEX('4dcc8e')
local oldmenu = Game.main_menu
local ret = oldmenu()
function Game.main_menu(change_context)
G.SPLASH_BACK:define_draw_steps({
{
shader = "splash",
send = {
{ name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
{ name = "vort_speed", val = 0.4 },
{ name = "colour_1", ref_table = G.C, ref_value = "color1" },
{ name = "colour_2", ref_table = G.C, ref_value = "color2" },
},
},
})
return ret
end
thanks
oh, local ret = oldmenu(change_context)
don't forget the parameter
Code looks fine
thank you
should be good now
should i also be returning the change_context
no, it's done
Is this the worst IDE design possible contest?
@tawdry oriole check for typo
I've seen people using m6x11plus in IDE
well id win with a heartbeat
Thats crazy
none
I've tried that and honestly it sucked
can't figure this out help
the font in IDE not being monospace sucks a lot
G.C.color1 = HEX('ff0000')
G.C.color2 = HEX('4dcc8e')
local oldmenu = Game.main_menu
function Game:main_menu(change_context)
local ret = oldmenu(self,change_context)
G.SPLASH_BACK:define_draw_steps({
{
shader = "splash",
send = {
{ name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
{ name = "vort_speed", val = 0.4 },
{ name = "colour_1", ref_table = G.C, ref_value = "color1" },
{ name = "colour_2", ref_table = G.C, ref_value = "color2" },
},
},
})
return ret
end
thank you
Try
key = "anto",
set = "Tarot",
loc_txt = {
name = "Antoine",
text = {
"Add {V:1}Balatrirtic{ V:2}edition{ to",
"{V:2}#1#{ selected card in hand."
}
},
loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.max_highlighted,
colours = {
G.C.SECONDARY_SET.Spectral,
G.C.FILTER,
}
}
}
end,
atlas = 'atlas_con',
pos = {x = 2, y = 0},
config = { max_highlighted = 1 },
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
local edition = 'e_mucho_balatrirtic'
local aura_card = G.hand.highlighted[1]
if aura_card then
aura_card:set_edition(edition, true)
aura_card:juice_up(0.3, 0.5)
end
return true
end
}))
return true
end
}```
it works now, thank you guys so much
I stole the hook from Cryptid, it did not have self but the game doesn't crash either
@tawdry oriole
Freud
i'll try
LMFAO
😭
now i gotta figure out how to change the card in the menu
Throwing my head against the wall trying to figure out NES Dragon's Lair
I will finish this joker
dm code :3
Sure
thank
dont trust cryptid
the same error occured sadly
Im gonna die
yea, noted
oh
I'm doing more stuff on my own now
speaking of NES i was gonna mod but im tired so im just gonna play NES games instead
@lament agate did you get the custom joker on the menu working
play silver surfer
eventually, im playing all of them alphabetically :3
not at all
oh
we're both fucked
function Card:resize(mod, force_save)
self:hard_set_T(self.T.x, self.T.y, self.T.w * mod, self.T.h * mod)
remove_all(self.children)
self.children = {}
self.children.shadow = Moveable(0, 0, 0, 0)
self:set_sprites(self.config.center, self.base.id and self.config.card)
end
local mainmenuref2 = Game.main_menu
Game.main_menu = function(change_context)
local ret = mainmenuref2(change_context)
--Replace j_unik_unik with 'j_perkeo' or any other card
local newcard = SMODS.create_card({key='j_OAL_HatlessRalsei',area = G.title_top})
G.title_top.T.w = G.title_top.T.w * 1.7675
G.title_top.T.x = G.title_top.T.x - 0.8
G.title_top:emplace(newcard)
newcard:start_materialize()
newcard:resize(1.1 * 1.2)
newcard.no_ui = true
return ret
end
here
thank you @stark geode for the code
no hook?
to game main menu?
oh wait
i see
thanks @worthy stirrup
pls add a reference to self there
idk what cryptid is doing but pls dont break other mods
how does the game detect if you have lost or not.
what do you need it for?
which self
like this #💻・modding-dev message
im adding a totem of undying.
@worthy stirrup
bump, this is the edition's code - setting the desired edition to a vanilla one (i.e. foil) works perfectly
so mr. bones?
i have that in my code
i can't figure out how to make a joker have an effect for when the hand is on fire, does someone here know ?
i just, use the two togetjer
both should have the reference to self
is there a built in function for when you right click on a button (or just ui in general)
lmfao touché
the edition doesnt have the same key as the key youre using
oh my god
i dont think so
i am stupid
i hook the right click controller function for jokerdisplay
function Controller:queue_R_cursor_press(x, y)
i see
which res does modicon use again
34x34, i think
34 if you want to use the tag base
i can get one
would be nice
thanks
so i just got rid of a specific code which limits my discards to give only 2 negative spectrals every discard, BUT it conflicts with retrigger jokers.
firstly, how do you make it so that you get 2 spectral cards every discard?
secondly, i might keep this as an unnerfed version.
modicon also needs 1x?
afaik, yes
check what happened in #⚙・modding-general
crazy
just to be safe, am i grabbing the ID correctly?
if context.other_card:is_suit('Hearts') and context.other_card.id == 18 then
i just realized i put 18
instead of 8
:get_id()
return repetitions = 4 in context.repetition
N coding
encoding
thank you
i changed it to 3 just now
someone can help me with this error?
Mhm understandable
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play then
if context.other_card:is_suit('Hearts') and context.other_card:get_id() == 8 then
return {
repetitions = 3
}
end
end
end,
Looks good
the line 196 is the line 75
ive got one joker left to do
ur } is red
i have to remove that?
what editor are you using
notepad++
show us line 145
uh oh.
I'd recommend switching to vscode and downloading the lua extension
i use notepad++ it works just fine
just send us line 145
line 145 'if bonus > 0 then return bonus end,'
you might be a better programmer, but I'd rather help them have less syntax errors
i will use microsoft code
the end was fine there, but you also needed a end, below that
hey is it fine if i lovely dump here
it works fine yes, but you get A LOT less information that VSCode would give you and it would make solving basic syntax errors infinitely easier. Not to mention the incredible search features and flexibility that vscode gives.
how could i check how many hearts my full deck has?
how do i make my jokers go past the vanilla cap? eg more than E401 mult
practice the dark arts of talisman (unrecommended)
check how cloud 9 checks for 9s and do that for hearts
will do, thanks
where do i start 🥰
Find the Talisman mod
you might need to remove the previous card too
card:remove()
well that's 1 of 2 problems fixed
i should uhhh
hm
what's the name of the function again
yeah i got no clue i probably need to change a value
you probably need to emplace it and add the shop ui
it's create_card_for_shop in UI_definitions
oh i see what is wrong
i need to actually create the card,,
i'll do it tmrw
testing that one website called: "book of shaders" and...
apperently they don't take this clearly
@red flower any idea ? Sorry for ping
Much love
is it possible to apply a different color to description text? (like gray or other colors)
Yes
thankies
♥️
anyone here have a Mac and want to help me try out something on it? I am trying to see if I can get my version of the brainstorm mod "Brainstorm-Rerolled" working on a mac
how would I make a consumable that would give chips to next played hand?
is there a simplified tool to create custom shaders?
can anyone explain how blueprint_effect works? like the details? cause i cant seem to get it working,,
is it easy to make a tarot card that changes the rank AND suit of a card to a random available rank and suit (including modded ones)?
i probably shouldve sent the code actually
whoops
should be in theory, just combine sigil and ouija
do note those go by the entire hand, so you'll have to do some tinkering
trying to make a joker with the effect "glass kings never shatter" - seemingly the function that handles glass breaking is in state_events.lua but i have no idea how to access or manipulate that
...you should be able to hook G.P_CENTERS['m_glass'].calculate and do your thing there.
"can should"
-# shan.
-# chould
-# my cognitive functions are deterioating. :)
-# twinning and it's like the afternoon 😭
I once again am calling upon anyone who feels confident with UI stuff to try and assist me with the problem I am struggling with at the moment.
so i got a joker that does different effects every ante , and i wanna add +2 hands but im not sure how, i tried it like that but it just keeps adding to the hands for some reason
does anybody know why sprite sheet is doing the funny?
there shouldnt be any issues with it
might not be the right size
71 x 95 for a single joker
142 x 190 for the x2 version
Anyone know?
does anyone know how to add custom sound effects to scoring?,
what im trying to do is have a sound effect play on each retrigger that a certain joker does
Which context does this code run in? This small code snipper can only say so much.
(Also there's an ease_hands_played function that works the same way as ease_discards
not a single context , i wasnt sure which context i should use so yeah
how do i get it to show x1 instead of xnil
can you show the local var?
wait im stupid
i mean, show the local text, config, and local variables
depends if the way u code jokers differs to me tho
0.5 is a flat value that doesnt change
fair enough
wait what if i just copy the vanillaremade code and take ownership of madness
the x1 is subject to change, so thats why
tho im not sure what u could do about that, besides just making a duplicate of the joker to show that joker's bio/stats instead, and just replace the xnil into x0
the "fake" madness would jsut be serve as that visual thing
No, you just put config = {} in the info_queue
ah that makes more sense then
{key = "j_madness", set = "Joker", config = {}}
its not info_queue though
its the hoverable text
it shows up like this cause i have galdur
would u happen to also know how i can do this @daring fern
You would probably make your own localization entry then.
how would i do that?
j_madness_fixed={
name="Madness",
text={
"When {C:attention}Small Blind{} or {C:attention}Big Blind{}",
"is selected, gain {X:mult,C:white} X0.5 {} Mult",
"and {C:attention}destroy{} a random Joker",
"{C:inactive}(Currently {X:mult,C:white} X1 {C:inactive} Mult)",
},
},
anyone know how i could do it?
Use context.setting_blind
Context is essentially required, otherwise your code effectively runs under every possible context.
that worked perfectly
thanks
areu able to help with this now by chance?
Yes.
should i show the code for the joker or is that not needed
Is the "certain joker" you're referring to one that you've made?
Put sound = "modprefix_soundkey" in the return with the retriggers.
ooh ty
i will try
it works!!!
the other thing thats needed for the joker is that the texture changes every time it retriggers, would i just o something like "texture = _" ?
That’s a lot more tricky lol
No, are the textures on the same atlas?
brb
yeah, thats the size i'm using
although i think we have it simplified so that it only needs the 2x
but we are using 142x190 for each joker
That’s not a big problem, I do that too lol
does anybody have any examples of jokers that have two different outcomes with different probabilities attached to them? like 1/4 chance to give +20 mult 1/20 chance to give +500 chips, that kinda thing. basically lucky card but joker code
you could probably use the code for wheel of fortune as a reference... although there is a mod that adds d6 jokers which may also be useful to you
actually i think cryptid has battle bus, which has a chance at +50 mult, or -50 mult instead
thank you both, i had a look at the vanilla remade for lucky but i was wondering how it would look for specifically jokers, i will check out the d6 joker and battle bus i appreciate it
You would change context.main_scoring and context.cardarea == G.play to the context you want it to happen, all code of centers are mostly the same.
yeah, it has to be super generic code lol because its for jokerforge haha. currently the random chance modifier you can add to effects is a bit broken because it does not factor in more than one effect to the random chance. need to figure out a way to gather each effect, along with their associated random chance, and execute them basically one after another while also taking into consideration that effects with the same random chance should be grouped together
alright im back now, is it possible to make it a gif by chance?
No.
You can animate things though.
wow im definitely clicking on that
GUYS! FREE BALATRO!
ok so how would i go about doing the animated part
im not sure how itd exactly work, i can imagine how to do it for 1 frame but not for a full animation
ahhhh tysm
<@&1133519078540185692> kill him
Shoot him dead
Thank you whichever of you shot him
My goat fr
u got it
is there a variant of G.hand.cards[i].base.nominal that counts the base chips a card gives with bonuses included? (for example, hiker, foil, stone or bonus)
if so, how would i go about using it
trying to make a joker that adds the value of all chips of the cards held in hand
so for example if you have 5 king foils held in hand then you get +60 chips for each(foil 50 + base value 10)
card:get_chip_bonus() + ((card.edition and card.edition.chips) or 0)
I'm trying to make a joker create a random skip tag with a lovely path but i'm getting consistent crashes
how do I fix this?
Why does the set_ability completely break Balatro and almost crash my computer?
doesn't seem to be working at least the way i have it set up right now
i'm assuming it's counting all cards as 0 chips since they do toggle
how can i turn
local card_to_destroy = pseudorandom_element(G.jokers.cards, 'random_destroy')
SMODS.calculate_effect({message = "Cleansed"}, card_to_destroy)
delay(.3)
SMODS.destroy_cards(card_to_destroy)
delay(.7)
G.GAME.blind:disable()
into a function that is like destroy_random_joker(1) and also checks for eternal stickers
context.other_card not card
on card = card?
so card = context.other_card
minus the effect
No.
and disable blind
On the code I gave you.
local card_to_destroy = pseudorandom_element(G.jokers.cards, 'random_destroy')
SMODS.destroy_cards(card_to_destroy)
basically jsut this
bumping this
how do i destroy a random joker, that doesnt have eternal
yep that did the trick, thank you 
Why are you setting _tag to a UI element?
Someone provided the code, idk how it really works
i assume it's trying to get a tag through some UI check but idk
also bump to this
genuinely no idea why this doesn't work with blueprint
what would be the best way to generate a random tag
cuz my joker crashes when trying generating a planet card upgrade tag cuz the game doesn't know what hand the tag is allocated to
atleast thats what someone playtesting my mod said
add_tag(Tag(pseudorandom_element(G.P_TAGS, "seed").key))?
how do i check if a joker has an eternal sticker
if card.ability.eternal
Like this correct?
how can i edit the sell value?
card.sell_cost = number
inside calculate right?
When do you want to do it?
that is not meant to be a value you write to
card:set_cost() will override any changes
Yes.
i want a joker that when you sell it, you pay instead of buying it (negative sell value), and that each time i do so, it costs more selling it
Then you would hook Card:set_cost()
that yeah
ok ill try
i got a crash
my logic checks out right?
function destroy_random_joker(count) -- Helper for some cards
local jokers_to_pwn = {}
for 1, count do
for _, joker in ipairs(G.jokers.cards) do
if not joker.ability.eternal then
jokers_to_pwn[#jokers_to_pwn+1] = joker
end
end
local card_to_destroy = pseudorandom_element(G.jokers.cards, 'random_destroy')
SMODS.destroy_cards(card_to_destroy)
end
end
Update SMODS
like download a new update?
No, it would be for i=1, count do
Yes.
Yes.
I wanted to display in the message the value of the chip_mod but for some reason it doesn't display it.
(it displays "#2#" instead)
how can I fix this?
message = '+'..card.ability.extra.chip_mod..' chips!',
how can i modify this check
return G.jokers and #G.jokers.cards > 0 and #G.jokers.cards < G.jokers.config.card_limit and G.GAME.blind.boss
to count jokers with eternal as "invisible"
like there has to be at least 1 non eternal joker
#<value># is only for loc_txt as far as i know
it works fine for other tages but orbital tags cause a crash due to not knowing what hand to upgrade
I see
just for curiosity, why is it required to put two dots after the '+' and before the ' chips!'?
local jokers = {}
for k, v in pairs(G.jokers.cards) do
if not v.ability.eternal then
table.insert(jokers, v)
end
end
return #jokers > 0 and #jokers < G.jokers.config.card_limit and G.GAME.blind.boss
two dots stands for string add in lua
ooooh
To concatenate the strings.
thx for the help!
the .ability.orbital_hand is not defined properly.
what do i modify from Card:set_cost() in the hook?
card.sell_cost
ok
What should i do to define it properly?
like set the orbital hand to a psuedoseed of random poker hands or smthn?
if thats the case how would that look code-wise?
...I think just calling :set_ability() on it could work, due to
function Tag:set_ability()
local obj = SMODS.Tags[self.key]
local res
if obj and obj.set_ability and type(obj.set_ability) == 'function' then
obj:set_ability(self)
end
if self.name == 'Orbital Tag' then
if G.orbital_hand then
self.ability.orbital_hand = G.orbital_hand
elseif self.ability.blind_type then
if G.GAME.orbital_choices and G.GAME.orbital_choices[G.GAME.round_resets.ante][self.ability.blind_type] then
self.ability.orbital_hand = G.GAME.orbital_choices[G.GAME.round_resets.ante][self.ability.blind_type]
end
end
end
end
so put this in place of the add tag function or have it placed before the add_tag call?
You need to "add" the tag itself first... but also reference it for :set_ability()
is there a context for a lucky card not triggering?
like this?
context.individual and context.cardarea == G.play and not context.other_card.lucky_trigger
whats the key for space joker?
j_space
...you are not meant to just flatly copy what I posted-- instead, you could probably set a local variable to the randomly selected Tag, then add_tag it and call :set_ability() on the variable?
How do I get the code for something in basegame?
try returning nil, true
Like Sigil and Ouija
ok this aint working :(
You need to hook Card:set_cost
It doesn't take parameters.
Yes, that hook is doing nothing.
local oldsetcost = Card.set_cost
function Card:set_cost()
local g = oldsetcost(self)
if self.config.center.key == "j_modprefix_key" then self.sell_cost = number end
return g
end
tysm
wait a sec, so in the hook do i have i have to customise each joker that interacts with that hook?
What do you mean?
i mean for this
You would change that to the joker key you want to set the sell value of.
yeah that's what i mean
also, how can i make so the joker i create after selling has different sell values?
so it costs more to sell every time you sell it
You would put it in the center and refer to that.
ok
is there a way to manipulate booster pack rng?
i'm trying to make a joker that makes buffoon packs free, but they can only pull common jokers
Yes.
how would i go about doing that, can't find a good mod to reference
sigma
Hook create_card
Hello guys hope I am not bothering you but I have bug with my balatro mod here is the error file can someone help me ?
Someone earlier told me to make a function that sets the orbital tag poker hand to prevent a crash but the tag still displays as "Upgrade [poker hand] by 3 levels" and crashes afterward
should i set the function to happen before adding the tag?
To give a stronger explanation, when localization files are initially loaded, the text is parsed and organized into tables indicating the style information for each "part". So when string messages are used, you're just giving it a flat string, rather than the parsed information that the UI typically uses
Remove add_tag then do local tag = Tag(...) then after that do tag:set_ability() then do add_tag(tag)
Ok i think i'm getting it now
makes sense
i'll test it rn
Remove the Tag:set_ability function you're overwriting.
wait from where?
Why should I do that?
Because you're overwriting an important function.
Oh i seee
So what should I do to prevent orbital tag from crashing my game then when spawned by my joker?
is there a way to detect if any joker at all has been triggered?
Did that not fix it?
Nope
still displays "Upgrade [poker hand] by 3 levels" then crashes when being used
idk what to do
how?
During scoring or at all during the run?
what could this crash mean?
It means you're putting an invalid center in to a function.
Is you're mod prefix ub and the key flowey?
yeah
during scoring
Replace self with the card you are checking:
huh...
Bumping this
Question: how can I make the sound's pitch be not modified?
Cuz for some reason if you add a preset or custom sound the game automatically lowers that sound.
No, it is normal pitch, the game just lowers foil2 when playing it usually.
...you sure? cuz when the game played that sound I heard it lower than usual
oh, now you edited the message
welp, in any case is there a way to slightly modify the pitch of the sound? (if not that's ok)
does anyone know the if G.GAME.Big_Blind is real or no?
reason why the orbital tag isn't set to spawn after defeating the boss blind is because the game crash, so i'm trying to figure out how to set it to either big blinds or small blinds
I think it’s if G.GAME.Blind == “Big”?
Hm, lemme try it, if it works i'll let you know
Alright it gave me the tag after defeating a small blind
so I have this in my challenge which loads but the 10s are blank?
-- 10s
{ s = 'balalalatro_B', r = '10' }, { s = 'balalalatro_B', r = '10' }, { s = 'balalalatro_B', r = '10' }, { s = 'balalalatro_B', r = '10' },
-- Jacks
{ s = 'balalalatro_B', r = 'J' }, { s = 'balalalatro_B', r = 'J' }, { s = 'balalalatro_B', r = 'J' }, { s = 'balalalatro_B', r = 'J' },
-- Queens
{ s = 'balalalatro_B', r = 'Q' }, { s = 'balalalatro_B', r = 'Q' }, { s = 'balalalatro_B', r = 'Q' }, { s = 'balalalatro_B', r = 'Q' },
-- Kings
{ s = 'balalalatro_B', r = 'K' }, { s = 'balalalatro_B', r = 'K' }, { s = 'balalalatro_B', r = 'K' }, { s = 'balalalatro_B', r = 'K' },
(wasn't able to send the full thing due to discord sucking)
how do you detect how many jokers are in your slots?
look at stencil joker
how would i apply a scored_card.ability attribute to a joker using a sticker
pitch = number in the return.
WHY IS THE RANK KEY "T"?!?!?
G.GAME.blind:get_type() == "Big"
10 IS VALID, 0 IS VALID, HELL EVEN 1 WOULD'VE BEEN VAILD, BUT T????
anyways thanks!
ah thank you
Does that mean it worked properly?
Nevermind my bad
Does anyone know how to prevent orbital tags from crashing?
Maybe i could make set_ability to a new name to not overwrite set_ability
i guess??
No.
Because that is literally what the function does.
Look at tag.lua in the lovely dump.
I see
so how do i make sure the orbital tag doesn't mess up and crash
Do i just do this?
Your jacks have no pip
Also try T, i may be wrong
I
.
Does anyone know, how to change the enhancement of a card "after" it scored, 'couse in my code it changes visualy just after playing it (before it scores), but functionaly as it should (after scoring), is there any way to stop the visual change of a card or smth?
What is the goal?
Change the enhancement visually still in hand, like golden mask, but my custom enhancement itself changes into other one
without jokers
Where's the documentation on take_ownership?
Damn, it still crashes, even when making it spawn on a small blind, a big blind and a boss blind
the orbital tag, just doesn't like being spawned by a joker
Thank you
Yes.
You have to set_ability it.
when a joker is added or removed from the deck, how could i loop through all cards... in general in order to call :set_cost() on them?
all sellable cards need to have their sell cost recalculated
do all my jokers need a set_ability or in this case, of the Orbital Tag needing a set_ability
is there anywhere i can look through balatro's vanilla source code?
Yes, by extracting the exe
if you have 7zip, you can extract the .exe file
do i need 7zip? or will winrar work?
Both work.
ok cool, thanks
i suppose looping through G.consumeables.cards, G.jokers.cards, and G.shop_jokers.cards will work basically the same..
what does it do specifically?
you'll probably need to patch Card:set_cost(), that's what all of my shop-related jokers do
it just halves the shop prices, just like clearance or liquidation
i see
G.GAME.discount_percent = 50
scratch this, different from what i thought you meant
bumping this
Chat I need yalls opinions as programmers
Which do u prefer, sorting everything into its own file or writing everything in one single file
I see the second one done a lot and I don't get it
sort no matter what
thanls
an entire huge file is awful
one single file imo is horrible practice
Is this how i use set_ability ?
it gets annoying real fast
scrolling all the time
just want to stop the Orbitial tag from crashing the game
i just do this
yeah best practice im pretty sure
I don't think many people in this community really do much best practice
I mean documenting code is also best practice 
this is probably the neatest part of my code
TRUEE
since this mod is my first ever coding practice theres some horrifying stuff in my code
same here
like this
tru
my code is just a giant house of cards waiting to come crashing down if i dare to modify it
THE "if not AST then AST = ast" IS SO REAL
LOL
if it aint broke dont fix it
tbf that's how it's done when it's interpreted
yeah tru
theres also this shit in my game.start_run hook
not proud of this one
but setting it to 0 just didnt work
😭
WHATT
i need to test something
peak code
I'm fairly certain lua doesn't have overloading
what is overloading
changing what + and - means
Yes.
😭
would this be too complicated
Probably.
damn i'll think about doing that later then
i have defined local xscale and yscale over like 300 times and i still havent bothered to add a global to do it
it's basically just the ability to define what the different operators mean for different types
So like with bignum for example, you're not stuck doing a.add(b) instead of a + b
I need some help stopping the Orbitial Tag from crashing the game after being spawned when defeated ANY BLIND, weather i set it to Boss, Big or Small.
i have no clue how to use set_ability
im currently working on this but its having some issues
this seems like it'd need a patch to the scoring function
A hook is sufficient.
firstly i dont know how to actually apply the sticker to a joker, secondly i actually have the hook i need for it, but i dont know how to actually trigger it using this code
i actually have all the code necessary in theory
hooks are iffy with me
just a bit stuck on some stuff
SMODS.Stickers["modprefix_key"]:apply(card, true)
You would check if the key is for example mult or h_mult or mult_mod and change it to xmult or xmult_mod
okay, it seems like some of the Tag jokers might crash the game
so i need to find who crashes and who is safe
Then you would call the original function.
i already have the hook doing all of that, i just dont know how to have the sticker apply scored_card.ability.ast_semiconductor (as seen in the image i sent) to the joker it's on
The problem seems to be that it is calling context.debuff_card so it goes infinitely.
yes that is how i applied the sticker to the joker, i am trying to get it to actually trigger the hook
as you can see, the hook is supposed to trigger if scored_card.ability.ast_semiconductor
Is the problem that it wouldn't trigger on cards that trigger on playing cards?
any clues why this happens? my atlas is defined normally as per literally any other atlas i've done
No, i'm trying to get the sticker to apply scored_card.ability.ast_semiconductor to the joker it gets put on, so that the hook can recognize that and trigger specifically on jokers that have the sticker
It should do that when you apply it?
Trying to make sure orbital tag actually works when generating a random skip tag but I have no clue how to prevent it from crashing because it doesn't give orbital tag a specific hand to upgrade
Also it still wouldn't trigger on playing cards?
that error usually appears because the file path you gave to the atlas is invalid or doesnt exist
is this correct for talisman?
it doesn't
Is your prefix ast and the key semiconductor?
bump
No, it would be to_number(to_big(G.GAME.dollars)) / 2
does that round it to an integer?
No, you would put that in the math.floor
oh i see
does anyone know what causes orbital tags to not function when spawned by a joker, if so how can i fix it because i've been having this issue for about an hour now
What exactly does your Atlas look like? We can't tell if it really is correct or not if all you show is the error.
How can I make it so that buffoon packs only spawn modded jokers? I'm using SMODS.Booster:take_ownership_by_kind but I'm not sure what arguments to use for in_pool
Try looking at Modded Pack from morefluff
having some trouble applying a sticker, what else do i need in addition to this?
How does one fix a card from moving when selected when set_ability is being used on it often?
what's the trouble? a crash? it doesn't apply?
doesn't apply
You may have put an extra s on semiconductor
you're applying the sticker on the consumable itself
its to differentiate from the consumable of the same name
i see that would make sense, how would i apply it to the selected joker then?
G.jokers.highlighted[1]
hm
Where in the world in the files am I supposed to find this
Its not in the MoreFluff.lua
i dont really understand the implementation here
how would i make it so the description shows the next card to be drawn?
(as this just shows an ERROR in the description)
Replace card with G.jokers.highlighted[1]
G.GAME.hands["Flush"].chips and G.GAME.hands["Flush"].mult
thanks!
well, I found the Tag Jokers that crashed the gane
oh yeah would this go in config or the return thing
It would go where you want to give the mult and chips.
return
something like mult_mod = G.GAME.hands["Flush"].mult
alright thanks
No.
mult = G.GAME.hands["Flush"].mult
No, mult_mod doesn't have a message.
mult does.
isnt mult_mod for scaling stuff
No, mult_mod is for when you want a custom message.
No clue why the Orbitial tag and the Standerd Tag crashes the game. After being spawned when Boss blind is defeated.
how do i set the starting deck size for jokers like erosion?
G.GAME.starting_deck_size = number
Is there a way to make using Card:set_ability multiple times every time something is calculated be less lag inducing?
why do you need to call set_ability anyway
I'm trying to improve my all in one joker.
Is there a better way?
alright hello people
im trying to make a card enhancement that copies the card played before it
does anyone know what im doing wrong here that im not noticing? its pretty late for me and i may be missing something
It would be assert(SMODS.change_base(context.scoring_hand[my_pos], get_suit))
also change_base takes rank keys not IDs
How can i make orbital tags work properly when making a random skip tag, cuz i'm getting crashes because the game doesn't know what hand to assign when the joker generates an orbital tag
I'm planning on making a debug console... and i just have a couple of questions. is it possible to spawn jokers with their name, not their key? i want the console to be compatible with all mods, and have no clue if you'd need the key to know which joker to spawn
actually this is a dum question... cryptid has a code card that does that.
Anyone know how to rescale a soul sprite? It's not scaling with the rest of the card.
i was not... i'll check them out and see if they have everything i'm looking for
thank you
DebugPlus is especially well-made with a bunch of neat additional features, it's basically a must-have for mod development imo
-# Quickdraw
Try message_card = card instead of self?
How can i detec how many hands were played this round?
It worked, thanks !
So, that's just a guess, but since G.GAME.current_round.discards_used exists, there is probably a G.GAME.current_round.hands_used ?
G.GAME.current_round.hands_played
ty!
Hello there! Might be a stupid question but is there any good documentation of Balatro modding somewhere?
Could someone point out why this isn't stopping jokers from showing up in buffoon packs?
{
in_pool = function(self,args)
for i,v in ipairs(vanilla_jokers) do
if v == self.key then
return { false }
end
end
end
}
)```
Because you would be putting the booster itself out of the pool but since the booster is not a vanilla joker it doesn't do anything.
Hi, I seem to have messed something up and it keeps crashing and telling me it expects a } at the "card.ability.extra.chips =..." line, is there some formatting error I made?
Oh
Well dangit
(first time working with rng elements btw idfk what im doing lol)
Since SMODS quantum enhancements lags moderately with 31 enhancements, I'm assuming not.
Move it out of the return.
That end just above the else is probably screwing you up? Because it causes: "If joker_main and not blueprint then .... else, sober"
Also you are ending the if before else
How does one stop the cards from moving when being highlighted though?
okay so it's definitely a lot closer now, but it doesnt seem to be triggering under any context (the 1 in 1 chance is for testing), nor showing the "drunk" or "sober" messages, any insight would be very appreciated! 
you're returning in joker_main before it can reach that statement
(I should clearify it does trigger the xmult, just not the scaling aspect)
yeah I tried combining the two context.joker_main but it gave me some error about it expecting an "end" after the chip _mod is returned
maybe I just didnt do it right
I'll try again
You can't return more than once.
Yes.
factory in balatro when
factorio in balatro when
Mult!
Multiplayer
hey math guy, quick
whats 3 plus 7
99
damn hes good
can_use = function(self, card)
return G.GAME.blind
end,
this would only work if you are in a blind right?
No, it would be G.GAME.blind.in_blind
ease_hands_played(number) ease_discard(number)
and finally how do you make a simple 50/50 system
math.random?
No.
if pseudorandom("seed") < 1/2 then
-- do things
else
-- do other things
end
what would i put in seed, just anything?
Anything that is a string, yes.
can i put the games current seed in there and it would work as i would think it would?
No.
Just put any string.
Except that.
put an identifier string
something tied to the object
example: if joker's 4 mult is by chance, you use joker_mult
what if all my pseudorandoms use the same string?
would they all act the same chance wise?
like the randomness can be predicted
You shouldn't do that but they will all return the same thing if any of them trigger.
Then it will change the next time any of them trigger.
i wouldnt do that but i was jsut curious
is hand size calculated the same way hands and discards are
like temp
ah
is there a way to force like say 3 cards to draw even if it goes over your hand size
Yes.
so me and someone teamed up and started merging our mods.... and im having trouble figuring things out
his copy seems to work, but mine doesnt
wtf is Breaker.mod.path and why is it breaking things?
Somebody please tell me if I can detect playing card destructions the same way I can track consumable destructions
(relevant line at --hook)
{
weight = 0
}, true
)```
Tell me why this shouldn't work
I think I may have found a solution that comes without most of the lag.
what is that solution
how significant of lag were you seeing perf wise?
like from 200 to 30 frames or what we talkin
The game would freeze for about 4 seconds every time something calculates.
how...
good lord
i was having an issue for awhile because i had wack code where i was going from the aforementioned like 200 to 30 lmfao
but man, freezing is rough
G.FUNCS.draw_from_deck_to_hand(3) perhaps?
how can i detect when a playing card hand is displayed on screen, like either being in a blind or in a booster pack
ill try
I'm going to tweak out why is it so difficult to change buffoon packs
this worked, is there any way to force the new drawn cards to be tacked onto the right side of the current displayed hand
if not its fine