#💻・modding-dev
1 messages · Page 606 of 1
local function bear5check(card) -- possibly my messiest script
delay(2)
local continue = false
local checks = {{bool = false, other_card = nil}, {bool = false, other_card = nil}}
for _, v in ipairs(G.jokers.cards) do
if v.config.center.key == "j_tngt_dingaling" then
print("dinaling")
checks[1].bool = true
checks[1].other_card = v
if checks[2].bool then
checks[1].other_card:remove()
checks[2].other_card:remove()
SMODS.add_card {
key = "Bitters_BEAR5",
}
break
end
elseif v.config.center.key == "j_Bitters_goldding" then
print("golden")
checks[2].bool = true
checks[2].other_card = v
if checks[1].bool then
checks[1].other_card:remove()
checks[2].other_card:remove()
SMODS.add_card {
key = "Bitters_BEAR5",
}
break
end
end
end
end
why does this being called from add_to_pool or from context.card_added cause it to ignore the card that was just added, even with delays it doesnt work (and yes i know why now) but i dunno how to get around this problem
bear 5
how do fix bug where the celestial booster packs combine together and do weird shit?
yes bear5 but why does bear5 not add properly
is it possible to completely change a playing card into a randomly picked new card? i know of create_playing_card but can't seem to get it to work for my purposes
maybe SMODS.change_base in https://github.com/Steamodded/smods/wiki/Utility#mod-facing-utilities
tried that, didn't seem to work
could be a problem with the outer function
here's what i have
for k, v in pairs(context.full_hand) do
if v.debuff then
G.E_MANAGER:add_event(Event({
delay = 0.4,
func = function()
SMODS.change_base(v, pseudorandom_element(SMODS.Suits, 'test'), pseudorandom_element(SMODS.Ranks, 'test'))
v:juice_up(0.3, 0.5)
return true
end
}))
end
end
the juice_up seems to be going through but not the change_base
ok never mind i missed the part that said to wrap it in an assert() and am seeing the error
why does
self:remove()
not remove the card and instead resulting in a crash?
and how do i fix it
card:remove() i think
pretty sure self is the card's center
(assuming this is a calculate function)
@wind steppe uhhh
i mean it kinda was a calculate func but it was a local function called from calculate
Code?
YANDEREDEV?!
local function bear5check(card) -- taken from joker forge dont @ me
if (function()
for i = 1, #G.jokers.cards do
if G.jokers.cards[i].config.center.key == "j_tngt_dingaling" then
print(G.jokers.cards[i])
G.jokers.cards[i]:remove()
print("Found Dingaling")
return true
end
end
return false
end)() then
-- print(self)
card:remove()
G.E_MANAGER:add_event(Event({
func = function()
SMODS.add_card({key = "j_Bitters_BEAR5"})
return true
end
}))
end
end```
you should also be removing it in an event i believe
this doesnt work, what am i doing wrong iwth my code?
im obviously not doing something right
It's context.other_card.edition and context.other_card.edition.polychrome
thanks
Would Smods have anything close to function SMODS.content.set_debuff(card)? I was told to reference Bunco, and this would seem to be as close to my answer as I can but Smods isn't accepting it, for obvious reasons
You mean SMODS.current_mod.set_debuff?
I guess so? I'm not sure
All I know is Bunco has function BUNCOMOD.content.set_debuff(card)
Yes, BUNCOMOD.content is SMODS.current_mod
Ahhh, okay
So how would I get this to work then, because it says SMODS.current_mod.set_debuff(card) is invalid
Yes, you need to define the function.
I did as debuff, for example, and still had a red line
SMODS.current_mod.set_debuff isn't a function you call
it's a function you define, and the game will automatically handle it by calling the function during regular gameplay
How do I check for if there's a certain amount of a consumable?
(not for the overall number of consumables, but for a specific set and for a specific number)
loop over G.consumeables.cards, check each card for if it's what you're looking for, and increment a counter by 1 if it is
if #SMODS.find_card('c_modprefix_key') == number
Again, thank you.
how would I go about defining one? I see in Bunco for example it has (below) at the very top, is it just that easy...?
BUNCOMOD = {vars = {}, funcs = {}, content = SMODS.current_mod}
local config = BUNCOMOD.content.config
that's not what i'm talking about
I'm confused what I'm looking for then
hang on i'm trying to find an example
this is how paperback makes it so that the new Sleeved enhancement can never be debuffed
this is code just in the main file of the mod, not inside any other definitions
Uh, it's not working. Mind if I just show the whole code?
can you not use has_enhancement in set_debuff
definitely should if you can
key = 'lhc',
atlas = "My_Way_and_The_Highway",
rarity = 3,
pos = { x = 3, y = 1 },
cost = 10,
blueprint_compat = false,
calculate = function(self, card, context)
if #SMODS.find_card('c_xiferp_Element') == 2 then
local el_sum = 0
for _, xiferp_Element in ipairs(G.consumeables) do
el_sum = el_sum + xiferp_Element.element_no
SMODS.destroy_card(xiferp_Element)
end
if context.after then
if el_sum <= 106 then
local element_cards = {}
for k, v in pairs(G.consumeables.cards) do
if xiferp_Element.element_no == el_sum then
table.insert(element_cards, v)
end
end
SMODS.create_card(element_cards)
end
end
end
end
}```
Card appears, but not fusing the cards it's intended to fuse (nothing happens)
I use it.
Also using mine as an enchantment, so instead of card.ability what would I look for, or would it still be that?
yea see what ali just posted
Yup, just saw lol
Okay, so I have this so where do I go from here?
SMODS.current_mod.set_debuff = function(card)
if SMODS.has_enhancement(card, 'DRY_oddity') then return 'prevent_debuff' end
end
it should be "m_DRY_oddity"
other than that, you're done
So will need nothing secondary? Just this
yep
Won't need to call that anywhere?? Sorry, its just weird that I've only needed to do it once lol
again
SMODS/the game calls it frequently during the regular gameplay loop
Got it, shall test now
May I have some help?
the answer somethingcom gave you only works for checking for a specific card like "Lusty Joker", not a whole card type like "Tarot Cards". you need to do what i explained, which is looping through G.consumeables.cards and checking each one for if it's of the type you're looking for
Well, anywhere you can point me to help with that?
works, thank you :)
to be more specific, "looping through [table]" means doing for i, v in pairs(table) and doing something on v in the loop (v will be each element of table)
you should be able to figure out how to check if a card is an element card. use the documentation and vanillaremade, i believe in you
would there be a more efficient way to note down every single suit/rank combo played in a run aside from literally just a gigantic fucking table
i doubt it
key = 'lhc',
atlas = "My_Way_and_The_Highway",
rarity = 3,
pos = { x = 3, y = 1 },
cost = 10,
blueprint_compat = false,
calculate = function(self, card, context)
local element_cards_held = 0
for i, v in pairs(G.consumeables.cards) do
if SMODS.consumeable.xiferp_Element == true then
element_cards_held = element_cards_held + 1
end
end
if element_cards_held == 2 then
local el_sum = 0
print(el_sum)
for _, xiferp_Element in ipairs(G.consumeables) do
el_sum = el_sum + xiferp_Element.element_no
SMODS.destroy_card(xiferp_Element)
end
if context.after then
if el_sum <= 106 then
SMODS.add_card { set = 'xiferp_Element', element_no = el_sum }
end
end
end
end
}```
gonna see if this works
alright lmao
Attempting to field 'consumeables'
you need a context check for your calculate function
The game says the error is inif SMODS.consumeable.xiferp_Element == true then
my statement still stands but it's not the cause of this crash
have you considered that what you're trying to do in that line is completely nonsensical
Not until you said something.
Any better way to put what I'm trying to do?
remember a bit earlier when i explained how looping through tables worked
and how v in the loop will be each element of the table
Uhhuh
think about what the specific table you're looping through is
and what each element would be
and then think about what you want to do to each element
and do it to v
oh. we're doing the check on v
if v == xiferp_Element then
element_cards_held = element_cards_held + 1
end
end```
So like this.
you're getting closer at least
but that's not how you check if a card is of a specific set
if context.post_joker then (also, context)
again, read some documentation and check vanillaremade for similar situations
no
what do I put for it?
when do you want this code to trigger?
after the round
so go check the Calculate Functions documentation on the smods wiki for a context that happens at the end of the round
if G.consumeables.cards.ability.set == 'xiferp_Element' then
element_cards_held = element_cards_held + 1
end
end```
Almost there, I think
.
Oh. Woops
The code I took that from went
if G.jokers.cards[i].ability.set == 'Joker' then joker_count = joker_count + 1 end
end```
(Abstract Joker)
see above
you can figure it out
I just wanna see if it works, the preference is just getting the spaghetti edible.
Okay, the first part works
except for if G.consumeables.cards.set == 'c_xiferp_Element' then which aren't counting
slow down and think about what that line means
G.consumeables.cards is a table containing all the player's consumables
gifs are blocked
uh-huh
so you see how G.consumeables.cards.set is meaningless, right?
ah.
i want to be sure you genuinely understand why it's meaningless
Because I am looking at a set of a set?
no
because set is a property stored in an individual card's ability table
and you're not even looking at an individual card right now
okay.
so think about how you're getting an individual card
...I'm not
you can figure out how you would get one
it's literally right in front of you, whether you're using the loop structure i suggested or looking at vanillaremade abstract joker
ability.set?
yes, but on what
cards[i]
give it a try
i'm trying to teach you fundamentals in problem solving and software development, it's gonna take a while lol
but the flipside is that ideally you come away with a better idea of how to figure out how to do what you want to do in the future, and therefore ask less questions in here in the long run :3
That's a bold mission statement, but alright then.
The set is supposed to be 'modprefix_key' right?
i'd much rather do that than just write all the code for you and you learn nothing and the pattern keeps happening
you can use debugplus to check the actual values in-game of things you want to check in your code
hint: dp.hovered is the individual card that you're currently hovering over
I'm using print(the_thingy) for it, and it says 0
you're probably printing the wrong thingy
but i don't know that because i don't know what thingy you're printing
must be altering the wrong thingy
cuz I'm printing the right thingy that's supposed to start at 0
ok, then that's unrelated with what i suggested
you asked if a value was supposed to be a certain thing, and i told you how to go find what that value is
I'm trying to do trial and error bug fixing, as you're teaching me
it works, it does sum to 2
1 + 1 = 2
hooray, I've passed preschool!
now to part two of three of the code: the adding element numbers.
It's breaking again. Okay, work this through. Wait. sell_cost isn't set in the jokers directly...
Oh. There's my issue.
Now how do I fix it?
Idk, Imma bed down.
sell_cost = cost / 2... where?
where's it set?
what are you looking to do
add two element card numbers together
currently they're on the same sort of setup as cost on normal jokers
so you're trying to make their sell cost lower?
I was hoping to use swashbuckler, but it does sell_cost, which isn't a variable and is based of cost ppresumably directly
no. unrelated.
wdym add two element card numbers together
unrelated in the point of what I'm aiming to do
I have consumables, based off elements, that I am attempting to fuse into heavier elements by adding their atomic numbers.
want me to send an example element?
so you're trying to basically combine two consumables together?
Not in the way I think you're thinking.
okay well i don't get what the end goal of adding atomic numbers is
here, imma post an element as example
SMODS.Consumable {
key = "helium",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 15, y = 0 },
unlocked = true,
discovered = true,
element_no = 2,
can_use = function(self, card)
return true
end,
loc_txt = {
name = 'Helium',
text = {
'Adds +5 chips to your next hand.',
},
},
use = function(self, card, area, copier)
G.GAME.xiferp_nobelgas_chips = (G.GAME.xiferp_nobelgas_chips or 0) + 5
end
}```
See the element_no? that's what I'm trying to add together.
would you not set that as a config variable
hm. I can
if it is a config variable, just add those together
would that make adding them together easier?
you would be able to index it pretty easy
so making elements of certain numbers will be easier?
just (card).config.element_no or something similar
i'm not sure what this means
finding a card that has element_no at an exact value.
assuming nothing changes its config externally it should be easily accessible
beautiful.
if i get what you're saying
then please explain what you think I'm doing/
honestly i don't know
either way having it defined in the card config should be easier
okay. so how do I set el_sum = el_sum + xiferp_Element.element_no to only read the config variable?
it is just el_sum = el_sum + xiferp_Element.config.element_no?
cuz it didn't see to work
imma come back to this later.t
Oh hey that's what I'm looking for!
yoinks code
This isnt working
The local text says its description
card:set_edition(poll_edition(nil, nil, true, true))
why do they have pronouns
Card pronouns api
How would I change the playing cards appearance?
what I want to do is a deck that at some point in the run changes the deck skin, but I dont want to make those cards a deck skin
G.FUNCS.change_collab
do I have to give that function the key of a deckskin or a file? I'd assume the first
or probably none of the ones I said considering my guesses are always wrong lmao
No, you would give it a table of values.
what values do I have to put on the table?
{cycle_config = {curr_suit = 'modprefix_suitkey'}, to_key = 'modprefix_deckskinkey'}?
thanks for the help
why is my main end not showing up
main_end should be outside of vars
genuinely dont understand the API for objecttypes
how do you use ConsumableType.create_UIBox_your_collection(self)???
how do you get the table FOR the consumable type
this isnt needed usually
idk what it does but the collection page is already done automatically
oh i know im making a custom menu for it
oh ok
well you need to have a create_UIBox_your_collection field on the consumabletype
and then in there return a uibox (see ui page)
I do??? i thought since its an API method it would do it automatically
yeesh okay nevermind ill have to do it manually again then
ALSO how do I call on the consumabletype
like genuinely how do i access it
well the default menu is automatic
G.P_CENTER_POOLS.<key>, or with the key in an SMODS.add_card or smth
ive never gotten it
is it like
SMODS.ConsumableType[key]
I SEE
What the hell why doesnt it say that on the wiki page ðŸ˜
oh well thank you so much
Hey yall, I haven’t started coding yet but if a joker gave X5 mult if 5 cards with the same enhancement are scored, would you say it’s an uncommon or rare joker?
yea
how do you get your mod on BMM (balatro mod manager) or something?
does "2." mean I couldn't use art/tiles from minecraft per se?
How can I make Legendaries appear in the shop?
where is the code handling the Y coordinate changes when i select a card
chat how do i add colors
local color = HEX("hex code without the hashtag at the start")
would i be able to use it anywhere?
if you make it a global yes
so global color = HEX(insert hex code)
lua doesnt have a global keyword so you can just remove the global at the start
oke
How can I access elements of the shop? E.g.: check if an offered card is a Joker, and if it is, do something with it?
i reccomend to put it in G.C for simplicity
so if wanted to add ff99dd
and assign it as a color for "miracles"
G.C.MIRACLES = HEX("ff99dd")
you still have to register the color for whatever you want it to do yourself
and how do i use it
i mean you can use it in a lot of ways
like in local text and messages
oh
specifically this part
How would I check if a card was copying another card like Blueprint or Brainstormd oes
i think you can just hook SMODS.blueprint_effect for the majority
having this rule and then listing pokermon as an example is very funny on their part
ah.
the top shop area is G.shop_jokers
I wouldn't worry about it my mod is based on copyrighted material and it's there
Alrighty then.
Thank you!
n
goldenleaf
can you assist me
depends
on?
the problem
this one
sorry i thought you saw it i guess i shouldntve assumed that
CardArea:align_cards it seems
thanks
Best way to play sound upon joker trigger
how do i make the tooltip for the sun
okay i got somewhat of a result for hard set t
i have no idea on how to make it hold though
ooh yeah, I've struggled with this before too
share your wisdom
local center = Moveable(10, 5, 1, 1)
center:hard_set_T(10, 5, 1, 1)
for _, pcard in ipairs(cards) do
pcard:set_alignment({major=center, bond="Weak"})
end
I did this
but this is pretty weird and probably far from the best way to do something like this
(I am moving cards to a specific point on screen)
you might be able to instead just set the alignment on each card to be bond="Weak"
without creating a Moveable
perhaps
i am NOT familliar with balatro code lol
what are you trying to do btw?
does that mean they should be slightly further up when unselected?
wdym
what do you mean by 'making the cards stay injogged'
making their positions slightly lower
I see
ideally permanantly until uninjogged
well actually then you should probably look into lovely patching the function N' mentioned above, CardArea:align_cards()
specifically changing this according to the card's state
What's the issue with my create_card? It completely breaks fool even though it shouldn't be affected as it's not in the "Joker" set, so in that case it should just return whatever it was trying to create in the first place
so theoretically could i check if card.injoggen exists and add an value to y if it does?
yeah I'd try that! might cause a slight problem with reloading a run, but hooking Card:load() and Card:save() to add card.injogged would be an easy fix
np! hope it works :)
that doesn't seem like the right function signature for create_card(), is it? As in, vanilla create_card() takes the arguments _type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append, not just area
I just saw a similar example with create_card_for_shop, and used that, except removed the _for_shop part as I want Buffoon and generated Jokers to be replaced with Legendaries too
For the most part it works, only doesn't handle the Fool too well
Should I make it create_card("Joker", area)?
okay this isnt doing anything, do i need to call anything to make it display?
No, thats not how hooks work. You have to keep all of the arguments
are you setting card.injoggen?
yes
its here
And @latent perch
Thank you!
I added all the arguments, and it seems to work!
yipee! :)
this is how im setting injog
the variable says injogged jokers because im an imbicile and forgot what i was coding for a minute
but its playing cards
relatable :p
my intuition tells me to check whether hoveredcard is actually the right thing
no idea if that's the problem though
hmmmmmmm
the patch should still work though I think
like the pattern target should be the same
in theory
actually nvm
what
card.T.y = self.T.y + self.T.h/2 - card.T.h/2 - highlight_height + (G.SETTINGS.reduced_motion and 0 or 1)*0.03*math.sin(0.666*G.TIMERS.REAL+card.T.x) + math.abs(0.5*(-#self.cards/2 + k-0.5)/(#self.cards))-0.2
card.T.y = G.hand.T.y - 1.8*card.T.h - highlight_height + (G.SETTINGS.reduced_motion and 0 or 1)*0.1*math.sin(0.666*G.TIMERS.REAL+card.T.x) + math.abs(1.3*(-#self.cards/2 + k-0.5)/(#self.cards))^2-0.3
above line is the booster pack alignment
below line is the regular hand alignment
the patch needs to target the lower line
alright
wait other way around lmaop
yay :D
Hi friends. Today I've got something unrelated to my own mod, it's with the game itself
There's this weird thing that's been happening, where two things are supposed to happen at the same time, but instead happen one after another
One instance of this is with gold seals
The gold seal displays "$3" when it's played, but it only gives me the $3 after it's displayed, when they're supposed to happen at the same time
Does anyone have a shred of an idea of what's going on?
That is how it has always been. Why is this even a problem?
Actually, I dont want to gaslight you, so maybe just verify game files and try again
Another one is with Cavendish
Normally, it says "extinct" and the card disappears at the same time, but i've been seeing it do one after another. is it possible I've just been working with some QoL mod?
smods has changed some timings iirc
i feel like I remember hearing about money timings being weird a while back, and I figure cavendish timing is related to some combination of the new probability API + the food jokers having different destruction effects than vanilla
ok
well there's one more thing that's definitely not normal
you know how when the game boots up with the animation of the cards flying into the center
and there's like 3 or 4 audio tracks with sound effects that overlay on top of each other
well when i've been booting up the game those audio tracks have been going one at a time
and it's delaying the rest of the game audio from even playing
SMODS timing wackiness iirc.
any way for me to fix it?
No idea. ¯_(ツ)_/¯
heck
What’s your smods version?
1.0.0-beta-0827c
oh there's a new update?
how often is smods updated?
ideally about once a month I think?
It depends on how busy I and the rest of the team are
I strive for a fortnightly release schedule in an ideal scenario
Fortnite 🤯
how do i play a sound at mod/assets/sounds/sound.ogg?
if i just do play_sound('sound') it'll crash with Could not open file resources/sounds/portal.ogg. Does not exist.
ik i could just put it in resources/sounds/ but is it possible to play it from elsewhere?
You're supposed to register the sound, then use the modprefix_key as input for play_sound.
oh
SMODS.Sound({key = "duck", path = "duck.ogg"}) would be assets/sounds/duck.ogg... and as my prefix is toga, the full string is toga_duck.
after i played a hand it crashed? (im tryna make it where at the end of hand it changes all played cards into a random rank and suit)
This crashes the game and it says that something entirely unrelated gets a nil arguement. I have no idea why this could happen
No, use SMODS.change_base, also pseudorandom_element exists, also you should be getting an element from SMODS.Ranks and SMODS.Suits
whats psuedorandom_element do?
No, you need a context check also it's Consumeables
also SMODS.change_base here?
picks a random element from a given table
No, it's SMODS.change_base(card, suit, rank)
how would i get a random thing from SMODS.Ranks/Suits?
pseudorandom_element(SMODS.Suits, 'seed').key
alr thanks
and that'll return sometehing like "S" right?
No, it would return 'Spades'
and that's a format suitable for use in change_base :)
No, it's card, suit, rank
I did both things and it just crashes when playing the card instead lol
Did you change it to Consumeables?
I see now, I forgor to change 1 bit of old code
I test
@daring fern
It placed it in the Joker slot, interesting
Have you tried using context.full_hand instead?
I fixed it though
whats that?
-# i mean when is it true
i want it to change all played cards after all of the cards finished playing (end of playng card).
Yes, it is all of the played cards.
No, it replaces G.play.cards
what?
I need this joker to give X0.5 mult per 10 in the full deck but I can't get it work ðŸ˜
Like the art and joker are in game, but it doesn't detect any of the 10s for some reason
-# srry about the quality on the image
how does _count_tens() look like
Maybe look at the cloud 9 code and see if that helps
have you considered checking how cloud 9 works in vanillaremade
(if card.rank == 10 is not the correct way to count 10s i'm pretty sure)
also your return table is overcomplicated, you can just return { xmult = total_mult } and it'll handle the message automatically for you
Ground 8
Didn't think of that before
Air 7
for SMODS.add_card, is there a way to exclude a rarity or pull from multiple different rarities? i want it to create a card that is specifically either common or uncommon
Folks, is anyone here familiar with shaders?
What even are shaders
editions, sheens on the packs
Oh
Why base look like that
Oh
what for
Maybe
smods is acting up
none of my mods are loading
i updated smods and now it's just vanilla balatro
wait
no i fixed it
ok the mods are loaded now but it's doing the thing where the audio tracks for the intro are all playing one at a time
To add a sheen effect to my edition (like a booster pack)
+make overexposed corner less bright
that's will give an effect that you are looking at an old Photo
What do people even use to code things in
SMODS.add_card({ set = 'Joker', rarity = pseudorandom_element({'Common', 'Uncommon'}, 'seed_here') })
vscode
I wanna try modding in a simple blind, I make simple ones so one of mine should be enough
However I have no experience coding
oh ty :)
learn the basics of lua, check smods blind documentation, see how vanillaremade implements vanilla blinds
Idk how to do any of that
the pseudorandom_element() part just selects either common or uncommon at random, you can set that to a single string for a guaranteed rarity
you can figure it out
we can't handhold ya the whole time
where can i find the github for vanilla remade or whatever the mod that's used for examples is
oops
What kind of sheen exactly?
thanks
I just told you I have virtually zero experience, I've been told to figure it out myself before and it went nowhere
The SMODS Shader examples have a golden shader with a sheen comprised of sharp stripes
the /src/ folder has the files you need
yea
It's like trying to make someone learn perfect english without telling them the rules
you'll need to learn coding basics, again, learn the lua language. google "lua tutorial" or look it up on youtube. if someone says to learn lua you can just google "how to learn lua"
we're not directing you to specific resources because they're incredibly easy to find yourself
you can google these things easily
Like Negative/Booster packs but in a way so that the colors themselves are not affected since I ran into a problem that the Negative sheen makes certain colors on certain Jokers reflect light (sheen wave) while I need the sheen waves to go over any colors on Joker equally without "highlighting" certain parts/colors
See this card? I need a sheen wave (like on Negative) to go over the joker when you hover over it BUT without "highlighting" certain colors with the sheen
(you see how sheen wave highlights only the background)
or just makes that color reflect sheen more effectively
idk how exactly does this work
just describing what I see
That's exactly what I need but
I need it to be wiggly and smoooth like Negative/Booster pack sheen
Sharp stripes look a bit awkward
Also a lot of the example editions dont take into account Hologram
for whatever reason
I think it kinda looks cool
that's a bug
It doesnt look as cool when it happens to other editions
including mine
.lua files
ah 
shaders use .fs format
iirc
I'm just trying to implement a simple blind
mb
I wasnt following
Do I gotta edit some existing file or do I start a new one for it
Im not a coder, sorry
I mostly only draw pixel art

from what i know from how people organize code i'd put the blinds in their own file or folder
bump
Ok
Editions don’t apply to soul sprites by default, same as legendaries
Is that overlapping intended then?
Does anyone know how sell_cost is set?
wait, I think I found it... self.sell_cost = math.max(1, math.floor(self.cost / 2)) + (self.ability.extra_value or 0) from Astronomer joker
Ig it was just not accounted for in the example
Oh it’s just not doing the hologram sprite properly I see what you mean
👌
I dont know why this Joker isnt doing any of it's effects. It is supposed to do a version of the Blue, Purple ,Gold, Green ,and Azure Seals randomly whenever a card with a Red Seal is triggered.
roll doesn't exist after the fourth if.
What's the tool people use to test specific things
Like giving themselves specific jokers or going to specific blinds for testing purposes
Debug Plus?
DebugPlus is a mod by WilsontheWolf which both reenables Balatro's built-in debug mode and adds several additional debug features. It only requires Lovely, but will take advantage of some Steamodded features if present.
I found debugplus by wilsonthewolf and debugplusplus by jogla
I see what you mean and fixed it. I moved it before the psuedorandom is rolled.
Use debugplus. I dont know much about plusplus, but it isnt neccesary
debugplus by wilson
Ok
i've heard good things about debugplusplus but it needs debugplus anyways afaik
and also it's not really necessary
Also how do I connect blind code to visual assets
wdym
is this about Cryptid's The Clock
No I mean how do I connect a blind's design to its code
what are you trying to do
Add a test blind (first time)
you're just trying to make a blind?
you're looking for src/blinds.lua
does anyone know any resources for learning how to mod
check second pinned message in modding chat
ok thanks
I copied the code of the goad is this good for a blind that'll debuff lower ranks
No, debuff can only debuff one rank.
So I have to copy the line 4 times albeit with a different rank each time
No, you have to use context.debuff_card
orange cat what do yall think?
No, you have to use the calculate function.
So calculate, then context.debuff_card, then list the ranks
I tried improving some things
calculate = function(self, blind, context)
if context.debuff_card and (context.debuff_card:get_id() >= 2 and context.debuff_card:get_id() <= 5) then
return {debuff = true}
end
end
o
SMODS.Blind {
key = "Test",
dollars = 5,
mult = 2,
calculate = function(self, blind, context)
if context.debuff_card and (context.debuff_card:get_id() >= 2 and context.debuff_card:get_id() <= 5) then
return {debuff = true}
end
end
pos = { x = 0, y = 13 },
boss = { min = 1 },
boss_colour = HEX("FFFFFF")
}```
anyone know where text movement is defined and how i'd make my own?
actually this is probably a basegame thing not a smods thing
i could look on my own
text movement in descriptions?
there's a new smods feature for that in the last update lmao
its SMODS.DynaTextEffect but there are no docs yet no
is there a way to make a sprite w/o a shadow (or draw it without one, if its part of the dissolve shader i dont remember)
i assume you just use love2d's functions, aka what balatro runs on
card.no_shadow = true
iirc
oh you mean like
its not a card its just a sprite itself
yeah then love2d draw hopefully should work
trying to make a censor-like drawstep layer
i mean i could do that but then i have to fiddle with positions and whatever
do sprites have shadows by default?
whi is it green
they appear to
text editor formatting
unelss i fucked up somehting when i copy+pasted my halo drawstep code
whats the code
i do think this is part of the soul sprite code
jabon
but i have soul sprites without shadows
but all my other ones are yellow.
SMODS.Atlas, SMODS.Joker all of those ar eyeelow\
hold on
it being green shouldnt matter
im still running from when i didnt have the censor in ignored keys
let me see if just adding it fixes it
so dw
well on another note, it doesnt even show up
ah
yea no it just has the shadow
one of these 2 is the shadow im pretty sure
ok what did I do
it's yellow when you create an instance. that's because it's treated as a function call when that happens
It's SMODS.Blind{ not SMODS.Blind = {
oh mb
whoops I didn't even read up far enough to see that
also the crytpic crash fixed cuz i cant fucking code
looks cute :)
scaling for exponential mult Is emult_mod right?
Emult_mod for no message, emult for automatic message and sound
I’m currently using SampleJimbos as a framework for the mod I’m working on. Is there a better framework to use than this?
what is samplejimbos
VanillaRemade exists
I guess that answers my question lol
yeah just use vanillaremade as a reference for like everything basically https://github.com/nh6574/VanillaRemade/blob/main/VanillaRemade.lua
it has everything from vanilla remade with smods api
Do you guys know how to get Visual Studio to recognize smods and do that thing where it auto fills and lets you know if there’s errors?
I forget what that’s called
I see
key = 'lhc',
atlas = "My_Way_and_The_Highway",
rarity = 3,
pos = { x = 3, y = 1 },
cost = 10,
blueprint_compat = false,
calculate = function(self, card, context)
if context.end_of_round then
local element_cards_held = 0
for i = 1, #G.consumeables.cards do
if G.consumeables.cards[i].ability.set == 'xiferp_Element' then
element_cards_held = element_cards_held + 1
end
end
print(element_cards_held)
if element_cards_held == 2 then
local el_sum = 0
for _, xiferp_Element in ipairs(G.consumeables and G.consumeables.cards or {}) do
if xiferp_Element ~= card then
el_sum = el_sum + xiferp_Element.el_number
SMODS.destroy_card(xiferp_Element)
end
print(el_sum)
end
if context.after then
if el_sum <= 106 then
SMODS.add_card { set = 'xiferp_Element', element_no = el_sum }
end
end
end
end
end
}
local card_set_elno_ref = Card.set_elno
function Card:set_elno()
card_set_elno_ref(self)
if next(SMODS.find_card("j_xiferp_lhc")) then
if self.ability.set == 'xiferp_Element' then
self.el_number = math.max(0, self.element_no)
end
end
end```
Thought I hooked it right
Oh. Well, how do I do I what I'm trying to do? (have the game read the element_no stat of the element cards that have it?)
just do that in the joker
also you should put additional values in card.ability, otherwise they won't get saved
of the element cards or the joker?
the element cards
also the issue isnt even with the function because you arent using it anyway, youre just adding values that dont exist (that being Card.el_number)
Does anyone know the syntax to SMODS.psuedorandom_probability?
then I'll try with element_no (thought I did that too)
i do hold on
https://github.com/Steamodded/smods/releases/tag/1.0.0-beta-0711a this has all of the information on it basically
...that also doesnt exist
it does in the cards I'm checking
I'm setting it just for this
and where are you doing that
in the card itself, next to cost.
if you put values in the center, they will be in card.config.center.<value key>
card, string key (you can make this any string really), numerator, denominator
it has a numerator in denominator chance to return true, else it returns false
they will not be added as values to the card directly
Would that point to the 0 below?
SMODS.Consumable {
key = "aether",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 0, y = 0 },
unlocked = true,
discovered = true,
config = { extra = { element_no = 0 }}, ```
Would that work for summing?
good!
so, do I put the set of the card or the card itself in card?
you put whatever card youre checking the number for
Hotfixes galore.....
edition values are stored in card.edition
so card.edition.extra.money_gain (i think?)
will try👌
also what is it meant to do
it's capped by you interest cap
but kinda yeah
to the moon is also capped by the interest cap lol
Oh shoot you right
I always thought it was just 1$ per 5$ you have
with no cap lol
mb mb
well anyway
the context check should be context.end_of_round and context.main_eval or context.playing_card_end_of_round
hmmmm
because playing cards use different contexts for end of round effects
ic ic
How do I make a joker detect if I have another specific Joker
next(SMODS.find_card("<joker key>"))
Thanks
Okay, now the last part: to make a card with element_no = el_sum
SMODS.add_card { set = 'xiferp_Element', element_no = el_sum}
end```
setting xiferp_Element.ability.extra.element_no breaks the game.
loop over G.P_CENTER_POOLS.xiferp_Element and check each center's config.extra.element_no
then create the first one with a matching number
for _, card in G.P_CENTER_POOLS.xiferp_Element do
[check config.extra.element_no]
if xiferp_Element.ability.extra.element_no = el_sum then
SMODS.create_cards(that matching card)
end
like that?
Did I put the brackets in the right spot?
no, .config.extra
also its still SMODS.add_card
overall, is it right?
should work
looks correct yeah
though idk if cardarea check is needed
anything to swap in for card?
is there a function similar to is_face for number cards?
is_face = false
Why not use not is_face
just use not
aces do not count as number cards
and if you dont want aces to count check them seperately
also what about modded ranks?
unfortunate
there arent any other categories
it would be pointful for Incantation
its just a variable name, just make it not card because card is already used in calculate and that would override it
Isnt that the mod that allows you to stack consumables?
no thats a spectral card
it's the Spectral card
also yes
if el_sum <= 106 then
for _, card in G.P_CENTER_POOLS.xiferp_Element do
if xiferp_Element.config.extra.element_no == el_sum then
SMODS.create_cards(card)
end
end```
I'll change card to something else, but is this it overall?
good. then Imma test it
card.xiferp_Element?
is key the set key?
What could be the problem here? I'm trying to make it detect a joker then self destroy
Sorry for the quality on the image
so how do I set the key?
its card:start_dissolve if you want it to self destruct
set the key of what?
why would you be setting a key
its literally just what i typed
is it just {key = card.key} without changes?
Oh thanks
yes
yes
card is the center, the key in there is just the key of the card
I always second-guess myself
you should probably stop thinking that the game would arbitrarily do something entirely differently
and also https://tryitands.ee
sometimes I'm more worried that it's a curveball
it should be calculate = function(self, card, context) and all the code should be inside a context check https://github.com/nh6574/VanillaRemade/wiki#whats-a-context
use SMODS.destroy_cards(card) or card:start_dissolve like Eris said
you also don't want to change a center directly so instead of manuel_card.config.center.mult it should be manuel_card.ability.mult
you should be returning dollars = <number>
👌
all works now!
also currently its like scaling the value when you probably just want to calculate the interest directly
I just set the gain to 0
so its just the interest at the end of the day
you can just do return { dollars = math.floor(math.min(G.GAME.dollars, G.GAME.interest_cap)/5))*G.GAME.interest_amount }
kk
for _, card in G.P_CENTER_POOLS.xiferp_Element do
if xiferp_Element.config.extra.element_no == el_sum then
SMODS.add_card{ key = card.key }
end
end```
didn't work, nothing got made.
Thanks I'll try that
yeah because xiferp_Element doesnt exist in that for loop
oh.
It seems like To the Moon affects the payout of the vintage cards
then just remove the *G.GAME.interest_amount
any pointers for this?
👌
use a value that exists
like the card that you defined in the for loop mayhaps
check if card is xiferp_Element?
you're already only looping over those cards
-# and in the race to be stupid, I'm setting all new kinds of pace...
Still not creating
if card.config.extra.element_no == el_sum then
SMODS.add_card{ key = card.key }
end```
Nothing's wrong here... I don't think
is there actually a card that has the given sum of element numbers
yeah, it's 53+53=106, both of which have the code for this
From what I have found, this just doesn't trigger at all. I do not know why at all
The cards are destroyed and the numbers are summed, but nothing after
It should trigger if a card with a Red Seal is scored, but that does not seem to happen
it should be context.other_card:get_seal() == "Red"
put some debug prints in the code so you can see where its not working
It's not even printing inside
if el_sum <= 106 then
print(el_sum)
for _, card in G.P_CENTER_POOLS.xiferp_Element do
if card.config.extra.element_no == el_sum then
SMODS.add_card{ key = card.key }
end
end
end```
try printing before that check then
I tried that and it didnt show the message that it triggered
I'm at a loss, and I am just going to scrap it
oh wait
the issue is that it should be context.individual
not context.main_scoring
Allright, I'll bite
it works outside, el_sum is summing
<= should mean less than or equal to and 106 = 106
where is el_sum created
Just moments and lines prior
That fixed it, it actually tried to roll
could you just show the full code
key = 'lhc',
atlas = "My_Way_and_The_Highway",
rarity = 3,
pos = { x = 3, y = 1 },
cost = 10,
blueprint_compat = false,
calculate = function(self, card, context)
if context.end_of_round then
local element_cards_held = 0
for i = 1, #G.consumeables.cards do
if G.consumeables.cards[i].ability.set == 'xiferp_Element' then
element_cards_held = element_cards_held + 1
end
end
if element_cards_held == 2 then
local el_sum = 0
for _, xiferp_Element in ipairs(G.consumeables and G.consumeables.cards or {}) do
if xiferp_Element ~= card then
el_sum = el_sum + xiferp_Element.ability.extra.element_no
SMODS.destroy_cards(xiferp_Element)
end
end
print(el_sum)
if context.after then
if el_sum <= 106 then
for _, card in G.P_CENTER_POOLS.xiferp_Element do
if card.config.extra.element_no == el_sum then
SMODS.add_card{ key = card.key }
end
end
end
end
end
end
end
}```
Anything?
doesnt appear to have any issues
It's just not making the card it's supposed to be making
Maybe it was SMODS.create_card
SMODS.add_card is the same but it does a bunch of stuff automatically
also you previously you put a print that showed that the issue is with the <= 106 check
So what's wrong with that line
if i knew i wouldve told you
Might be the fact the contexts are off.
no because if the contexts were off it wouldnt get there
or at least not at the correct moment
whats line 291
well, deleted it
it's the for loop
bfdi number
you were missing ipairs...
ipairs(G.P_CENTER_POOLS.xiferp_Element) what it's looking for?
yes
ah got it
Python moment frfr
surprised you couldn't catch that
well i wasnt expecting that to be it tbh
also you didnt actually tell me it was crashing so i assumed it just didnt do anything
the other times it wasn't
somehow it's really broken
It might be cuz I had config.extra and not ability.extra
you should check if (card.config.extra and card.config.extra.element_no == el_sum) then probably
no, ability is only for cards, not for prototype objects
we are checking cards, aren't we?
the objects in G.P_CENTER_POOLS are prototype objects, not actual cards
the things in there are exactly what goes into SMODS.whatever (with prefixes added to the key)
+some extra information ig
th code doesn't like the parenthesis
why not
it just says it's not required in lua.
testing now
no crash, but no creation
put it in exactly as it is, it prints 106.
no cards get made with element_no 106
are boss blinds 32x32 or am i tweaking
made a joker that makes cards with a certain enhancement give +5 Mult and after scoring set them to another enhancement.
Unfortunately the game gives me error in the if scored_card:has_enhancement and it's says it's a nil value.
how can I fix this?
What does it say in the crash log
Yes, it's SMODS.has_enhancement
so instead of that check I should put directly SMODS.has_enhancement?
SMODS.has_enhancement(context.other_card,"m_SM_dirt_card")
It gives me this error now:
Might've been me who wrote it incorrectly idk
Oh wait yeah
context.other_card doesn't exist 24/7. Should be scored_card for your occasion
aight
How to make a joker detect the poker hand you played?
context.scoring_name
Yes, if context.scoring_name == 'Five of a Kind'
does this look enough like a cherry?
not bad, but I think the stem should be more curved and the cherries themselves probably shouldn't be touching
also feels a little off center rn
Everyone were cheeks at drawing at least once in their life. It just takes practice
Yup
this and also the lines should be thicker
ok
if you turn it upside down it becomes Spamton

