#💻・modding-dev
1 messages · Page 463 of 1
thx
what do you need help w
I have a ton of ideas but some are too hard to implement for me
esp these
theres already n2 in my mod and n1 also aint that hard
I knoq n2 is a common idea
but i cant imploement it on my own
you just divide G.GAME.blind.chips by 100, floor it and add it to conf
also not that hard for you is almost impossible for me
like I have no idea what this means
this is the most complicated thing ive made
you learn by doing
if you always do one thing a bit more complicated you learn much more than by just reading
if context.before and context.main_eval then
card.ability.extra.card_list = {}
card.ability.extra.suit_list = {}
local suits = {}
for _, v in pairs(SMODS.Suits) do
suits[#suits+1] = tostring(v.key)
end
for i = 1, #context.scoring_hand do
for _, suit in ipairs(suits) do
if context.scoring_hand[i]:is_suit(suit) and not card.ability.extra.suit_list[suit] then
table.insert(card.ability.extra.card_list, context.scoring_hand[i])
card.ability.extra.suit_list[suit] = true
break
end
end
end
end
if context.individual and context.cardarea == G.play then
for _, _card in ipairs(card.ability.extra.card_list) do
if context.other_card == _card then
return {
x_mult = card.ability.extra.xmult
}
end
end
end
and second
second what
could someone walk me through adding the chance effect towards the end
i'm copying gros michel's code for it but i'm not sure how i would make it effect every joker + consumables
SMODS.destroy_cards(G.jokers.cards)
SMODS.destroy_cards(G.consumeables.cards)
that's a thing??
yes
where would those go
instead of that whole event
hmm i dont think so
yeah I don't think so either
like this?
yes
the code suggests SMODS.destroy_cards mainly targets playing cards
there's no function that accounts for eternal afaik, everything checks before destruction so it follows what the game usually does
although i will pr an eternal check and see what eremel thinks
and also the ability to make it immediate instead of an event which i need
lmao
Nice! sorry I couldnt help you
yea, calling SMODS.destroy_cards(G.jokers.cards) definitely crashes the game
Hello devs
Is there a way to do like SMODS and add thing to help do repetitive code like we do with SMODS.Joker an all the other ?
you mean make functions? yes
oh okay i understand how there made now
i dont see why, the destruction is done in an event
it's telling me that odds is a nil value even though i set in the config
What did you set it to and how did you use it?
but that's the cause of the crash
reverting the direction fixes it
well who am i to disagree with results
No, you definitely did help. You may have not seen it through to the end, but you at least started me in the right direction, and that was honestly half the battle.
Could you show the whole context function? Everything here looks fine so the actual issue might be something else.
This is (presumably) a separate, unrelated issue, but your loc_vars function should use (G.GAME and G.GAME.probabilities.normal or 1) instead.
If this Joker is viewed in the collection from the main menu, G.GAME won't exist, and that'll cause its own crash.
Glad to hear that, what was the problem if I may ask?
just tested it and it worked fine for me
might be some mod messing with it
why tf is the line Image depths = prophecy.z; in my shader giving me 4 entire errors?
ERROR 'z' : vector swizzle selection out of range
ERROR 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: depths
ERROR '=' : cannot convert from ' temp float' to ' temp sampler2D'
ERROR: '' : compilation terminated
prophecy is the name of the shader, and i'm setting an image as the 3rd item in the ARGS.send_to_shader
so prophecy.z should be the image, correct?
G.GAME does exist
I'm guessing Nopeus' fast forward
anyone know how the joker art thing works? like what code chooses where the joker is on the .png file
oh yeah if it does something with events it might be
I made a spelling error when I switched to your template, then I had to move everything around to get the correct cards to show in the correct areas
Okay, the cause is that your Joker is running the destruction check outside of a specified context, so it's running it in all contexts.
Merge that section, and the one above, into one end_of_round and game_over == false check. Within, have a single pseudorandom check with the destruction stuff, then put the upgrade stuff in an else.
As in (pseudocode because quicker to type):
if end of round and game over == false then
if pseudorandom < probabiilties.normal / odds then
destroy the stuff
else
upgrade
end
end
Just cut/paste the actual code into the appropriate places.
thank you i did figure that out
there would also have to be and not context.blueprint and not context.repetition right
not that bad of an error to be honest
but it would take me a long time to figure it out anyways
alr PR opened
Besides, the new stable release will include changes to probability stuff. 😅
bu mp
heyy quick question is there a way to detect if a card is not being scored, i want to make a simple joker that destroys all cards that are scored, not the ones that arent scored, any advice?
Yes.
context.destroying_cards only goes through scored cards iirc
many ways to do this, could even do context individual
if context.individual and context.cardarea == G.play then
return {
func = function()
context.other_card:start_dissolve()
return true
end,
message = "Destroyed!"
}
end
no
dont destroy cards like that
use this during scoring
ok i will try that, thank you !
The game will already run your function once for each card in hand when your code is within the destroy_card context.
context.destroy_card is also a card object, you can directly check its base.nominal.
That worked thank you so much!
This is more of a random questioon, because I wondered. What does stop_use() do?
And this is not such a random question: How can i make a text ui object be dynamic/changeable/always correspond to a variable
And the third one
how do i add that hover animation to text? (nvm i think i found it on the wiki)
thats all
afaik it stops the buttons from working while doing stuff like using a consumable
ok
ref_value and ref_table
i completely forgot abt that
does it updfate continuously
yes
btw tysm for helping us all with mmodding you are awesome
How can I add localization to cards? Like 2 of hearts : +2 chips. How can I add text to this?
what do you want to add specifically?
I wanna add new mechanic and new value so I've to show it like chips
look at how smods adds the perma bonus text https://github.com/Steamodded/smods/blob/b1179a49b8d230a147037bea848daca774f12f16/localization/en-us.lua#L68
How can I call it in my code?
K thanks
Is there a way to make the name of a Joker toggle-able?
I have 2 packs, but the same joker is named different things in each pack, and their textures are different. I wanna be able to turn one off so I can keep the other, without just disabling the pack with the name I don't want entirely
yes, in loc_vars return a key to a different localization entry
I was just answering the question directly but if they're two different mods disabling might just be easier
hi again!
can someone explain to me why the text is not centered?
(fixcrow is just a function that puts the item in a G.UIT.R node so it correctly displays)
-- ui definition
G.fates_wait_for_poll = UIBox {
definition = {
n = G.UIT.ROOT,
config = { r = 0.1, minw = 8, minh = 6, align = 'tm', padding = 0.2, colour = G.C.BLACK },
nodes = {
{
n = G.UIT.C,
config = { },
nodes = {
fixcrow({ n = G.UIT.T, config = { text = 'Your fate is in their hands!', colour = G.C.UI.TEXT_LIGHT, scale = 0.5, padding = 0.15, align = 'cm' } }),
fixcrow({ n = G.UIT.T, config = { text = '60s', colour = G.C.UI.TEXT_LIGHT, scale = 0.7, padding = 0.15, align = 'cm' } }),
fixcrow({ n = G.UIT.C, config = { minw = 7.85, minh = 1, colour = G.C.UI.BACKGROUND_INACTIVE, padding = 0.15, align = 'tm', r = 0.1 }, nodes = {
fixcrow({ n = G.UIT.T, config = { text = FATES.Options[1].text, colour = G.C.UI.TEXT_LIGHT, scale = 0.4 } }),
fixcrow({ n = G.UIT.T, config = { text = FATES.Options[2].text, colour = G.C.UI.TEXT_LIGHT, scale = 0.4 } })
} })
}
}
}
},
config = { align = 'bm', offset = { x = 0, y = G.ROOM.T.y + 19 }, major = G.hand, bond = 'Weak' }
}
you might need the column and the row to also be cm-aligned
oooh that makes sense
while im at it: i forgot how to use ref_table and ref_value. could you help me 😭
And that's with Malverk?
ah if it's for a texture pack i have no idea
I can do the texture pack just fine, like, I know how to disable the texture on its own
It's just the name to go along with it is all
{ n = G.UIT.T, config = { ref_table = G.GAME, ref_value = "your_variable" } }
this will use the text in G.GAME.your_variable
do you know by any chance how i could make it a 60 second timer?
i would try elsewise
but if theres already a templatge for that im happy enough :)))
i think there's a love2d function for that
but you can use G.TIMERS.REAL and keep track of the initial time + 60
(i dont think its in seconds tho)
good point
lemme checfk
pretty sure it is in seconds is it not?
its float seconds
yea just not rounded
perfect then
hi, is it possible to add buttons here? (I want user to have a choice between replacing tarot cards, planet cards, or both)
i recommend doing a config tab for options tho
what does that mean?
yeah, mostly for consistency with other mods
both are the same difficulty although you would need to use the config file described there for both
I will try to do that then
Hello, how does one write a multiline pattern in a lovely patch ?
'''
line1
line2
'''
Thx !
alright there tough guy, how do you do 1 line or 3 lines then huh
Is there a way to get this to only activate if I play a mercury card, as it currently activates on any planet card? and also is it possible to fix this visual bug when it activates or not?
'''
line1
line2
line3
'''
i dont know how to do 1
for the visual bug try returning return { level_up = 5, level_up_hand = 'Pair' } instead of level_up_hand()
for mercury context.consumeable.config.center.key == "c_mercury"
how would i check if the player has scored higher than vanilla naneinf in an unlock condition? (talisman is required)
could you drop an example code? I understand a part of it but for example what do I put inside of these (bcs Im 87% sure that it wont work unless I put something there)
Thanks!
it's in the link i sent earlier too
no worries
for enabling joker retriggers do you place it inside of the joker you want to be able to retrigger other jokers or do you place it at the bottom of the overall code?
freak youre so good
anywhere else in the overall code yeah
alr cool
where can I find "Building a UI" page?
Im blind and cant find it anywhere
wait i think i found it
alright yall im dealing with a few issues here while trying to code in a timer
talked about this a while ago, went with N's recommendation of a global table and TimerGuwbi.seconds seems to be working however not the display of the dynamic text
can anyone tell me if im doing something wrong here?
is there a way to make edition shaders stack on top of a joker's existing shaders instead of replacing them? for some reason foil seems to do this but holo, polychrome and negative all remove the custom shader
ref_value = "seconds"
i'm applying the shader with
draw = function(self, card, layer)
G.SHADERS["rendom_prophecy"]:send("mask_texture",REND.prophecy_image)
card.children.center:draw_shader("rendom_prophecy",nil,card.ARGS.send_to_shader)
Whats the problem? it doesnt do anythingSMODS.current_mod.config_tab = function() return {n = G.UIT.ROOT, config = { {n = G.UIT.C, config = {align = "cm", padding = 0.1}, nodes = { {n = G.UIT.T, config = {text = "Config", colour = G.C.UI.TEXT_LIGHT, scale = 0.5}} -- config values here, see 'Building a UI' page }} }, nodes = { -- work your UI wizardry here, see 'Building a UI' page }} end
the nodes need to be inside nodes not inside config
so how do I make the config tab?
like you posted
ohhh
i mean like this goes there
return {n = G.UIT.ROOT, config = {
-- config values here, see 'Building a UI' page
}}
}, nodes = {
{n = G.UIT.C, config = {align = "cm", padding = 0.1}, nodes = {
{n = G.UIT.T, config = {text = "Config", colour = G.C.UI.TEXT_LIGHT, scale = 0.5}}
-- work your UI wizardry here, see 'Building a UI' page
}}
end```
like this?
yeah
so in config I should put the config...
how do i get the current chip val of a card
no, it's a bit confusing but in config you put the configuration of the root node, like the color or the size
Hey Im back with another dumb question. Why tf is random here always picking first 19 and then 29???? i just dont understand it
local function choice(array)
local i = math.random(#array)
print(#array)
print(i)
print(array[i])
return array[i]
end
...
:get_chip_bonus() iirc
what's the balatro lua version
5.1
don’t use math.random
cool great thanks
use pseudorandom instead
so the % should work
its not in a calculate function
lemme try
what else do I need to put in the code for the node to show up?
there you're only building the UI, the changes to your mod's config are done through buttons and stuff
it should show up if it's written correctly, let me check
thats what I ment, there are too many things named config lol
like dis
math.floor(pseudorandom() * #array)
i forgor to put the id
tysm
bump
like this
SMODS.current_mod.config_tab = function()
return {
n = G.UIT.ROOT,
config = {},
nodes = {
{
n = G.UIT.C,
config = {align = "cm", padding = 0.1},
nodes = {
{n = G.UIT.T, config = {text = "Config", colour = G.C.UI.TEXT_LIGHT, scale = 0.5}}
}
}
}
}
end
thnx
it still doesnt show up
shouldnt I put something in the main .lua file to register the config.lua?
or does it just work automaticly
idk works for me
config.lua is where the configuration table is, not the UI
uh
like this
this should show up here?
yes
so in which file should i put this?
and this should be in main.lua or any file loaded through SMODS.load_file
oh wait i misread
ignore the first message :3
sure
makes sense now
bump 2 electric boogaloo
so the code should look smth like this?
function SMODS.INIT.ReZeroTarot()
local rezerotarot = SMODS.findModByID("ReZeroTarot")
local sprite_trt = SMODS.Sprite:new("Tarot", rezerotarot.path, Filename, 71, 95, "asset_atli")
local sprite_jkr = SMODS.Sprite:new("Joker", rezerotarot.path, "Jokers_Subaru.png", 71, 95, "asset_atli")
local sprite_pla = SMODS.Sprite:new("Planet", rezerotarot.path, Filename, 71, 95, "asset_atli")
local sprite_spc = SMODS.Sprite:new("Spectral", rezerotarot.path, Filename, 71, 95, "asset_atli")
sprite_jkr:register()
sprite_trt:register()
sprite_pla:register()
sprite_spc:register()
end
SMODS.current_mod.config_tab = function()
return {
n = G.UIT.ROOT,
config = {},
nodes = {
{
n = G.UIT.C,
config = {align = "cm", padding = 0.1},
nodes = {
{n = G.UIT.T, config = {text = "Config", colour = G.C.UI.TEXT_LIGHT, scale = 0.5}}
}
}
}
}
end
it still doesnt work but it doesnt crash
what version of smods do you have
the newest one (i think)
I started moding balatro 2 days ago
idk if it got updated since then
are you making a texture pack?
yes
i hope this is the last question: where in the fricking smods wiki can i find all colors in the g.c table
I recommend using Malverk then lol
text stylings
so like always in the most ovbvious place i dont search
it's not all the G.C colors tho, only the ones in LOC_COLOURS
but should be most of them
Why my card back texture always become like this ?
wrong dimesnions
you put 1x in 2x?
bumppp
this seems to be VERY useful, however I want to challenge myself a bit (even tho I ask for help in everything) because its fun
I dont even think I will publish the mod bcs that was not the point of it, the point is that I just wanted to lern balatro modding becouse Im rly bored
more than challenging yourself the syntax you're using is very old
and it might be causing problems
Guys when I create the joker from the video with the joker from the code, I can freely move the joker idk why but how can I solve this issue ?
is this better?
Filename = "ReZero_Tarot-Balatro_v12.png"
SMODS.Atlas{key = "Joker", path = "Jokers_Subaru.png", px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas{key = "Tarot", path = Filename, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas{key = "Planet", path = Filename, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas{key = "Spectral", path = Filename, px = 71, py = 95, prefix_config = { key = false } }
replace all of this for SMODS.add_card{key = "j_giga_tlei", edition = "e_negative"}
okok
key = miracle_center,
front = pseudorandom_element(filtered_cards, pseudoseed('csau_miracle_card')),
skip_materialize = true,
})```
Am I doing something wrong with trying to create an enhanced card here? the front seems to apply correctly, but passing in the gold key (`m_gold`) is still giving me unenhanced cards
thx it work
set = "Base", enhancement = "m_gold"
or set = "Playing Card" or set = "Enhanced"
that's.... strange
Why would I not just be able to pass in the enhancement key as the center key?
because there was already an enhancement field so i didnt change that idk
It works!
and looks a lot cleaner
thnx
bump.. please im getting desperate here ive been trying to make this joker look good all day i cant have it be ruined by editions..
shit replied to wrong message, heres a direct reply
YOO!
I have no idea how but you were right!
what does this star mean?
config tab
look inside
config
it's a cog, means that it has a config
For some reason the Bonus cards aren't appearing in the deck
what else did you expect?
photochad
makes sense
makes sense
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
bonus_card.playing_card = G.playing_card
table.insert(G.playing_cards, bonus_card)
it works, im going to sleep. Good Night everyone 👋
Thank you
bumppppppppp
Are there any requirements to start coding, I assume steam modded
check the pinned thread in #⚙・modding-general
i would help if i knew anything about shaders sorry 😞
Thanks!
I lied. This wasnt my last question. Why tf is this event getting stuck and not printing "I'm on 4" and "I'm on 5" (code directly taken from the cash out button, just replacing the cash out screen with my custom screen
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = function()
print('I\'m on 4')
if G.fates_wait_for_poll then
print('I\'m on 5')
G.fates_wait_for_poll:remove()
G.fates_wait_for_poll = nil
end
G.GAME.current_round.jokers_purchased = 0
G.GAME.current_round.discards_left = math.max(0,
G.GAME.round_resets.discards + G.GAME.round_bonus.discards)
G.GAME.current_round.hands_left = (math.max(1, G.GAME.round_resets.hands + G.GAME.round_bonus.next_hands))
G.STATE = G.STATES.SHOP
G.GAME.shop_free = nil
G.GAME.shop_d6ed = nil
G.STATE_COMPLETE = false
return true
end
}))
end
i dont see anything wrong there, is it not adding the event to the queue maybe?
no it just blocks the queue it seems (stays 9)
how do i see the event queue
no idea
would i say if v:is_suit in a for loop if im checking for a suit?
card:is_suit
whatever you named the value in the pair
apologies if i'm being stupid i'm very new to this
i'm trying to check for a king being destroyed and thought
" if context.remove_playing_cards and not context.blueprint and
context.other_card:get_id() == 13 then"
would work but it isnt lmao
apparently this event is firing the whole time
G.E_MANAGER:add_event(Event({
func = function()
print('Event Dolla Dolla')
G.GAME.previous_round.dollars = G.GAME.dollars
return true
end
}))
weird, the return true should stop it
try doing print statements to see where it fails or maybe N' is smarter
imma remove the event and see
there's no context.other_card
ah okay ty
other events are also spamming
i just pulled it from vanillaremade's baron code so i thought it would work lmao
like this one in another function
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = function()
print('Event Alignment Offset')
if G.fates_wait_for_poll.alignment.offset.y ~= -7.8 then
G.fates_wait_for_poll.alignment.offset.y = -7.8
end
end
}))
does anybody have some good examples of jokers with variables or effects that happen at the end of each hand
for this context you need to loop through context.removed
effects like suit changes, rank changes, etc.
look at how castle does it
maybe its immediate that's not working
-- Code to debug event queue
local callstep = 0
function printCallerInfo()
-- Get debug info for the caller of the function that called printCallerInfo
local info = debug.getinfo(3, "Sl")
callstep = callstep + 1
if info then
print("[" .. callstep .. "] " .. (info.short_src or "???") .. ":" .. (info.currentline or "unknown"))
else
print("Caller information not available")
end
end
local emae = EventManager.add_event
function EventManager:add_event(x, y, z)
printCallerInfo()
return emae(self, x, y, z)
end
castle changes at the end of round, not hand
gahhh i still have to much to learn 😭
you can change context
yeah but that is not the idea of why i would want it, i just would prefer specific examples
like if a mod has a joker that does something similar at the end of hands
it fixed itself 💀
the second problem was that that alignment offset event didnt return true
Hi, is it difficult to mod Balatro to change in-game sounds?
method to detect if face card is played?
card:is_face()
thx
probably not ig but i've never done that
Not in the slightest
Declare an SMODS.Sound with no prefix settings and a key matching a vanilla sound
It'll overwrite it afaik
(you can do similar things with shaders)
I want to add the binding of isaac tarot narrator when you use a tarot card
THE FOOOOL
WHEEL OF FORTUNEEEEEE
I followed the guide to install Lovely Injector and SMODS and it doesn't appear to be working. What do I need to look for troubleshootingwise?
And when wheel of fortune fails: wheel of...fortune?
you could also add sound bites for all the aces because those are narrated too lol
does it open the console alongside the game?
Nope.
like if you play flush five with only aces it would do the sound bite for the ace
can I see your balatro folder
One sec
How can I check when any listed probability happens?
Ohh you are right, but,,,i don´t know anything about modding
You would need to wait for the next smods release and hook SMODS.pseudorandom_probability
when is this planned to release and will it break existing probability stuff
i would guess tomorrow but depends on eremel's schedule
it shouldn't break anything but any mod using the new stuff won't be backwards compatible with any mod checking probability the old way
Hold, on, I'm just stupid.
catch me NOT updating ANYTHING then
When that comes will I be able to check the outcome?
yes, that function returns if the chance succeeds or fails and has what card did it as an argument
How do I get the contained hand types before a hand is played?
You mean when cards are highlighted?
Yeah
Is there a prefix list in the source code somewhere? Looking for the prefixes for challenges to work on my localization file, can't seem to locate one and I think it's what's breaking things. I've found for most cards, but not one for challenges
You'd probably want to hook the CardArea:ParseHighlighted function and use what it sends to evaluate play
oops read something wrong
AH, ok, and looks like ch is used for the v_text used as the description
You know, I never asked for my code review. Maybe I should? 
How do I hook that? Looking at lua guides on hooking but I can't figure out how to go from their generic example to balatro
In Lua, functions are variables, and functions not declared as being stored locally are automatically, implicitly placed in the global table. Hooking means storing the original version of the function locally, redeclaring the function with a new body, and then using the reference to the original as a limited type of inheritance
winterr!
Dilly!!!
hi my friend how are you
That doesn't really help
It's not relevant to my question
👍 if you want to ignore fundamental information for applying it anywhere, up to you
The question I asked was how Balatro's internals work with this. You giving me an irrelevant basic level answer is plain disrespectful.
i think the point that theyre making is hooking is hooking, it doesnt vary too much by function

