Ok I know I'm not very good at modding, and I have a lot of questions on how to make things work. So instead of asking each one separately on #💻・modding-dev, I will post all my questions here and everyone can answer them whenever they like. Please use QUESTION [NUMBER] when you answer so it is easy to understand which question you are answering.
Remember I don't understand nothing about lua coding, I'll be very happy if you include the code and where to put it inside the mod, thanks ❤️
#Cerlo's questions
1 messages · Page 1 of 1 (latest)
QUESTION 1
+ not solved
How do I make a separated sprite go on my Joker's sprite? I want to have a little number displayed on the bottom left of my Jokers. It starts at 1 and during the run it can increment up to 10.
QUESTION 2
+ solved
How do I have a separated text box near the Joker's text? An example is the glass Joker's description that has a separated box telling you what a Glass card is. I want to add something like that but with my own custom text.
Solution to Q2 #1252643810853523577 message
QUESTION 3
+ solved
How can I change a Joker so that it doesn't spawn in shops, packs, and other Jokers' spawning abilites (Judgement doesn't spawn this Joker)?
Solution to Q3 #1252643810853523577 message
QUESTION 4
- not solved
How can I color a text in a Joker's text box with a new color which is not already implemented in Balatro?
first of all, have you had a look at docs?
yes
English is not my first language and I understood a few things
also the documentation is incomplete
yeah but it has information on some of your questions
Q3:
add_to_pool = function(self)
return { add = false }
end
like, I got that I have to use generate_ui for QUESTION 2, but what to add inside that?
you don't need to touch generate_ui, you can just use loc_vars
if you want to show information of some other card, you just put that table in
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = G.P_CENTERS['c_mod_your_card']
return whatever_else
end
otherwise you can add a loc entry of type Other and reference it like this:
what really is info_queue?
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = { key = 'some_key_you_added', set = 'Other' }
return whatever_else
end
generate_card_ui calls itself recursively based on what's in info_queue, generating the needed UI elements for that additional information as tooltips
if you were to add this particular box (with this text), what would the code be like?
for the text, you can either use a function like this
function SMODS.current_mod.process_loc_text()
-- you might have other things to put here
G.localization.descriptions.Other['my_mod_example_text'] = { name = 'Text', text = { 'Other', 'text' } }
end
or a loc file like this
-- localization/en-us.lua
return {
descriptions = {
Other = {
['my_mod_example_text'] = {
name = 'Text',
text = { 'Other', 'text' },
},
},
}
Then, you would need to add this to your joker definition
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = { key = 'my_mod_example_text', set = 'Other' }
return {} -- add vars to this if the joker needs it
end
Tried it but got ERROR
if I type SMODS.PhantomThieves.process_loc_text() the game doesn't start because PhantomThieves is nil
I tried different versions but never got the expected result
What about SMODS.current_mod.process_loc_text()?
must be current_mod
what we said
your loc also needs to be in smods.process_loc_text
on mobile so can't send you an example code
doesn't seems to be needed
hm ok
should be able to
yeah, you can add them to the table in info_queue like vars = {}
got it, thanks
I made this function
function SMODS.current_mod.process_loc_text()
G.localization.descriptions.Other['my_key'] = {
name = 'Text',
text = {'Other', 'text'}
}
end
and called it inside loc_vars like this
loc_vars = function(self, info_queue, card)
info_queue[#info_queue + 1] = {key = 'my_key', set = 'Other', vars = { 'vars needed inside the text' }}
return {}
end,
QUESTION 4
+ solved
How do I make my Joker's probability to change when 'Oops all 6s' is used?
Solution to Q4 #1252643810853523577 message
I tried to look at the base code, and I understood nothing. Please tell me how you would do it
I used pseudorandom('<insert key here>') < G.GAME.probabilities.normal/card.ability.extra.odds as a condition to make a joker's probability double with oops all 6s, but this might only work for steamodded
that's not specific to Steamodded ^