omg ur right
the image might be a bit small
how do i make that spritesheet with the reflectivity
There should be an overlay for every animation frame somewhere in #1224362333208444989
thank you
thanks
ok i finished the art
why does this crash appear?
How are you loading those files?
this the entire main file
Remove local NFS = require("nativefs")
it stll crashes..
do you guys think its possible to make a joker scale with how loud your game is?
for _, card in ipairs(G.P_CENTER_POOLS.xiferp_Element) do
if card.config.extra and card.config.extra.element_no == el_sum then
SMODS.add_card{ key = card.key }
end
end
end```
What part of this isn't making cards?
I'm pretty sure there is a volume variable, so yes. If I knew what that was, I'd tell ya.
okay well thatll be a pain to figure out wont it
That doesn't seem to work
do objecttypes remove repeat items from the pool
in localisation file, spectrals use c_prefix_key right?
yeah
Most actually, it's attempts to look at extra but can't seem to even when it exists
i'm getting "Missing required parameter for spectral declaration: key" error,
hey y'all, i'm trying to make a custom button for a joker, but it doesn't show up when a controller input is active. where should i look to solve this?
local use_and_sell_buttonsref = G.UIDEF.use_and_sell_buttons -- code based from Lobotomy Corporation's use_and_sell_buttons hook
function G.UIDEF.use_and_sell_buttons(card)
local t = use_and_sell_buttonsref(card)
if t and t.nodes[1] and t.nodes[1].nodes[2] and card.config.center.key == 'j_picubed_ambigram' then
table.insert(t.nodes[1].nodes[2].nodes,
{n=G.UIT.C, config={align = "cr"}, nodes={
{n=G.UIT.C, config={ref_table = card, align = "cr", maxw = 1.25, padding = 0.1, r=0.08, minw = 1.25, minh = 1, hover = true, shadow = true, colour = G.C.UI.BACKGROUND_INACTIVE, one_press = true, button = 'do_ambigram_swap', func = 'ambigram_active'}, nodes={
{n=G.UIT.B, config = {w=0.1,h=0.6}},
{n=G.UIT.T, config={text = localize('k_picubeds_swap'),colour = G.C.UI.TEXT_LIGHT, scale = 0.55, shadow = true}}
}}
}}
)
end
return t
end
what's the usual structure for smods projects
i patch G.UIDEF.card_focus_ui
can you quick-reload mods while you test them
no
ic
Not without restarting your game
How do I make a Joker show a message, like the gross michele saying "Extinct!"
Thanks
i also recommend checking vanillaremade if you want to recreate anything a vanilla thing does
https://github.com/nh6574/VanillaRemade/blob/a670b00a4276d5f7982f5980453726e3cc7c8e28/src/jokers.lua#L933
someone knows how to debuff jokers?
Oh yes, thanks about that. I'm new at modding and anything close to vanilla game is very useful to get an idea on what to do
@red flower why isn't my code working?
for _, card in ipairs(G.P_CENTER_POOLS.xiferp_Element) do
if card.config.extra.element_no == el_sum then
SMODS.add_card{ key = card.key }
end
end```
everything is defined to where it should be..
please don't tag me for stuff unless it's relevant to me or we are in a conversation already
sorry.
What's your full code
Do you guys think this code is good? Im trying to make it detect that im using five of a kind and it gives Xmult at the end too
key = 'lhc',
atlas = "My_Way_and_The_Highway",
rarity = 3,
pos = { x = 3, y = 1 },
cost = 10,
blueprint_compat = false,
calculate = function(self, card, context)
if context.end_of_round then
local element_cards_held = 0
for i = 1, #G.consumeables.cards do
if G.consumeables.cards[i].ability.set == 'xiferp_Element' then
element_cards_held = element_cards_held + 1
end
end
if element_cards_held == 2 then
local el_sum = 0
for _, xiferp_Element in ipairs(G.consumeables and G.consumeables.cards or {}) do
if xiferp_Element ~= card then
el_sum = el_sum + xiferp_Element.ability.extra.element_no
SMODS.destroy_cards(xiferp_Element)
end
end
if el_sum <= 106 then
for _, card in ipairs(G.P_CENTER_POOLS.xiferp_Element) do
if card.config.extra.element_no == el_sum then
SMODS.add_card{ key = card.key }
end
end
end
end
end
end
}```
The first two if parts are fine, they work already as I want them to (check for two element cards, adds their numbers, destroys them both)
It's making the last part, the element that is the sum, the part I'm stuck on
The if el_sum <= 106 then part doesn't work? But the rest does?
it's the if card.config.extra.element_no == el_sum then that doesn't
That line you said works, the one below it doesn't
Do you mean the condition is never true
Sometimes. Some other times, when I change it around, it breaks the game
Do you have a crash log
I have one of a change I made, that made that line if xiferp_Element.config.extra.element_no == el_sum then
This is the closest I have to it working
here's a more usual error
anything you can gleam?
From this, it's probably because you have consumables that don't have the extra.element_no property
The ones I'm using for this do tho (in config)
What is line 291 of Jokercode.lua
in which version?
The latest crash you sent
if card.config.extra.element_no == el_sum then
Each of the cards I'm using it on have element_no set in config.extra
is xiperf_Element a consumable type you created
xiferp, and yes
that error is cus one of those consumables you created doesn't have the element_no property in config.extra
I'm making a joker that takes two and merges them, for lack of words, into another
SMODS.Consumable {
key = "hydrogen",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 14, y = 0 },
unlocked = true,
discovered = true,
config = { extra = { element_no = 1 }},
can_use = function(self, card)
return true
end,
loc_txt = {
name = 'Hydrogen',
text = {
'Destroys one random card and',
'adds +5 chips to your next hand.',
},
},
use = function(self, card, area, copier)
G.GAME.xiferp_flike_chips = (G.GAME.xiferp_flike_chips or 0) + 5
local card_to_destroy = pseudorandom_element(G.hand.cards, 'random_destroy')
SMODS.destroy_cards(card_to_destroy)
end
}```
Here is the exact card i'm using for the testing
SMODS.Consumable {
key = "helium",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 15, y = 0 },
unlocked = true,
discovered = true,
config = { extra = { element_no = 2 }},
can_use = function(self, card)
return true
end,
loc_txt = {
name = 'Helium',
text = {
'Adds +5 chips to your next hand.',
},
},
use = function(self, card, area, copier)
G.GAME.xiferp_nobelgas_chips = (G.GAME.xiferp_nobelgas_chips or 0) + 5
end
}```
And here is the exact card i'm trying to make
Was the crash log you sent from a previous version or something
just a moment please
This is when line 291 is if xiferp_Element.config.extra.element_no == el_sum then
any changes?
Try giving a different name to the card in the loop that contains the add_card call
like xiferp_Element, the set?
just anything besides card, whatever you want
now it breaks earlier again, all I did was change line 293 and it breaks at line 291
Well you had to change what was previously card to the new name inside the loop
so what do?
Here's the error btw
wdym what do, I just said it
for _, element in ipairs blah blah then
if element.config.extra.element_no == el_sum then
SMODS.add_card { key = element.key }
end
end
just that? just the key, no mod prefix?
there was no mod prefix in your original code either, what are you talking about
there was, xiferp is the prefix
are you referring to the part I just replaced with "blah blah"? If so, I just didn't want to type what was there
no, xiferp_Element. modprefix_set.
No idea what you're talking about, try my code and let me know if it still crashes
plus, my code is just this. Minus maybe that space
I know your code is just that, I just changed the name of the loop variable from card to element because it might be the issue, I'm not sure tho
It shouldn't be but who knows at this point
if it does then I thank you. If not... I'll still thank you.
it isn't. line 291 is stated as the issue, STILL
What is your current code
key = 'lhc',
atlas = "My_Way_and_The_Highway",
rarity = 3,
pos = { x = 3, y = 1 },
cost = 10,
blueprint_compat = false,
calculate = function(self, card, context)
if context.end_of_round then
local element_cards_held = 0
for i = 1, #G.consumeables.cards do
if G.consumeables.cards[i].ability.set == 'xiferp_Element' then
element_cards_held = element_cards_held + 1
end
end
if element_cards_held == 2 then
local el_sum = 0
for _, xiferp_Element in ipairs(G.consumeables and G.consumeables.cards or {}) do
if xiferp_Element ~= card then
el_sum = el_sum + xiferp_Element.ability.extra.element_no
SMODS.destroy_cards(xiferp_Element)
end
end
if el_sum <= 106 then
for _, element in ipairs (G.P_CENTER_POOLS.xiferp_Element) do
if element.config.extra.element_no == el_sum then
SMODS.add_card { key = element.key }
end
end
end
end
end
end
}```
end is the same as you had it
if element.config.extra.element_no == el_sum then is line 291
the eternal issue. Is there anything that does what I'm trying to do but better?
Can you open the debugplus console and type eval G.P_CENTER_POOLS.xiferp_Element and show what it says