yea, winter gave a pretty solid answer without just giving the code for them
code is code and balatro doesnt magically treat hooks differently
When a woman gives an explanation about something: "that's just plain disrespectful"
Lmao
That has nothing to do with this lmao
hmmm not sure if this is sexism here 😭
how does one make a card area
its basically the same
make sure that it takes the exact same arguments and feeds them into the original function so it works properly
and run smth afterwards so you can use the information elsewhere
if its because youre hooking a method, its the same as hooking any method so find the syntax for that
im not too knowledgeable but you should be able to check kino, joyouspring (i think), and balatro star rail for some examples
I just can't figure out the syntax of CardArea:parse_highlighted. I copied https://forums.kleientertainment.com/forums/topic/129557-tutorial-function-hooking-and-you/ this example to the best of my ability but the syntax doesn't match up.
In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...
Where is the display name of the joker card stored? (G.jokers.cards)
show
can you show the code
im guessing you have to get its localisation entry
This is my attempt to figure out lua hooks
why is it so red
what are the errors
cant you just get it from center.key or ability.name or smth
maybe?
itd make sense actually
Too many to count
its ability.name
i cant remember if cards store the localised text
i know i use ability.name but i coudlnt remember if that was an older way of doing it
This isn't something where following the errors would actually fix it cause it's clearly so far off
so didnt wanna recommend poss bad prac
honestly it looks all fine so i think you may have messed up smth before it and should check the errors
you dont put hooks inside a card
Still some red outside the card
i think the best way of accessing it from inside the card is SMODS.calculate_context
. not : first line
probably space between function and brackets next line is there is still an error
There's more incorrect things than correct ones 
so i have a joker that checks if a card is in hand, if not it draws it. but when i have two of this joker it just draws the card twice and makes a ghost card. i tried wrapping this in a function and it didnt work either
Yes it's called learning a new language
Removing the space makes no difference
local cardarea_parse_highlighted_ref = CardArea.parse_highlighted
function CardArea:parse_highlighted(...)
local result = cardarea_parse_highlighted_ref(self, ...)
-- Your code
return result
end
Thanks
Are you calling the function and then assigning the result?
Firstly, you shouldn't be putting cards in other cards.
and secondly?
and secondly you have wonderful eyes or something idk
How do I override default assets in a mod?
How do you instantly trigger a game over?
I tried setting the state to game over but afaik that doesn't actually do everything it needs to
G.STATE = G.STATES.GAME_OVER
G.STATE_COMPLETE = false
AH! Forgot to set the state completion
so this should work right
No, because you're putting the counts on kard and not card
G.playing_cards doesn't always exist.
if you're doing things in update you should probably also check if the card is in G.jokers
ohhhhh true
how do i make a random number function for a '1 in whatever' thing
cause this just crashes when i click on the joker lmao
pseudorandom('seed', min, max)
still getting a crash but for a different reason now
cuz you didn't define odds
im lowk a little unknowledgeable can you give like a basic rundown on how to do that
also shouldn't we be telling people to use the new smods probability stuff
eremel said to not tell that to new modders yet so I'm just following orders o7
but here's an example of that
https://github.com/nh6574/VanillaRemade/blob/706e55b80d361092129619baa8f387b4d8803e4b/src/jokers.lua#L912
"just following orders sir"
you've defined extra.dollar and extra.chance, you just haven't defined extra.odds
with defining I simply mean x = y
hmmmmm
change the .odds to .chance
okay it works now awesome sauce
and you understand why, right?
lmao
now whjen i start a round
so that was a fucking lie
that's because you need a strict context check
you need one of these (depending on what your effect is)
https://github.com/Steamodded/smods/wiki/Calculate-Functions
Oh yeah N huge props for fully finishing vremade!
Nothing is ever bug free
that then in line 130 should be an and
this WILL be the LAST CRASH
sealed box of sulfuryl fluoride:
WRONG
okay well its not crashing but shit is stiiiill broken
if it's sealed you don't know what's inside have you heard of Schrodinger
i WILL fix it myself though
ate him
Maximus reference 
maximus 1.0 is out guys btw
I hate that I know which one you're talking about cuz I saw the same one for Deltarune
i just finished 3/4 the other day it was so good
i rly like the enhancement, seal and edition decks, but i dont want the rest of cryptid, so can someone pls turn that into a mod for me?

