#💻・modding-dev
1 messages · Page 438 of 1
where line 575
You are missing a , after loc_txts closing } also please install the lua extension.
config = {extra = 3, choose = 1}
😭
I'm trying to make this joker, however when loading a save with it active add_to_deck isn't triggered. Is there a good way to make this work?
local old_can_sell_card = G.FUNCS.can_sell_card
local old_sell_card = G.FUNCS.sell_card
SMODS.Joker {
key = "hoarder",
name = "jon_Hoarder",
atlas = 'jon_jokers',
pos = {
x = 1,
y = 0,
},
rarity = 2,
cost = 5,
unlocked = true,
discovered = false,
eternal_compat = true,
perishable_compat = true,
blueprint_compat = false,
config = {
extra = {
jokers = 2,
consumables = 1,
},
},
loc_txt = {
name = "Hoarder",
text = {"{C:attention}+#1#{} joker slots, {C:attention}+#2#{} consumable slot.",
"Jokers and consumables cannot be sold.",
}
},
loc_vars = function(self, info_queue, card)
return {
vars = {card.ability.extra.jokers, card.ability.extra.consumables}
}
end,
add_to_deck = function(self, card, from_debuff)
G.jokers.config.card_limit = G.jokers.config.card_limit + card.ability.extra.jokers
G.consumeables.config.card_limit = G.consumeables.config.card_limit + card.ability.extra.consumables
G.FUNCS.can_sell_card = function(_card)
return false
end
G.FUNCS.sell_card = function(_card)
end
end,
remove_from_deck = function(self, card, from_debuff)
G.jokers.config.card_limit = G.jokers.config.card_limit - card.ability.extra.jokers
G.consumeables.config.card_limit = G.consumeables.config.card_limit - card.ability.extra.consumables
G.FUNCS.can_sell_card = old_can_sell_card
G.FUNCS.sell_card = old_sell_card
end,
}
is that the entire thing?
You need to hook G.FUNCS.can_sell_card always and check if you have that joker.
yeah
I was hoping there was a better way
mine does this when i open it
this is my code
anyone know whats going on i used codemobs code almost exactly
Does anyone here know if it's possible to have multi-line attention text?
You have an extra bracket on your second attention block
idk if that's the issue though
wdym
ohh I see what you did
isnt that credit card joker
Make a table with the keys and get a random one.
what that mean
table = {"j_blueprint", "j_brainstorm"}
where would i put that
Hmmm... I'm actually not sure how I circumvented that with sleeves. Do you have some example code I can look at?
is there a way to get a list of all consumable types?
how do I make a Joker show an animated image on screen?
SMODS.ConsumableTypes?
function create_UIBox_your_collection_states()
pool = get_states_pool()
node = {}
areas = {}
area = {w = 3, h = 2}
for _h=1,area.h do
areas[_h] = {}
row = {n=G.UIT.R, config={align = "cm", padding = 0.07, no_fill = true}, nodes={} }
for _w=1,area.w do
areas[_h][_w] = CardArea(
G.ROOM.T.x + 0.2*G.ROOM.T.w/2, G.ROOM.T.h,
1.2*G.CARD_W,
1.2*G.CARD_H,
{card_limit = 11, type = 'deck', highlight_limit = 0}
)
table.insert(row.nodes, {n=G.UIT.O, config={object = areas[_h][_w]}})
end
table.insert(node, row)
end
local states_options = {}
for i = 1, math.ceil(#G.P_CENTER_POOLS.State/(area.w*area.h)) do
table.insert(states_options, localize('k_page')..' '..tostring(i)..'/'..tostring(math.ceil(#G.P_CENTER_POOLS.State/(area.w*area.h))))
end
for _w = 1, area.w do
for _h = 1, area.h do
for _ = 1, 10 do
local card = Card(G.ROOM.T.x + 0.2*G.ROOM.T.w/2,G.ROOM.T.h, G.CARD_W*1.2, G.CARD_H*1.2, pseudorandom_element(G.P_CARDS), G.P_CENTERS.c_base, {playing_card = i, viewed_back = true})
card.sprite_facing = 'back'
card.facing = 'back'
areas[_h][_w]:emplace(card)
end
local state = pool[_w+(_h-1)*5]
local card = create_state_card(areas[_h][_w], state)
replace_state_sprite(card, state)
areas[_h][_w]:emplace(card)
end
end
local t = create_UIBox_generic_options({ back_func = 'your_collection', contents = {
{n=G.UIT.R, config={align = "cm", r = 0.1, colour = G.C.BLACK, emboss = 0.05}, nodes=node},
{n=G.UIT.R, config={align = "cm"}, nodes={
create_option_cycle({options = states_options, w = 4.5, cycle_shoulders = true, opt_callback = 'your_collection_states', current_option = 1, colour = G.C.RED, no_pips = true, focus_args = {snap_to = true, nav = 'wide'}})
}}
}})
return t
end
Yes
oh yeah my pack only spawns credit card
whoops
lol
anyway how would i make it spawn not credit cards
like where would i put my table
When I have a deck on the select screen and move the first card around, the second card is not darkened. When I do it with the first card of the deck in-game, the second card is darkened.
I'm guessing there's some sort of difference in the cardarea config, or the config of the cards that are added to the cardarea. How do you generate your cardareas?
You would get a random element from G.P_CENTER_POOLS.Joker and tell it to try again if the key is j_credit_card
wot
wdym how do i generate the card areas?
i've got a pack that lets you select from multiple card types, however, by default, things like playing cards go to the consumables cardarea. is there a somewhat easy way to allow the player to select playing cards or jokers normally, while also selecting consumables to their normal cardarea?
Oh wait I'm stupid that's in the code you sent. One second please lol
local random
while random == "j_credit_card" do
random = pseudorandom_element(G.P_CENTER_POOLS.Joker, 'seed').key
end
I think you’re misunderstanding
they don’t want no credit cards they want it not to be only credit cards
i want no credit cards
(which is what my booster pack does)
i want my 6 custom consumables
but idk how to do that ive never modded before
booster packs atleast
Are they under a consumable type?
paint
nevermind, it's as easy as removing the select_card variable and setting draw_hand to true!
just do set = “modprefix_paint” and remove the key part
My logic was right. Compare the way you generate your cardarea (specifically the config options)
CardArea(
G.ROOM.T.x + 0.2*G.ROOM.T.w/2, G.ROOM.T.h,
1.2*G.CARD_W,
1.2*G.CARD_H,
{card_limit = 11, type = 'deck', highlight_limit = 0}
)
to the way you I generate the cardarea (copied directly from galdur)
CardArea(G.ROOM.T.x + 0.2*G.ROOM.T.w/2,G.ROOM.T.h, 0.95*G.CARD_W, 0.945*G.CARD_H,
{card_limit = 5, type = 'deck', highlight_limit = 0, deck_height = 0.35, thin_draw = 1, index = i})
Setting one of those config options deck_height, thin_draw or index will get rid of the shadowed second card
you'll have to trial-and-error or look through the code to figure out which one of those 3 it is
(or possibly a combination of the 3)
calculate = function(self, card, context)
if context.end_of_round and G.GAME.blind and not context.blueprint then
if G.GAME.hands_left == 0 then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
return {
message = "ay caramba",
colour = G.C.RED
}
end
end
if context.joker_main then
return {
xmult = card.ability.extra.xmult
}
end
end
}
helo
help
it doesnt scale
this happened when opening the pack
is the consumable type called paint?
and your prefix is colr?
ConsumableTypes don't have mod prefixes.
huh
inconsistent but ok
remove the colr_
it was thin_draw thanks
bump
Also you should probably remove no_edition = true unless you want them to have no edition.
i want them to have no_edition
I mean they’re consumables
They don’t typically have editions
stop with the question marks
oh lol
maybe pasting code from the Pack That Only Gives You One Credit Card was a bad idea
You need to put skip_materialize = true
in the create_card
the pack in question
now it works
then thats it
enhancements done
jokers done
consumables done
the one pack done
now just to make the github page for the mod (someone a little help?)
I think you would either use git or Github Desktop
idk depends on what you want
that looks like enough?
ok cool
if that's what your mod needs for it to run then you're golden
Hi everyone, I'm pretty new to modding and I want to know if anyone can help me, I need to know how to detect which hand is played (four of a kind in my case) and how to get the blind number, hands, discard, almost all the numbers in the HUD (I just want to count how many 4 are in screen), is there any documentation or template for this?
context.scoring_name, G.GAME.blind.chips, G.GAME.current_round.hands_left, G.GAME.current_round.discards_left, No.
Use if next(context.poker_hand[‘Four of a Kind’]) then
If they want to check the hand played it would be context.scoring_name
anyone know how i can fix the error thing?
What? That’s how you check for certain hands?
Yes.
You have to make a localization entry.
any examples , i never done that lmao
Ok, thank you very much @high sinew and @daring fern
Yup not sure what he’s saying but I’ve used that context for any time I want a joker to check a certain hand so it does work just use it with context.before or sum
is there a way to change variables of specific booster types?
If you want it to be a new consumable use consumabletype
Unless u wanna change badge of actual booster strong
no, like, i need to change the weight of a booster appearing
Ah I see look into enhancement API or edition two examples of programmed stuff in SMODS to make it own
But I think booster comes with weight
also how would i make a localization entry for the thing i need rn
Try out weight = #
yeah, i'd like to have a voucher that turns specific boosters to a different weight
context.poker_hands is for checking if the played hand contains a hand, context.scoring_name is for checking if the played hand is a hand.
they're at a weight of 0 but i want a voucher to increase that, aka they can only be found in the shop once a voucher is purchased
Yes.
Yea I know?
Okay man use words instead of ur expression 😬
how would you do that?
anyone know?
i suppose i could give them an in_pool function that only allows spawning after the voucher is purchased?
G.P_CENTERS.p_modprefix_key.weight = number?
oh, didn't realize boosters were under G.P_CENTERS!
i created a localization entry now how do i use it?
i guess this just crashes
name needs to be a string, not a table.
just saw that
mb
so im having a bit of a problem here , how can i make the $10 with the color i want and not just that
You would have a localization entry for each effect.
how do I load a full image that covers the screen?
Perhaps.
i got them but now how do i set the current_effect_text to be the ones in the localization entry
how do i just wipe out a card as dirty as possible
how do i increase the ante to win (on a deck)?
G.GAME.win_ante = G.GAME.win_ante + number?
Is there an easy way to create tags based on their order in the collection? (Similar to ace equilibrium from cryptid)
Yes.
Cool, but what is it? Any examples somewhere?
G.P_CENTER_POOLS.Tag?
Where would I use that in? Doesn't seem to work in add_tag
would it be smarter (or more efficient?) -- to make a purchased voucher modify card rates, or instead lock said cards behind an in_pool requiring the voucher to be purchased?
as in, purchasing the voucher should allow these cards to spawn
How does a Joker earn money when scored? I'm using ease_dollars but it keeps crashing
Log?
why doesnt my challenge appear? (i have challenger deep)
hang on, I left all my other mods on and it says that's the problem
Ok, it's not crashing, but it's not giving money either
Code:
SMODS.Joker {
key = 'brandon',
loc_txt = {
name= "Gambling City",
text = {
"{c:chips}+#1#{} chips and earn {c:money}$#2#{}",
"if played hand contains exactly 2 cards"
}
},
atlas = "WombatsObscure",
pos = {x = 9, y = 0},
rarity = 2,
cost = 6,
blueprint_compat = false,
config = { extra = {chips = 100, payout = 5}},
loc_vars = function(self,info_queue,center)
return {vars = {center.ability.extra.chips, center.ability.extra.payout}}
end,
calculate = function(self,card,context)
if context.joker_main and #context.full_hand == 2 then
return {
card = card,
chip_mod = card.ability.extra.chips,
message = 'What is this?',
ease_dollars(payout),
colour = G.C.CHIPS
}
end
end
}
It's because payout doesn't exist.
Also move it out of the return.
why does my challenge do nothing with no name
I moved it out, but now it's crashing again. How do I refer to the right variable?
card.ability.extra.payout
anyone know what the weight of a regular celestial or arcana pack is?
all set thanks
Apparently, to fix this I just had to loop over SMODS.Centers as well.
how do i (not permanently) debuff a card outside of context.debuff_card?
why does my challenger deep challenge do nothing
Can you use the SMODS.debuff_card() ?
how do you change a card's rank
why does my challenge do nothing
What are you trying to have it do?
I'm trying to turn all kings and jacks into queen's but it just crashes when I play a jack
code?
code:
calculate = function(self,card,context)
if context.cardarea == G.play then
if context.other_card:get_id() == 13 then
card = card
assert(SMODS.modify_rank(card, -1))
end
if context.other_card:get_id() == 11 then
card = card
assert(SMODS.modify_rank(card, 1))
end
end
end
what does card = card do here
card in that context would be the Joker. I think you want to pass context.other_card to modify_rank
you need card = context.other_card
thanks gang
bump
What are you expecting it to do?
make the winning ante 1000
i have challenger deep
does anyone know how to change cryptid jokers?
Yes.
i want to make happy house's activation requirement lower for funny
do pray tell
It's still crashing
calculate = function(self,card,context)
if context.cardarea == G.play then
if context.other_card:get_id() == 13 then
assert(SMODS.modify_rank(context.other_card, -1))
end
if context.other_card:get_id() == 11 then
assert(SMODS.modify_rank(context.other_card, 1))
end
end
end
whats the crash?
You would CTRL + F for happyhouse in items/misc_joker.lua from the cryptid folder and change trigger = 114 to trigger = lowernumber
Are you forcefemming the face cards or
yes
Is "win_ante" a defined rule available to change?
yeah challenger deep does that
Assuming challenger deep is another mod?
thanks
I was gonna have a challenge like this lmao
is it possible to use two different atlas' for the same joker? im trying to make a legendary joker with the soul sprite being wider than the regular joker sprite size
I think the issue is context.other_card doesn't allows exist. You may want to try context.individual instead of context.cardarea == G.play
works fine now! Thanks!
bump
I'm honestly not sure. Was looking at the challenger deep examples and from what I can tell, it should work
could be because theres no loc_txt? idk thats all i can think of tbh
its in a localization file
good practice
If it was me debugging, I'd copy the challenger deep example "pinch" or whatever it is that changes the win_ante and see if that one works.
to isolate if its something I'm doing or not
there isnt a example for win ante
"The Pinch" reduces win ante to 6.
Does anybody know how to make a joker scale when any destruction occurs? I tried making a global tracker using :dissolve, but it activates when selling cards.
IE: It scales on jokers like madness, cards destroyed by immolate.
It does not scale when consumables are used, or cards are sold
Can anyone help me with this crash?
can i see 1067 of ur joker code?
add_tag(G.P_CENTER_POOLS.Tag)
need a little more than direct line lol i wanan see how u are using this
it is crashing with the add_tag function
add_tag(Tag(G.P_TAGS.tag_charm.key))
Hook Card:remove()
I'll try, thanks.
How can I cycle through the tags though, instead of just creating charm tag or any other singular tag?
What is the goal?
Add tags from the order in the collection, two at a time, when condition is met.
Is this for a joker?
Yes
card.ability.tagnumber = card.ability.tagnumber or 1
local tags = {}
for k, v in pairs(G.P_TAGS) do
table.insert(tags, v.key)
end
add_tag(Tag(tags[card.ability.extra.tagnumber]))
card.ability.tagnumber = card.ability.tagnumber + 1
```?
Nevermind, it is working, but just not red seals?
I can't get it to work. Should I submit my joker.lua?
Yes.
Card:remove() doesn't have from_debuff
This ends up crashing.
I fixed the code.
Playing Cards isn't a set.
Omg you're right, I did that out of habit from when I made this a debuff joker >_>'
Same error
Refer to this: #💻・modding-dev message
What is that line in tag.lua in the lovely dump?
how could i make a joker that unlocks after a different joker gets destroyed (yes the gros michael function)
It seems this is because context.retrigger_joker_check is not called in SMODS.calculate_context
Where would I find that?
Mods/lovely/dump/tag.lua
what's the context for using a consumable?
function Tag:generate_UI(_size)
_size = _size or 0.8
local tag_sprite_tab = nil
513 -> local tag_sprite = Sprite(0,0,_size*1,_size*1,G.ASSET_ATLAS[(not self.hide_ability) and G.P_TAGS[self.key].atlas or "tags"], (self.hide_ability) and G.tag_undiscovered.pos or self.pos)
context.using_consumeable
Did you start a new run?
card.ability.tagnumber = card.ability.tagnumber or 1
local tags = {}
for k, v in pairs(G.P_TAGS) do
table.insert(tags, v.key)
end
table.sort(tags, function(a, b) return G.P_TAGS[a].order < G.P_TAGS[b].order end)
add_tag(Tag(tags[card.ability.extra.tagnumber]))
card.ability.tagnumber = card.ability.tagnumber + 1
```?
That seems to have done it.
@daring fern I must be dumb, because despite my best efforts, I still can't get it to work
Okay, keeping in mind I started lua 4 days ago: What does that mean?
This guy makes infinite spectrals when a round starts for some reason
if context.using_consumeable then
if pseudorandom('lilico') < G.GAME.probabilities.normal / card.ability.extra.odds1 then
local card = create_card('Tarot',G.consumeables, nil, nil, nil, nil, nil, 'lilico')
card:add_to_deck()
G.consumeables:emplace(card)
G.GAME.consumeable_buffer = 0
return {
card = card,
message = "When you tell it to!",
}
end
else if pseudorandom('lilicoco') < G.GAME.probabilities.normal / card.ability.extra.odds2 then
local card = create_card('Spectral',G.consumeables, nil, nil, nil, nil, nil, 'lilico')
card:add_to_deck()
G.consumeables:emplace(card)
G.GAME.consumeable_buffer = 0
return {
card = card,
message = "I wanna go out with a bang!",
}
end
end
It means you're checking if the cards set is "Playing Cards", which will never be true.
Oh, okay. Nifty.
In other good news, I got it to detect destructions at least (In an extremely janky way, but that's the most progress I've seen in weeks)
I think it finally mostly works now.
figured this out i just checked square jokers code to see what it does :p
bump
What is the issue?
not doing anything aafter beating a blind
not addinf xmult or anything
It's G.GAME.current_round.hands_left
oh
whoops
the rest are fine right
I think so, but you don't need to check for G.GAME.blind, as it always exists, even when you're not in a blind.
mmm fair
if context.end_of_round and context.main_eval
thanks
anyone ever messed with food items? I'm trying to make a Joker that scales when food items are eaten
What, like ice cream? Popcorn? Cavendish?
Is there a way to have a blind automatically fail you?
Anyone know how to use the localization entry so I can set my effect text/description
You can return the correct key you need in the loc_vars return table
nvm, got it i think
can a consumeable give x2 mult to the next hand played, but only once (as it destroys)?
How do you change the formula on how chips X mult scoring is calculated?
how can i make a joker rarity that is not added to the default spawn pool? would i do
SMODS.Rarity{[...], pools = {}}
```?
alright, slowly attempting to figure this out, if i have a global variable like this, would this work?
(ast.operator in this scenario would equal *, for example)
essentially, i'm trying to replace * in hand_chips*mult with a global variable that equals *, essentially replicating the same effect as the original
i want to add code to existing objects
but like, my mod's priority is low so it wont account for items added by other mods unless i hook it to something like Game:start_run
this should be somewhat simple to figure out right
how would one go about inserting a global variable in such a way
hm how can i rephrase this
you know i don't think thats in the right position
almost at the right spot
currently trying to do something like this
whatcha making
i was dared to do this by my past self
oh god
this is gonna be controversial
lmao
i had an idea for a metaprogression joker once
the main thing itll provide is making overscoring lighter on the player
but everyone hated it
this was the idea
i really liked the idea but
i know people hate metaprogression
so i scrapped it
what exactly is overscoring
major mechanic in valk; score too much on the boss blind, you go up extra antes
Okay, I can now do multi-line attention text. Nice
Winter smiley face
me when code works when i eval it but not when i put it in my code
I was surprised this wasn't an already supported feature
hey thats pretty good
I had seen a way to dynamically change a custom Jokers texture?
is that even possible to do? can i save a shop and repeat it like that?
I would check the invariant sticker in Entropy
Hey I know this is from a while ago but did you ever get this to work?
Yeah
would you mind sharing the code?
I'm trying to do something similar for my mod lol
mine just does... this.
Hey, I am kinda stuck with this error for 20 minutes, maybe you guys know what I should do here is the error message,the joker_index and the line 39 :
if HI_UTIL.config.jokers_enabled then
HI_UTIL.ENABLED_JOKERS=HI_UTIL.ENABLED_JOKERS
for_, item in pairs(SMODS.load_file("content/jokers/joker_index.lua")() ) do
table.insert(HI_UTIL.ENABLED_JOKERS, item)
end
end
is there a reason this doesnt work
i dont understand at all
doing eval G.HUD:get_UIE_by_ID("chipmult_op").config.text = "+" works just fine
but when i play the deck this happens
This is possible yes, I've done it multiple times
the Back:apply() function is called before G.HUD is created
Depends on what you need to do
i see
Let's say I have a local int, how easy is it to move the UV depending on it?
You're given texture_coords within the shader effect function, which are essentially just UV coords for a flat quadrilateral image. I have a shader that just shifts the UV up/wraps around over time for a motion effect, so basically easy?
oh sick
Most vanilla shaders do a conversion using the image/texture details to get the full range of values from 0-1, because I think by default, Love2D only provides texture coords in the relative range of the visible part of the atlas
But yeah for a texture that's always displaying the full atlas, I literally just did this:
vec2 upper_coords = vec2(tex_coords.x, tex_coords.y + 0.12);
vec2 lower_coords = vec2(tex_coords.x, tex_coords.y - 0.03);```
I think smods is having a heart attack lmao
How do I fix this lol
It isn't me cause I've undid everything from within the last 10 minutes
wait legit tho it won't go away
I UPDATED SMODS AND IT'S STILL HERE HWAT
I GAVE MY MODE A .LOVELYIGNORE AND IT WORKS???
WHAT DID I DO
i fixed it
for some reason my language being a custom one made it have a seizure soo
What do I do if my game just crashes and exits
Yeah great suggestion
nah but fr what's your mod list
Custom mod
oh
It's my mod thats the prolbkem
what did you add
How do I get my full mod list
if you can't open the game to check add a file to your mod called ".lovelyignore"
Actually I think I found it
"Paya's Terrible Additions"
I removed the mod and it works fine now
this is really weird
it's still not working lmao
I have exactly what you have but mine just errors?
wait it is french
wait what
is it my priority?
Okay it's setting but the modded text is broken for some reason
well im returning the current_effect_text
is this correct btw?
calculate = function(self, card, context)
if context.end_of_round and context.main_eval then
local last_hand = G.GAME.hands and G.GAME.hands.last_hand
if last_hand and last_hand.poker_hand == 'Flush' and last_hand.suit then
local flush_suit = last_hand.suit
for _, c in ipairs(G.hand.cards) do
if c and c.base then
c:set_suit(flush_suit)
c:juice_up(0.6, 0.6)
end
end
return {
message = "Shrimp'd",
colour = G.C.SUITS[flush_suit]
}
end
end
end
}
hello ! I am really intrested in modding balatro but I do not know where to start ? I wanted to make jokers, tags and maybe a few bosses.
If you have any ressources i could check out to learn modding in balatro i would be very greatful
thanks a lot !
anyone know why the progress bar thats intended to display just isnt? ui code & screenshot below
anyone know how i can use the localization entry for my effect text? cause i want the text to be with color
hey why does it crash when i try to view the joker in the game this is what it says how to fix it
code
MODS.Joker{
key = "Painful joke", --name used by the joker.
config = { --variables used for abilities and effects.
extra = {
mult = -10,
chips = 100},
},
pos = { x = 0, y = 0 }, --pos in spritesheet 0,0 for single sprites or the first sprite in the spritesheet.
rarity = 2, --rarity 1=common, 2=uncommen, 3=rare, 4=legendary
cost = 5, --cost to buy the joker in shops.
blueprint_compat=true, --does joker work with blueprint.
eternal_compat=true, --can joker be eternal.
unlocked = true, --is joker unlocked by default.
discovered = true, --is joker discovered by default.
atlas = '"painful_joke"', -- atlas name, single sprites are deprecated.
calculate = function(self, card, context) --define calculate functions here
if context.joker_main and context.cardarea == G.jokers then -- returns total chips from joker to be used in scoring, no need to show message in joker_main phase, game does it for us.
return {
mult = card.ability.extra.mult,
chips = card.ability.extra.chips,
colour = G.C.CHIPS,}
end
end,
loc_vars = function(self, info_queue, card) --defines variables to use in the UI. you can use #1# for example to show the chips variable
return { vars = { card.ability.extra.chips}}
end
key = "Painful joke", --name used by the joker.
config = { --variables used for abilities and effects.
extra = {
mult = -10,
chips = 100},
},
pos = { x = 0, y = 0 }, --pos in spritesheet 0,0 for single sprites or the first sprite in the spritesheet.
rarity = 2, --rarity 1=common, 2=uncommen, 3=rare, 4=legendary
cost = 5, --cost to buy the joker in shops.
blueprint_compat=true, --does joker work with blueprint.
eternal_compat=true, --can joker be eternal.
unlocked = true, --is joker unlocked by default.
discovered = true, --is joker discovered by default.
atlas = '"painful_joke"', -- atlas name, single sprites are deprecated.
calculate = function(self, card, context) --define calculate functions here
if context.joker_main and context.cardarea == G.jokers then -- returns total chips from joker to be used in scoring, no need to show message in joker_main phase, game does it for us.
return {
mult = card.ability.extra.mult,
chips = card.ability.extra.chips,
colour = G.C.CHIPS,}
end
end,
loc_vars = function(self, info_queue, card) --defines variables to use in the UI. you can use #1# for example to show the chips variable
return { vars = { card.ability.extra.chips}}
end```
its SMODS.Joker
not MODS.Joker
also atlas should just be "painful_joke"
not '"painful_joke"'
Have you made an atlas called painful_joke
yes it was the '"painful_joke"' that messed it up
Tried to create a deck which increases the chance of negative cards appearing, yet for some reason it doesn't affect the rate at all and I have no idea why it doesn't work
set to 200x for testing
can someone help me with this please
How could I create some consumables like The Emperor for example ? The only thing I managed to do is buggy and not usable
If more than once, use a for loop that contains SMODS.add_card{ set = 'Tarot' }, if using Tarot cards as example.
I was using create_card ;; it worked, thanks
progress_bar goes inside the config AFAIK
i wish i could help you with MY OWN function, but like
its been a while since i last used it
😭
did you abstract it so much you dont remember how progress_bar works
Oh man doing UI is a whole nother skill
Welcome back the horrors of working with CSS
:3 you can try reading the function's code
i did add this just as a bit for a single joker
its supposed to work like uhhhhhh
i forgot the name, but its a bar you can slide
do you know what you did to do that
do you also have all term memory loss
uuuuhhh i forgot
Speaking of UI
How do yall go about spawning sprites on the screen
How could I check name/set of an used consumable
context.using_consumeable
and uh
the set should be in context.(consumeable? check smods documentation, i forgot).config.center.set
that's the context I should use yes, but what should I put into my context check ?
context.consumeable.config.center.set == "set in here"
Why does that don't work ? It should level up a random hand when a planet card is used, and nothing happens rn
its Planet
not planet
I tried that too, same result (none)
oh
its context.using_consumeable, not context.using_consumable
I
FORGOT THE USING
anyways
Will try that, thanks ! ✨
It worked as intended ! It just level up a bit weirdly in the UI... If anyone know how I could fix that, let me know pls
Anyone know why this isn't doing any repetitions?
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play and context.main_scoring then
for k, v in ipairs(context.scoring_hand) do
if SMODS.has_enhancement(v, 'm_willatro_overgrown') then
return {
repetitions = card.ability.extra.repetitions
}
end
end
end
end
remove and context.main_scoring
Still nothing
what code is this in
A joker
Yep
anyone know how i can have my text be with color , i was told i have to have a localization entry for every effect description , i did that but not sure how i can set the current_effect_text to be the corresponding text from the localization file
mmmggh
theres G.GAME.edition_rate to make editions more likely is there one for enhancements?
No.
Anyone know how to do this?
You set current_text_effect to be the key then you do {key = current_text_effect, set = set}
so is there any way to make enhancements more common like how hone makes editions more common?
Yes.
how?
You would hook every enhancements get_weight function.
What is the issue?
like, im trying to make a card that turns one random card into negative, it works. But, when every card is already negative and its only the card itself remaining the game just crashes
I mean a joker not card
Where is this located?
something like this?
Why?
Yes.
cuz I dont know how lol
lol
What does loc_vars look like?
Just do info_queue[#info_queue+1] = center.ability.extra.current_effect_text
if i do that then Current Effect text wont appear
You need to put name = "Current Effect" in the localization entries.
Is there a check for when a card does the little flipping animation?
I think you would have to hook Card:flip()
another hook...
to be sure bc im still not sure of hooking, is this how I would hook to it?
local oldFlip = Card.flip
function Card:flip()
print("Card flipped:", self)
return oldFlip(self)
end
wait why did i put dots
Yes.
thank you
and now I call for Card:flip() in my joker and when it flips, my hook happens as well, correct?
Yes.
Thank you
oh my, it seems the game likes to flip cards a lot
What context or G. do I use to check if its in the middle of a run?
G.STAGE == G.STAGES.RUN?
fun lovely feature that you all might not know about: https://github.com/ethangreen-dev/lovely-injector/blob/aec360bd8ca86da8191852f469fae4b2940d10f9/crates/lovely-core/src/lib.rs#L378
Am i able to use this to check if a card being destoryed is a heart or should I be using something else?
if context.destroy_card then
Yes.
Their steamodded is quite old.
So i got this, would this work or am i just forgetting how to target destroyed cards?
calculate = function(self, card, context)
if context.destroying_card then
if card:is_suit("Heart") then
card.ability.extra.multgiven = card.ability.extra.multgiven + .2
end
end
if context.joker_main then
return {
xmult = card.ability.extra.multgiven
}
end
end,
if context.destroy_card and context.destroy_card:is_suit("Hearts") then
ohhh, makes sense
in a pack with a mix of types, is there a way to let selected cards go to their respective cardareas? select_card = "consumeables" sends everything to the consumable slot, but if unspecified, cards that are "USE" by default can't be selected at all
i have returned to ask for a fix to this set_ability bug
(example shown: half-joker changing to a full size card)
didnt you solve this yesterday or am i crazy
sorta but since consumables default to use, you can't use consumables that aren't ever usable 💔 so nothing can be done with them
that consumable is usually meant to be in a cardarea, never used
So I was told to come here and ask what this meant cause i'm struggling with loading mods without it crashing...
reinstall cryptid, it does this sometimes for no discernable reason
maybe you can have an exceptions table?
like something for the pack to iterate through of "do not pick this one"
the problem is that in boosterrs, you can only specify a single cardarea for cards to go to by default
OMG THANK YOU THANK YOU!!!!!!!! IT WORKED :D
which works just fine normally, however is a bit strange when jokers go in your consumable slots
of course lol, idk why it does that
oh wait i see what you mean
hmmmmm, maybe, though that feels a bit limiting
could work as a temp solution
this would be how you check to destroy cards, you want after they've already been destroyed right?
i.... i forgot to put the code
I want to check a cards suit before they are destroyed to see if i should add xmult to the joker
but you're not destroying the cards yourself, right?
correct
this would be the relevant context then
ah, okay, ill conver it over to that
yo does everyone use smods still
yeah
ok ty
how can i make to check if a joker at the left of another triggers?
this set ability thing is weird, I definitely fixed it the other month 🤔
i did go ahead and file about the sprite bug i had with it, just in case it is smods
and it's weird cause it's like a one-way door too?? like a standard res can switch to a unique res, but it cant do it vice versa
how can i make a joker unlock from a different joker breaking?
pool flags iirc
oh wait unlock
nvm idk
unlock as in the way cavendish 'unlocks' from gros michael breaking
help
yo is the recommended way to change vanilla functions still wrapping or have you guys got some more fancy ways for that now
what context do i use to check for the end of ante
Does anybody know how to change the title screen like cryptid does? i want to change it so that the mod title card is overtop of the title screen, but have no clue how
(like this)
you could simply create a sprite for that tbh
The process is smth like
but will the background still be moving? or would it go static?
for example, balatro the rock
the background is a different thing
not part of the title
- create a custom logo sprite
- create a hook for the main menu
- write smth to change the sprite
this is the sprite for the balatro the rock thing
It's p simple and you can look at mods that do this
and how do i stop the card in the middle from being movable?
bump
what would i override for that?
I think you check for end of round and if it's a boss round (that's not context tho)
Look at Rocket
yeah ik how to check for boss round
ok ill do so
Find the code for a mod that changes the menu sprite
bump
I mean you can try this
I'm guessing you can also set the weight to 0
gonna ask again; if i wanna be changing vanilla game functions, is the recommended way still hooking/wrapping
I mean it depends on what you mean by changing
If you want smth to wrap around it or occur alongside it then yeah, hooking is recommended
If you want to change a few lines of a bigger function then I think patching is recommended
Is there a way to make a card automatically change sprites on a timer ingame?
this doesnt work help me
or just at all
go to sleep
yes
cant remember what it is tho 😭
how would you store an existing joker's effect in a table?
if possible, ofc
like if i wanted a joker to pick between the abilities of two other jokers, is there a way to do that without recreating the ability of every joker i want it to use?
i might be dumb, what am i doing wrong?
calculate = function(self, card, context)
if context.remove_playing_cards then
for i in #context.remove_playing_cards.removed do
if context.remove_playing_cards.removed[i]:is_suit("Heart") then
card.ability.extra.multgiven = card.ability.extra.multgiven
end
end
end
if context.joker_main then
return {
xmult = card.ability.extra.multgiven
}
end
end,
it would help if i send a crash log 1s
suit is 'Hearts'
yea, still getting the same crash message
hovering the hand in the run info menu crashes
you are supposed to check for context.removed, not context.remove_playing_cards.removed lmao
oh lmao
oh lol
calculate = function(self, card, context)
if context.remove_playing_cards then
for i in #context.removed do
removed = cards_destroyed
if context.removed[i]:is_suit("Hearts") then
card.ability.extra.multgiven = card.ability.extra.multgiven
end
end
end
if context.joker_main then
return {
xmult = card.ability.extra.multgiven
}
end
end,
line 387 is
for i in #context.removed do
ur tryna iterate thru a number
i thought it said it was a table
get rid of # in #context.removed
wait. does # mean to try it as a number, bc i thought it was just a way to get how long it is
oh youre trying to use the index
actually i dont think you need to use the index
for i in context.removed do
removed = cards_destroyed
if i:is_suit("Hearts") then
card.ability.extra.multgiven = card.ability.extra.multgiven
end
end```
istg i will never get used to that for loop
because if you remove the #, i becomes the object of the table you iterate thru
like, i know it works but damn 😭
im too used to i,v or _,v
but also
what the hell is card.ability.extra.multgiven = card.ability.extra.multgiven supposed to do
fuck. i meant to add a + .2
i am still getting this message
whats your code
right
1s
calculate = function(self, card, context)
if context.remove_playing_cards then
for i in context.removed do
removed = cards_destroyed
if i:is_suit("Hearts") then
card.ability.extra.Xmult = card.ability.extra.Xmult + .2
end
end
end
if context.joker_main then
return {
xmult = card.ability.extra.Xmult
}
end
end,
is 387 the is_suit line
im gonna sob
for i in context.removed do
can you just do
for _,v in ipairs(context.removed) do
if v:is_suit("Hearts") then
...
:3
can i...
i think u can
i have my AC on so im chill lol
all good ive seen worse :garf:
true
thank god, i always feel like a bother when i ask for help bc :3
its fineee, you only get better from making mistakes
no ones obligated to answer u so everyone who does wants to help 👍
should the return be Xmult =
i mean, you would be absolutely disgusted if you see my first attempt on a complex joker
both xmult and Xmult work the same
this but with me and Bait and Switch
feast your eyes on mucho texto joker
i made this during uhh the first few days im here lol
looks like a chill guy
lol
hm, i want a message to appear but like, im gonna tweak
ill look at the smods first
okay, now i ask, how do i get the number to appear under the joker?
if context.remove_playing_cards then
for _,v in ipairs(context.removed) do
if v:is_suit("Hearts") then
card.ability.extra.Xmult = (card.ability.extra.Xmult or 1) + 0.2
end
end
return {
card.ability.extra.Xmult
}
end
dont put return in there
oh?
if context.remove_playing_cards then
for _,v in ipairs(context.removed) do
if v:is_suit("Hearts") then
SMODS.calculate_effect({message = "Upgraded!"}, card)
card.ability.extra.Xmult = (card.ability.extra.Xmult or 1) + 0.2
end
end
end
something like this
you wouldnt know if you never knew about its existence before :p
where's the cryptid support server
hey guys, does anyone know how to make a consumable spawn a particular joker instead of spawning by rarity? (im new to modding)
SMODS.add_card{key = "your joker key here"}
thank you so much!
how can i make to check if a joker at the left of another triggers?
i think i failed to comprehend your question
Is there a reason why bp is retriggering a joker instead of doing the effect itself?
like, i want a joker that when the joker at its left triggers, it restarts its mult
mm
one sec
if context.post_trigger then
local pos = 0 --might be a good idea to have this set to 0 by default instead actually
for i,v in ipairs(G.jokers.cards) do
if v == card then pos = i break end
end
if pos > 1 then
local left_joker = G.jokers.cards[pos - 1]
if context.other_card == left_joker then
--do something here, it already checks if the joker on the left of your joker triggers
end
end
end
is it possible to make a specific pool of jokers more common in the shop if you have a joker held?
this didn't work but i just probably implemented custom tarots wrong in my pack
whats the code
also, just in case, i didnt ignore you, i actually dont know how to help with this sorry
you missed a return{} in the last if
but what can i do if i want to sum mult if it doesnt trigger?
return{}?
no, i left it empty on purpose so that you can add your own code in there lol
lol
what bout this?
🤔 sum mult?
i made this
Im looking through the smods wiki and im confused, how could i get it to add a perma 5 chips and 1 mult?
config = {
extra = {chips = 5, mult = 1}
},
-- skipping to the code --
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
context.other_card.ability.perma_bonus = context.other_card.ability.perma_bonus or 0
context.other_card.ability.perma_bonus = context.other_card.ability.perma_bonus + card.ability.extra
return {
extra = { message = localize('k_upgrade_ex'), colour = G.C.CHIPS },
card = card
}
end
end,
local pos = 0 --might be a good idea to have this set to 0 by default instead actually
for i,v in ipairs(G.jokers.cards) do
if v == card then pos = i break end
end
if pos > 1 then
local left_joker = G.jokers.cards[pos - 1]
if context.other_card == left_joker then
card.ability.extra.mult = 0
else
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.multsum
end
end
end```
card.ability.extra.chips
that should increase perma chips
you want to do the same for perma_mult or smt
its ok?
that will make it so if its any other joker that triggers, the joker gains multsum amount of mult
i think its just card.ability.perma_bonus
oh
:tinking
wait
isnt context.other_card correct
its pointing to the scored card
yeah but your card.ability.extra in this case is a table lol
vanilla jokers tend to have extra as a number value instead
^
oh
SMODS.add_card{key = "j_(mod_prefix)_jolly"}
probably not this at all but im giving it my shot
if context.individual and context.cardarea == G.play then
context.other_card.ability.perma_bonus = context.other_card.ability.extra.mult
context.other_card.ability.perma_bonus = context.other_card.ability.perma_bonus + card.ability.extra.chips
return {
extra = { message = localize('k_upgrade_ex'), colour = G.C.CHIPS },
card = card
}
wait, i need to change the extra names
ill try this thanks
no thats wrong 😭
see
if context.individual and context.cardarea == G.play then
context.other_card.ability.perma_bonus = (context.other_card.ability.perma_bonus or 0) + card.ability.extra.chips
return {
extra = { message = localize('k_upgrade_ex'), colour = G.C.CHIPS },
card = card
}
this will increase the chips
mhm
okay, ill try it
if context.individual and context.cardarea == G.play then
context.other_card.ability.perma_bonus = (context.other_card.ability.perma_bonus or 0) + card.ability.extra.chips
context.other_card.ability.perma_mult = (context.other_card.ability.perma_mult or 0) + card.ability.extra.mult
return {
extra = { message = localize('k_upgrade_ex'), colour = G.C.CHIPS },
card = card
}
should be something like this
IT WORKED THANKS SO MUCH
i think it worked, thanks again
now i just need to add the description and that will be finished
Is there any reason my quantum enhancements aren't working with cryptid?
what if I want to define a joker, give a joker a +mult tag or a +chips tag (won't be that, but something similar)
You wouldn’t need any hooks to do that
Just the standard smods stuff
sadly, cryptid
I meant a vanilla joker tho
if that changes anything
So I can't fix it then?
like golden joker or rocket
Take ownership
if cryptid fucked up quantum enhancements on their end, then yeah
its not your fault lol
What doesn’t work about it?
It just, doesn't work? Here's my code, works fine with vanilla, does nothing with cryptid.
if context.check_enhancement then
if context.other_card.config.center.key == "m_glass" then
return {
m_steel = true
}
end
end
Huh weird, take it up with the cryptid guys I guess
How do I edit this code so that the seal only updates the scored card and not every card that has the seal
bump
change card.seal.x_mult instead
In the return part?
change all self.config.x_mult to card.ability.seal.x_mult
No, it is card.ability.seal.x_mult
changing self would change the entire center lol
👋
well it now works properly but now it doesn't update the xmult in the description
Whats the command for joker slots in debug plus
oh wait I can add card to loc_vars, that'll prolly make it work
awh, still only says X1 mult
eval G.jokers.config.card_limit = number
how do i end the round on card sold
The card itself or any card?
card itself
if context.selling_self then
G.GAME.chips = G.GAME.blind.chips
G.STATE = G.STATES.HAND_PLAYED
G.STATE_COMPLETE = true
end_round()
end
```?
ill give it a go
it worked thank you :)
loc_vars doesn't seem to get the xmult for the card for some reason
or well, it doesn't update after the card is scored ig
Just curious Is it possible for a SMODS.deck implementation to implement a specific set up blinds you play in a certain order somehow not sure if anyone has done
Like if you can just set some loop with SMODS blind to have it during a certain ante
is it {C:diamond} or {C:diamonds}?
C:diamonds
Sorry plural just changed
Looks like plural in general
is there a way to add jokers to a spritesheet once its made?
Yes.
how would i go about that?
I don't quite understand what you mean.
whenever i try, it just does this
You have to put it in manually.
Asepite/Libresprite/Gimp probably, in that order.
I use Kirta
noted
i use paint.net to arrange my sprite sheets does that make me evil
i only use aseprite when im actively trying to animate something frame by frame
can i get some help with making a deck im trying to make a deck where everything is negative
just installed that, how the hell do you properly line things up like that?
Just drag and drop, there's a pixel space between the boarders of each card, and two pixels between a card and another card.
does anybody know how to get the steammodded commands to show up as tips in SublimeText?
nevermind i found a tutorial creator
i went to the steam modded page
i'm tryna make a basic xmult scaling joker that starts at x1 goes up by 0.25 at the end of each round, feel like i'm doing a lot wrong though
was looking at vanilla ones like Glass Joker and Yorick but i think it was just confusing me further
You are attempting to perform arithmetic on card.ability.x_mult and card.ability.extra.xmult, which both don't exist.
You returning mult_mod instead of xmult
how do you get the smods commands autofill?
You put it in your workspace.
i'm still a bit lost sorry, i had this scaling chips joker made and was just tryna base the main scaling gimmick off this but i don't really understand what you're supposed to do for the xMult equivalent of what chip_gain does
i changed mult_mod to xmult but i'm still struggling to make this work
how hard is it to make custom jokers? I know a bit of lua and have played with love a little bit
i've gone into it with no lua or really any coding experience outside of very very basic python but it's not too bad at all imo
oh theres even a starter thing, thanks
i can only add folder to project
not workspace
do i save the workspace first?
I'm away from computer at the moment, just wanted to link you the picture when I saw the shrug emoji. You might just have to try a few things
Are you using VSCode or Visual Studio?
Sublime
Text
do i use vscode instead?
im in vscode
i added the folder
it gave me 2000 problems
how would i make a joker that adds +1 to all probabilities when triggered?
and then reset those probabilities in a different context?
There is no current way to do that without breaking with oops.
changed it a bit but it likes causing this crash message that i don't understand, still think i'm just doing it wrong anyways cuz it's showing up as xnil in the in-game joker info
Remove the message.
how do I change one of the values on my joker after or in the return? or something equivalent
Use func
alr
still crashing
idk why i thought you meant delete the attatched error message initially
Log?
i just get this when the joker is taking up a joker slot during a round
where could i find docs or something on how to make shaders for an edition?
hellooo i am currently trying to debuff a random card when blind is selected and i have it selecting the card just fine (tested this by having it return the name of the rank) but the debuff itself isnt happening. is there a different method i need to use?
SMODS.debuff_card(card, true)
That just tells the blind to check if it should debuff the card.
it crashes saying table index is nil, did i just implement it in a weird way?
Log?
SMODS.debuff_card(card, true, "source")
how exactly do i go about changing this title screen
yay i made my first joker
Do I explicitly need opt_callback to "save" changed values from create_option_cycle?
i have the sprite made, i just cant for the life of me figure out how to get it into the game
...sounds like use of SMODS.Atlas with path set to the target file, but the key being balatro and raw_key parameter being true.
misspelled consumable
i didnt make the mod
oh
No, consumeable is correct.
-# I typoed in the actual code, oops.
ah the man himself
is it the wrong consumable because i see both consumeable and consumable
consumeable is correct in Balatro.
a deck's apply function happens before UI is initialized, how do i make a ui change at the very start of a game?
but consumable is also correct
I edited the https://github.com/TheOneGoofAli/TOGAPackBalatro/blob/9811e301350971413834c5f7dd1187977667c9e8/togastuff.lua#L737-L745 part directly via browser, please grab just this file and replace.
That's correct in things that aren't Balatro
i see
ah thanks
That's just the reference name I gave the variable... I just didn't use exactly it by accident.
It's like if I named it fart, but used farts.
would you prefer doodoofart
...christ, though, my stuff amidst the mfkaa?
that worked... do you know if theres a way to get rid of the ace in the middle?
or hide the card there altogether?
G.title_top.cards[1].states.visible = false?
where would i be putting that?
In a Game.main_menu hook perhaps?
i really gotta organize my code
i made the mistake of using main.lua for jokers.. its such a mess
maybe a counter intuitive question but is there a way to have a joker recognize when a debuffed card is being scored in the same way that like greedy joker or walkie talkie would
Yes.
Is there a way to check if a card has any enhancement?
Yes.
i tried, but couldnt figure out how to set that up for the life of me
And that would be...?
if next(SMODS.get_enhancements(card))
Many thanks
local oldmainmenu = Game.main_menu
Game.main_menu = function(change_context)
local g = oldmainmenu(change_context)
G.title_top.cards[1].states.visible = false
return g
end
```?
Where would I find it then?
How would I retrigger a joker?
Been scouring smodsland but having found anything for debuffs
You would first enable it, then return repetitions in context.retrigger_joker_check
I mean a seperate Joker
local retrigger_joker = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then
retrigger_joker = G.jokers.cards[i + 1]
break
end
end```
local oldmainmenu = Game.main_menu
Game.main_menu = function(change_context)
local g = oldmainmenu(change_context)
for k, v in pairs(G.title_top.cards) do
v.states.visible = false
end
return g
end
```?
I'm getting the joker to the right
Yes, context.retrigger_joker_check is the only way to retrigger jokers.
How do I use that? (sorry I'm still kinda new)
You would have to patch then.
if context.retrigger_joker_check then
return {repetitions = 1}
end
im trying, i just have no clue what im doing with it since i havent done any non-gameplay stuff yet..
wouldn't this retrigger the main Joker?
I'm trying to make it retrigger the joker to the right
G.title_top.cards[1].states.visible = false works after everything on main menu settles down... otherwise, the start_materialize function overrides that.
No, it would retrigger every joker 1 time.
lol