honestly how i feel
it was a simple error of just.. not setting a value after something had been done
What does G.GAME.dollar_buffer do, exactly?
Dollars get updated in an event (to display the small animation over the text) but during scoring some jokers (like bootstraps) need the total money immediately so effects update the dollar buffer temporarily to let them work before the event runs
oohhh, oki, ty!
okay ONE LAST THING what am i missing here 😢
line 141 should be outside the return
also I recommend getting the lua extension to autoformat the file with correct indentation
I am once again confused-
so how can i use THESE (left) in HERE (right)
would i just add card to the function params and then do an
if card.blahblah then do wtv?
(both of these are in the same file)
what's the objective?
effect triggers once all cards in a suit have turned to clubs
doesnt count if there arent any of that suit in the deck
but then why do you need to hook change_suit if you're already checking in update
How do I get the contained hands of the highlighted cards?
like that
no wait cause how would i check for if there's 0 left and it wasnt at 0 alr
(ofc if you get a card of a suit you didnt have before, now you can factor that suit in)
Is this responding to me?
oh but you need the third return like local _, _, poker_hands = ...
yes
This is 4800 lines of code
It doesn't
line 4628 then
in update you just check if the value is different from the previous value
yeah but thats what i mean how would i do that
something like this yk (made sure to put this in update dw)
how are you counting rn
i'm going to leave before i start growling at this
ok instead of doing that update a local variable like local spadecount and then do card.ability.spadecount ~= spadecount
(then update card.ability.spadecount to the new count)
let me set that up rq
i got the joker working properly!! thakn u N for all ur help ❤️
What can I do with the return value of get_poker_hand_info? I'm trying to get all the hands it contains, not just the "played" hand which is what Burnt Joker uses.
What's the code to change the Texture of Enhancedments Texture and Jokers Texture game file ?
I'm stupid, i solved it tho
I recommend looking into Malverk
keeps showing up as an unexpected expression
what's the full code
you need to put it here in the it wasnt zero already
local heartcount = 0
as well
bump
Yes.
would you mind telling me how?
is it possible to make a joker switch the suit of played hand?
cause i don't know how to implement that.
Perhaps hooking add_round_eval_row?
return {dollars = G.GAME.dollars * 2} would work, no?
oh it's cash earned
nvm
How do I get the chips and mult of a hand type?
you need to set card.ability.***count = ***count after the last if
why does this becomes an infinite loop
G.GAME.hands[key].mult and .chips iirc
Your event needs to return true
ah
so just before outside of the if G.jokers check
does anyone know where the code is that's responsible for adding the hand's total score to the round score
after this end i mean
state_events in G.FUNCS.evaluate_play
look for hand_chips*mult > 0
ty
is there a way to change whether chips or mult triggers first on a card with both
i mean i know it doesn't change anything but i think it looks nicer when mult goes then chips
don't know why i always try add new Enhancedments Texture, the texture always become like in the game
return {
mult = value,
extra = { chips = value }
}
oh i see
yeah thats where i put it dw
does anyone more knowledgable on UI know how to "refresh" a displayed UI box? e.g. while a card is being hovered
what I do and what I've seen others do is to unhover and hover a card in code
idk if there's a better way
dang
would this go under context.joker_main?
Hmm ok what about a joker
Played hand is duplicated or destroyed
yeah just replace your return with that
First played hand
i mean wouldn't that just be dna but better
Yes 50 50 chance
okay
But there will be risk for destroying
that would be weird to implement but you could do it
can i not use if statements in this scenario??? (lovely patch)
"1 in 2 chance to create a copy of each played card in first hand of round, otherwise each card is destroyed" or something like that
Hmm ok
no, that's a table
if statement outside the event?
Hey y'all, I'm trying to replicate those speech bubbles that Jimbo uses, based on vanilla code and code from the Partner mod. I seem to be very close to getting it to work, but for some reason no text is showing up.
function G.UIDEF.tf_speech_bubble(input_key)
local text = {}
localize{type = "quips", key = input_key, nodes=text}
local row = {}
for k, v in ipairs(text) do
row[#row+1] = {n=G.UIT.R, config={align = "cl"}, nodes=v}
-- print("a")
-- this part does not seem to run - text is empty?
end
local t = {n=G.UIT.ROOT, config = {align = "cm", minh = 1, r = 0.3, padding = 0.07, minw = 1, colour = G.C.JOKER_GREY, shadow = true}, nodes={
{n=G.UIT.C, config={align = "cm", minh = 1, r = 0.2, padding = 0.1, minw = 1, colour = G.C.WHITE}, nodes={
{n=G.UIT.C, config={align = "cm", minh = 1, r = 0.2, padding = 0.03, minw = 1, colour = G.C.WHITE}, nodes=row}
}}
}}
return t
end

So this is my attempt at adding chips/mult of contained hands while selecting cards. It doesn't work
like, as a preview?
Yeah
Update: Doesn't crash but doesn't do anything either
you would need to use update_hand_text probably
How do I use that method? Running it empty gives a nil value crash
I would check how the game uses it, it's not very straightforward
why does having the loc_var info_queue[#info_queue + 1] = {key = 'perishable', set = 'Other'} crash the game when i hover over it? when it's an error, it works just fine, but perishable crashes
oh wait, i have an idea as to why
I guess I gotta decompile my game
you can check the folder under lovely/dump too
if next(SMODS.find_card('j_modprefix_key', true)) then ?
Oh it's just right there, nice
What is this line for?
That's the recommended way to "check" for a Joker instead of find_joker.
Thanks. How do I use prefix with that?
Your modprefix.
Do I include the j_x_
SMODS.find_card uses full keys, so yes.
is there an easy way to add a custom info_queue to a joker, or do i need to add something to a localization file
you do need to add it to a localization file
so it conflicts with cryptid?
how do i check if the scoring hand is the lowest ranked one?
like, say i play a two pair of 2|2|5|5
i want it to focus on the pair of twos
cause that's the lowest ranked hand in scoring
(will only focus high card if you play a pair or a high card)
Note that you can individually go through the poker hands in the scored hand via context.poker_hands[poker_hand_name]
that includes pairs
its a table of tables
so if i did it through next it's already focusing it*?
*the lowest ranked in terms of... well... ranks
or will it sometimes pick the 5s over the 2s
I found this:
update_hand_text({immediate = true, nopulse = nil, delay = 0}, {handname=disp_text, level=G.GAME.hands[text].level, mult = G.GAME.hands[text].mult, chips = G.GAME.hands[text].chips})
I have a feeling these variables won't be the same for me though, so I'm trying to figure out what to replace them with
SMODS.current_mod.set_debuff = function(card)
if card and card.ability and card.ability.fainted == G.GAME.round then
return G.STATE == G.STATES.SELECTING_HAND or G.STATE == G.STATES.HAND_PLAYED or G.STATE == G.STATES.DRAW_TO_HAND
end
if card.ability.name == "Wild Card" and next(find_joker('Natures Touch')) then return 'prevent_debuff' end
return false
end
is this all i need for wild cards to not be debuffed? cause its not working
how can you make the text of a card dynamically update for a card that uses Xmult. like for a scaling joker, i guess a good example is vampire. the text isnt updating 😭
This Joker is supposed to destroy part of or all of the cards in your scoring hand, depending or not whether it contains a poker hand stored in type (in this case Pair) is this how that would work?
how do i check if a blind is a boss blind
if G.GAME.blind.boss
(replace G.GAME with context if it needs to be a context)
does anyone have experience making those speech bubbles from Jimbo (for example in the tutorial)? i can't get text to show up for some reason
make sure your quip keys match
id help more but im dead tired 
understandable
I'm trying to build a text-based interface for balatro e.g. for blind people / to let LLMs interact with balatro.
Things I'm currently working on but need help with -
-
Getting the current state of the game
1a. I'd love to be able to spit out all the cards that are in the hand, and which of them are currently selected
1b. I'd love to be able to read where the game is, in the menus
1c. Currently I'm exploiting the Balatro save system, reading the save data and converting it to Json - but this doesn't work in menus and can't tell me which cards are currently selected.
1d. I'm thinking of using cheat engine to directly extract the game state by reading the game's memory. -
Being able to interact with the game from a command line
2a. I've tried using the Typist mod; but I note that this only lets you interact with a limited number of cards (11, one for each key on the home row of your keyboard - probably not an issue for most players, but could prevent some power users from fully engaging with cryptid card shenannegans)
2b. I've also toyed with emusating a gamepad but this wouldn't work unless I can read the current game state, including which cards are currently selected.
Anyone got any better advice for me re reading the state of the game and interacting with it from a text only interface?
a few questions
- what exactly does
next()do - is there a relatively easy way to make a blind picture like i can code one but idk what to do to make the image
- how do i change the icon of the mod, like the one that shows up in the mod menu it kinda looks like a tag
sorry if that last one is in the docs, it sounds like it would be but idk i didnt see anything
gosh i wrote this like 5 hours ago but i forgot to hit enter 😭
to animate blinds, use https://discord.com/channels/1116389027176787968/1343897196927647754
you just need the first frame
i apologise for the probably very simple questions
thanksmuch
thats the big one the other two are jhust out of curisoity
SMODS.Atlas{key = "modicon", path = "icon.png", px = 34, py = 34}
thanks much x2
nevermind about the next thing for some reason i didnt piece together that its just a lua thing
Is this what i do for the rank names?
is there a way to round numbers to the nearest hundred
math.floor and math.ceiling only seem to round to the nearest integer
Divide the number by 100, round then multuiply by 100
50/100 = 0.5 rnd 0.5 = 1
1100 = 100
49/100 = 0.5 rnd 0.49 = 0
0100 = 0
also yes do that if you just want to round numbers
that seems to do nothing
oh
still not rounded
oh
1x2/2 = 1
Now, i need help
depends on what you're doing with them
Making this
I just want to know if that is what i put for the numbers
The face cards are sorted ofc
i mean if you're talking the cards' internal numbers you don't put them in strings and it's just
2 thru 14 (ace)
the numbers
Oh
what exactly are you doing with them tho
cuz this js looks like balatro with a deckskin
remove the quotes
really? ok
so that they are numbers
Its like friends of jimbo yeah
and not text
ok
ok granted i dont know how to make a deck skin
but im just going off of my knowledge of card IDs
hold up
wait
i'm looking at the code of a deck skin i have
you were right
so long as something like this is going on i think
i do not know
lemme look at the example
look at this
you should find your answers
ok
yes and put the names of the ranks back sorry i misled you, i didn't know what you were asking initially
"2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace"
?
Im making all of them
alrigh
i love this a lot actually
Lusty Pareidolia: All cards with Hearts suit are considered face cards
I could totaly make that
Can I steal that and put it in my big balatro mod because I have zero ideas for jokers and that would actually be pretty decent
i can credit u if u want
you don't have to
it was just a faint idea of mine based on the texture
since they all look like face cards
hell yeah
Anyone know if steam modded works on Xbox game pass balatro, last time I heard it was in progress
Got my ass
I dont think so
Piss
My bad, it probably gets asked a lot.
hello chat
hi
during testing how to make a joker to always appear in the first shop
you can just use debugplus to spawn it
so i tried reading and saving seals in a table and then printed the output
its gave me 0 every time even tho i have seals
whats the issue?
found_seal is not a table, also card is the card.
what do i use then?
i just want to be able to read seals and call them back, similar to how "The idol" calls cards
playing_card
Yes, playing_card doesn't exist outside of the loop, and I was referring to using playing_card.seal
oh
ok let me try that then
it worked
now i need to make it choose one of the seals in the table randomly, count how many are there, and give money based on that number
Why cant i code D:
oh, hi lusty
hi
skill issue, lol
joking, u can learn
What is wrong with thiss
whats the issue? does it crash? not work?
yeah
https://github.com/Gud-username/Lusty-hearts Is the mod
Heyy devs
Hi
hello heaven
trying to help lusty here
My deck sskin is broken
and thinking about this too...
Oh hello
What’s the problem?
repeats 2s after 4
and flips 4 and 3 pos
Mhm
You can use aiko’s mod and change some files , some stuff on the deck skin is outdated as I remember
I should flip the order of the cards
Ill do that later because it isnt going to crash my game, i tested it already
So I install debug plus how to spawn any jokers during a run
yes
Press 3 when hovering in the collection
Done
press tab to see every thing
try now
hc_atlas = hc_registered and atlas_key..'_hc' or atlas_key..'_lc',
Try this
In the last one
Ok
what does card.abillity.fainted do?
Sounds easy enough
nvm
Whats that😭
You can do the random with pseudorandom element
"sounds" easy
hmm, i thought of pseudorandom
It did nothing :(
ig that code is not yours...
Lusty i think i have an easier and working solution for you 😭
If not, it made it so i cant use low/high contrasrt
Aiko had a mod that added deck skin and its up to date you can change the asset files and some optional stuff and it will work
They don’t mind
yeah do that
Anything to identify it
Make sure to rename it in other instances of appearance in code
Ok
If you’re using vscode just click it and it’ll show you
im tryna do a function to check for a wild card, can i use if card.ability.name == "Wild Card" is that even a thing?
Im coding on github
SMODS.has_enhancement(card, "m_wild")
ok thanks
how can i make it so the function checks for a specific joker
Where exactly
lazy to think of how to even write it lol 
next(SMODS.find_card("j_modprefix_key")?
llllllooooooooonnnnnnngggggggg sigh if i had a penny every time i've fixed and then forgot how to fix this issue i'd be rich enough to cure transphobia-
i think this one works thanks
local card1 = pseudorandom_element(table, 'something')
I think
I might be stupid
You seem to be inputting a table that isn't a card into a SMODS function.
all hail teacher
You know your code isn’t fucked up when you don’t get a ⁉️‼️ as a reaction
your "😭 " are tears of joy right?
Yeah😂
just making sure haha
tee hee
That was it, i was using context.scoring_hand when i needed G.play.cards
i forgot a bracket
It says line 10 and im like
oh yeah
no closed bracket
Now it is as brocken as last time
What did i do?
What did i do man
Git hub dosent like me
can we moding the joker card in the intro
Yes
We can modding the joker
Don’t be mean some people don’t have the greatest english skills :>
what do i change to?
How on earth have i got someone elses code wrong
if SMODS.has_enhancement(card, "m_wild") and next(SMODS.find_card('j_batrocities_NaturesTouch')) then
return {
'prevent_debuff'
}
end
will this work if i just slap it on calculate of the joker (highly doubt) (idek if the code is proper)
atlas_table = 'ASSET_ATLAS',
what do i do for atlas_table
calculate is not calculating lol
Would i say atlas_table = 'ASSET_ATLAS',
or do i do something for atlas_table
like atlas_table = "lemon"
whats the difference between SMODS.add_card(t) and SMODS.create_card(t)?, and when would i use either?
add_card automatically emplaces the card to the area and runs add_to_deck
SMODS.create_card is the same as base create_card
ah without the add_to_deck i see thanks
https://github.com/Gud-username/Lusty-hearts/blob/main/Lusty.lua
And what would i do with this to stop the image from happening
I keep trying to return a card to the hand from scoring but it always comes back flipped...
what does that mean?
DUDE
syntax error
im guessing that eof is end of function?
what did you do?
Im trying to make more than the face cards work
I dont even know
hc_atlas = "vocalatro_hearts_2",```
try using your keys instead of that?
i dont know much abt deck skins
hc_atlas = "hearts_2",```
It should look smth like this (I think? Im not sure)
could you send what mod did you copy from?
then this is bad
dont mind this
Not quite
It worked with fac cards only
the i added more ranks and it broke for no reason
ok
...why does your deckskin reference vocalatro
yeah
like this?
yes
,,,,,
where
,
at least we can see his work 🤷♂️
install an actual code editor ,,,,,,
no
your loss
I have parental controls
the ever-reliable notepad:
I use that to edit my code occasionally
If its small i do
actaually
yeah sure
Still have a problem
does someone know how to make those check boxes?
How is my code broken
what atlas do you ahve?
have
you have to set the correct position so it transforms into the joker for that position
in your atlas
like
X = 0 and Y = 0 is the top left corner of your spritesheet
rn, x=0 y=0 here is the first card
increase X by 1 to go right by 1, increase Y by 1 to go down by 1
and which corner do i have to put in of my joker
which one do you want your joker to show?
the flower
then use {x=1, y=0}
my games loading fine, but my mod isnt appearing on my mod list nor is the joker appearing in the collection
can you show us your mods folder?
you mean to put the header in json?
the whole file?
like this
yeah
this is an temporary mod so I didnt want to do that but sure
tho it's way better to use that
ok
is fractural your mod?
yes
enter it
is this better?
yeah ig i never added an extra button so
help
now enter the main
shouldnt the lua file be named the same as the folder?
no

