#💻・modding-dev
1 messages · Page 590 of 1
it's pseudocode, to be filled in by actual code later on
it's good but pretty limited
well yeah
Like, the joker has a button. You click on it, and it makes a booster pack with the joker it's selling inside
That opens after the Small Blind shop right before the Big Blind
I chose to make it a tag for ease of implementation
that's the loose way I'll work the "buying joker" part
Ok nice, I figured I would try it out as a kinda starting point for me, since I'm VERY inexperienced with lua, but understand the basics of general coding
Thank you so much, that fixed it!
A similar issue, when I open the booster, it says "ERROR Choose 1" at the bottom, am I missing a field?
you find something you like and just trial and error it into what you want it to look like,
I want to be able to inspect the tables for the jokers so I can find where the joker info is, such as the xmult so it can be returned by my mod
it limits me to 5
Use ctrl c instead of 3 for spawning that goes over the limit
Or just do like eval G.jokers:change_size(100) or smth idfk
oh yeah forgot I could eval stuff
it doesn't really help to jump into lua sadly, the code is abstracted and the generation is not very readable
yes, there should be an extra one in loc_txt but i dont remember what it was rn
So, I’m doing another themed jokers like last time with Cynthoni’s Lvstlove, but now I wanna do it with their EP, SMOKE IT TO THE BUTT
“+15 Mult for the next 10 rounds” or something like that
Aaand I need to figure that out… shit
how would I make a joker which added a specific booster to each shop?
like, a mega arcana pack or something?
I think all I need to know here is the context and the actual function to add the booster in dsfsbndfs
context.starting_shop and SMODS.add_booster_to_shop(key)
thank you <3
will come back with how it works out dsfnskdfn
oooh
sighhhh I suppose a crash this simple is what I get for not modding this for a half a year lmao bfjsbdj
any ideas? I'm lost 😭 been gone too long I guess 
Your function parameter has to be a string
Also pseudorandom stuff is done a little differently nowadays
oh 😭 well, uhm, I don't have the new smods yet so... hopefully that's fine?... I should really update that lol sdfnjksdnfksd
If you got latest release it should be enough
Have an example with Cavendish from VanillaRemade, it uses the new pseudorandom stuff https://github.com/nh6574/VanillaRemade/blob/24ee6098f692a58a34d573dec5a86a347c5fd13a/src/jokers.lua#L1613
hmmm, ok, I'll try switching it up real quick I guess dsnfjk
would not abiding here be what causes the crash though?
cuz I just realized another thing in my mod here uses odds and was fine, also the other thing being changed didn't fix the crash sadly 🥲
Right, this should be card.ability.extra.odds
ahhh ok
the thing I copied from must've made the var for arch but I never copied that part over lol sdfnjksdnfjk
thank you, I'll try this!
Actually again it's different due to the new SMODS proba stuff, check Cavendish again and its loc_vars function
is it just allow_duplicates = false, to make sure more than one of the jokers cant normally spawn unless you have showman?
Yes, but it should be false by default iirc, not sure
im not sure either because i had several copies pop in anyway, so i assume it's necessary
Ah, then yes, it's for a pool right?
so, it no longer crashes on loading the thing, however, new problem, the key I put for the pack doesn't seem to be right lol, that's what the error's reading like to me anyway
Right it should be p_arcana_mega_1 or 2 sorry
ahhh thank you
how are you testing it
i gave myself 1 million dollars and rolled 80 times to see if a second one spawned in
how did you spawn it in the first place
ah see i thought that might also be the issue, but then when the third one popped up i figured something must be wierd. (as in i just grabbed it from collection the first time)
if context.card and context.cardarea == G.jokers then
if SMODS.pseudorandom_probability(card, 'spotscast', 1, card.ability.extra.odds) then
local ret = SMODS.blueprint_effect(card, context.card, context)
if ret then
ret.colour = G.C.RED
end
return ret
end
end
Ok so about the joker that copies every joker, I decided that it would be better to give it a 1 in 2 chance to copy a joker when they trigger.
but it no work, any ideas?
i think if you did it with debugplus the cards don't get put in the used jokers even if you get another copy
else then the other only explanation is that you're making an consumable type or object type or rarity wrong
and getting the default
i dont understand what the first if condition is doing
also that will just copy one joker
this is good to know, it means i dont have to change every single one of my jokers
i hope
i mean if that's not the case then something else is wrong because that's how it should work
It's meant to make the card trigger when a joker triggers
that's not how blueprint effects work
This isn't like blueprint.
also it would still be wrong because it's context.post_trigger
It works like Seltzer but for jokers.
And it copies the joker's effect instead of triggering it again
If you're using SMODS.blueprint_effect then it's a blueprint-like effect
if you want to retrigger use the retrigger api
Yeah I want to use the blueprint effect, not retrigger api
Ok, then that's not how blueprint works
even if your particular effect is different the mechanics of it are the same
it needs to check all contexts and you need to combine all the joker's effects in one return table if you want to copy multiple jokers per context
read please
Fair
can someone help me with making an edition shader? Im trying to make a "Enchantment" shader (basically the Minecraft enchantment glint) for the enchantment edition for my mod. But im not sure how to work with .fs
smth like this but for the jokers
heres the glint img if needed
What's the most direct way that SMODS sorts ranks in ascending value order?
how do i make a new rarity
my friend did a shader like that at one point ^ should be usable
this could be useful, but how should i implement it to the joker cards? Im not used to coding shaders
I'm not sure, never worked with shaders myself, just figured this is helpful because it's glsl
ill try to figure it out myself, thanks for the help
nvm
what is wrong with this code lua -- Album Rarity SMODS.Rarity.add( "Album", { name = "Album", rate = 0, color = "242424" } )
its saying attempt to call 'add' a nil value
i think you just need SMODS.Rarity
without .add
SMODS.Rarity {
name = "Album",
rate = 0,
color = "242424"
}
now its saying attempt to index local 'o' [a string value]
did you remove the "Album" too near Rarity
i just did now it says ']' expected [to close '[' at line 207 near '='207 is the line that smods.rarity(
check your parentesis'
i suggest you use visual studio code instaed of a text editor, so you can see this basic errors beforehand
i am
have you got the lua extention?
was about to say that
on name or color or both
oh thanks
gonna paste this here from a reddit post i made since i was told to consult here.
go to the joker forge thread in #1209506514763522108
i see thanks
i have an econ joker that resets after a boss blind is there any way to make it so the reset comes after the cash out?
if i make a new rarity how do i make a joker that rarity if it doesnt have a number
you could have it reset on context.ending_shop or context.setting_blind
use the string, with your mod prefix
rarity = "prefix_Rarity"
i think?
something like that
oh so in the joker code i can set the rarity to a string
yeah
also i was wrong make sure u put it lowercase even if ur key has uppercase
so like rarity = "prefix_rarity"
thx
i guess
does anyone know why im getting the error attempt to insert object "j_nlsmd_SITM" into an empty pool ```lua
-- Album Rarity
SMODS.Rarity {
key = "Album",
weight = 0,
color = HEX("242424")
}
-- Stuck In The Middle
SMODS.Joker{
key = 'SITM',
blueprint_compat = true,
rarity = "Album",
cost = 15,
loc_txt = {
name = 'Stuck In The Middle',
text = {
'insert description here'
}
},
atlas = 'placeholder',
pos = {x = 0, y = 0}
}```
You're missing your mod prefix.
where
On the rarity.
so what do i change it to
modprefix_key
so rarity = "nlsmd_Album",?
ok i did that but the rarity is showing as error
Winter mod coming out soon woot
how do i get the position of a tag in G.ASSET_ATLAS.tags?
What's the best way to convert this to a string for use in vars rather than main_start or main_end?
😭
if i was truly insane id add perma_repetitions but this is insane enough
Hello friends. I'm here to make some changes to one of my jokers.
Koraidon here applies red seals to played wild cards. However, since wild cards are hard to come by, I've decided I want to buff him.
I want the first hand of each round to turn into wild cards with red seals
How would I modify the code to do that?
none, it's in main_start for a reason
DAMMIT
what do you want to do
I can't figure out how to do the backdrop for xMult cos I want to make a joker that's essentially an Xmult Misprint
you just wrap that G.UIT.O node in a G.UIT.C node
I recommend looking at localize in the base game code, it has this setup
Alright so I tried tweaking it by myself
and it doesn't crash the game on loading
but when it's about to score a card, it drops this crash log
I'll drop the updated code if anyone wants to take a look
😭
me when i get two rather similar terms mixed up (how clumsy of me)
Alright now I'm having a different problem
I put in some more code that should make Koraidon give 2x mult for every wild card played, but it's not working as intended
knowing me, it's probably because of some syntax mistake or I just implemented it into the code wrong
what exactly is wrong
also the Xmult in config.extra should prob be 2
instead of SMODS.get_enhancements(context.other_card)["m_wild"] == true
do
SMODS.has_enhancement(context.other_card, "m_wild")
aight i'll see how it works
doesn't work
Any idea how to code to look for unique chip totals? My current best idea is write-in tables to store every single one in order and have the joker compare the current to those before/
this is strange
what is?
not you
sorry
ok
before the return xmult statement could you do
print("reached")
and tell me if it says reached
What exactly are you trying to do?
it printed reached like fifteen times
It's pretty laid out: +14 chips per every unique base chip total, before the jokers add a bunch of chips
well thats good
replace Xmult with xmult??? idk
im not seeing anything else weird
In that case id reccomend just keeping a table inside of the joker with all of the unique values
Xmult doesnt work iirc
xmult does
huh
jokerforge stuff uses Xmult for some reason
how do I do that, just hook it on after or?
xmult didnt work though
this is why we don't trust Jokerforge
Thaatttt would be a question to ask someone else. Hooking isnt my strongsuit
well is it that way or can it be does elsewise?
I think i see the issue
to Esz?
SMODS.Joker {
key = "scorigami",
blueprint_compat = true,
perishable_compat = false,
rarity = 2,
cost = 6,
pos = { x = ??, y = ?? },
config = { extra = { chips = 0, chip_mod = 14 } },
loc_vars = function(self, info_queue, card)
local xiferp_unique_chip = (compare to every entry in xiferp_scorigami_table)
return { vars = { card.ability.extra.chip_mod, localize(xiferp_scorigami_table), card.ability.extra.chips } }
if context.(post_hand) then
xiferp_unique_chip
if does not match then
add chip_total_value to xiferp_scorigami_table
end,
end,
end,
calculate = function(self, card, context)
if context.before and not context.blueprint then
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_mod
return {
message = localize('k_upgrade_ex'),
colour = G.C.CHIPS
}
end
if context.joker_main then
return {
chips = card.ability.extra.chips
}
end
end
}
set table xiferp_scorigami_table
xiferp_scorigami_table: {}```
current joker pseudocode
(mostly based on Castle)
still not multing
Huh
try xmult_mod?
printed it like 15 times
and still not multing
wait
What did it print
it's nil
OKAY
ah that would be why
nononono
self is a prototype of the card object
Huh
-# swear ive done that before to fix it
so would it be self.ability.extra.xmult
X would be capital
thought case didn't matter?
In terms of the return table, yes
But were talking about a variable
Variables are case sensitive
bump
but if I change all of them to have the same case, would it not make a difference?
I think this is the best way to explain it:
You have your current xmult value in the config set as "Xmult"
If you want to call the variable, youd have to do "Xmult".
No, it should be card not self
Card is returning nil on the ability
The evil self trick i used doesnt work in this context ig 😔
prototype objects are a consequence of recreating classes with tables in lua
bump 2 (I wanna know how to clean this up into actual code)
What i think is happening is card is targetting other_card for some reason??
Honestly atp id say just hardcode the value until you can find a fix
In the return table replace card.ability.extra.Xmult with whatever it should be
it can't be that easy
ideally you'd use the extra value
but since thats breaking
hardcoding the value is kind of our only hope
did you try it
and did it work
Theres several pros and cons to doing this:
Pros:
- Gets the joker to actually function
Cons:
- Loses compat with decks like misprint deck
- Is a bit more tedious to change
it really is that easy
Yeah
bump 3
finally my boi koraidon is cooperating with me
Your formatting is a biiiitttt off, but its readable
My main issue is change 2x to X2 in the description
bump 4 (the worst in the series)
That worked, thx
Want some credit in my mod or?
How do you change the curvature of the circle here? I tried using r but that didn't work.
r = 0.1 is default value of "roundness" of corners.
CODE RED
CODE RED
THE WORST HAS COME TO PASS
ARCEUS CREATES TWO ULTRA NECROZMAS
OH SO GETTING RID OF R JUST MAKES IT A FUCKIN SQUARE YET WHEN I SET R TO SOMETHING IT DOES THIS?! EVEN WHEN I SET R TO 0.1?!
bump 5 (this better be the last)
bruh
yeah...Imma stop
What if you set r to 0.05
Doesn’t work iirc, honestly I’m fine with sharp corners, I’m done with this fuckin thing.
r is meant to be a boolean actually, but used as a number in vanilla
you can try using res
i first added my english teacher, now its my math teacher's turn
(it starts off as ^)
Does anyone know how to make a joker write to a table?
wdym by that
How does a joker write a new value into a table?
just set it
if you write to a key that doesnt exist it just creates it
you do know how tables in lua work right
Oh, just set the table, and the joker takes care of the rest
oh
so you can access an element in two ways
table.key1
or table["key1"]
the first one looks nicer, especially for nested tables
but the second one lets you access a key based on a variable namw
you can also mix and match them
like card.ability.extra.whatever[key]
(which gets card.ability.extra.whatever.(the string that key is set to))
i remember when i learned nested tables...
card.ability.extra.amogus.farts.lol = card['ability']['extra']['amogus']['farts'].lol
Ah. Got it. One more question: how do I read the base chips of a hand?
Like, after the last scored card but before the cards held.
hand_chips is the global... you may need to check for if the currently scored card is the last scoring card.
Otherwise, for just the total chips of just the hand along, G.GAME.hands[hand].chips, where hand is the string of said hand, be it 'Flush' or w/e.
I was about to ask if tables must have the mod prefix, and I thought of course they should!
Would xiferp_scorigami_table be a valid table name?
Unless specified to, modprefixes aren't needed.
Some of my global tables that are accessible everywhere are attached to SMODS.current_mod, which is referenced as togabalatro as my mod initializes - for example, togabalatro.chipmultopswap is a global table.
But, otherwise, you're free to just
scorigami_table = {}
and not much else to define it.
alrighty then, thank you!
One true final question, how do I compare one thing against all of a table?
How do I check if a hand is present? As in, there are drawn cards in the hand.
I want to add cards to the hand, but if it's not present, then to the deck, as of now if there are no cards in the hand, the card just gets added to the hand anyway and it looks goofy in the shop.
Check if G.hand.cards[1] exists?
or maybe just next(G.hand.cards)
technically the same but next is cooler
I'll try, thank you!
if theres nothing in G.hand.cards itll return nil and nil is falsey
and if there is something itll return it and anything else is truthy
set[key] = true
end
function checkForKey(key)
if setDoesNotContain(scorigami_table, key) then
table.insert(scorigami_table, key)
end```
This should turn my table into a set, yes?
And then search it for the key, yea?
Wow I have like 5 checks like the other method because I forgot next exists
I must fix this immediately
This is probably a really strange question, but given that the cards in Balatro kinda wiggle in a faux 3D rotation motion, what are the "fake" x/y/z rotations given to the cards? I need to find their normals.
it may do you good to look into some shader's code
that's what i'm doin
i know that there's this variable passed to shaders
right
only bump
i love the dissolve shader
so anyway, 3d joker
oh god
I need a mod that changes all the jokers to be 3d like that
(it doesn't use a 3D model it's just faking it with shaders)
I assumed that already its called love2d for a reason :clueless:
Wow that joke is mid
how does one make the joker go away after a certain amount of rounds?
Bizarre, im getting some crash with cardsleeves when the game calls for a save
Specifically with one of my modded sleeves....
Ugh. Crashes only when using the sleeve with the associated deck,
if context.round_eval and setDoesNotContain(scorigami_table, xiferp_unique_chip) then
table.insert(scorigami_table, xiferp_unique_chip)
end```
help
what do I replace setDoesNotContain with?
Did you recently update CardSleeves?
How do I apply a Stake to my Challenge?
I can set G.GAME.stake = 8 in the apply, but that doesn't actually apply any of the Stake-Changes
G.P_CENTER_POOLS.Stake[8].modifiers()?
What do I do with that?
Just call it..??
Yes.
Doesn't do anything... Nvm. ->
Ah, .. Wait, Do I have to apply all of them seperatly?
Yes.
No, just call SMODS.setup_stake(8)
-# Oh thank god-
Thank you 
You would replace it with not table.contains but you need to define it first.
bump?
https://github.com/nh6574/VanillaRemade/blob/main/src/jokers.lua#L4208 and use SMODS.destroy_cards(card)
I mean, for SMOKE IT TO THE BUTT, I’m thinking that it gives +15 Mult for the next 10 rounds, so it’s a mixture of popcorn and invisible, probably?
I’m still a beginner at this
note: you should avoid using a magic number for that, a specific stake index won't consistently correspond to the stake you want if someone inserts a stake in between. instead use SMODS.setup_stake(SMODS.Stakes["stake_key"].order)
if you haven't solved this yet the correct one is 0.05
r = 0.05? Will try that
i'd like to add a sprite on top of the logo on the main menu
can i do this with a DrawStep, or is there another way?
i'd just change the title screen sprite but i want Ghost to appear on it even if a different mod also changed it
some mods do this, I'll check those
like balatro goes kino, maximus, fools gambit
awesome ^u^
Thank you very much for mentioning that! 
The only part for me to do is figure out how I can code it…
i remember there being some github repo with some example shaders, which one is that?
mostly because i want to maybe try shaders but also because i am currently using a shader from there as a placeholder that i am allowed to use freely but i forgot to credit that like a dumbass
I think it was smods/examples or something like that
i dont see a examples folder in the repo
but i also am currently experiencing a major case of the genior so i might just be :clueless:
its a seperate repo
kurwa
A separate repo :clueless:
is there any documentation for calc_dollar_bonus(self, card)
give me a tag if this is something I need to look into
thanks mods
I tried to make a consumable that gives a random enahncement from an ObjectType pool but for some reason the game gives me error, is there something I'm still missing?
that's a weird spot to put the pseudorandom, is that what it's crashing on?
yup
How can I shuffle the card back into the deck when I don't have a hand? It does it trivially when a hand exists, but if I have shop open, it just adds it back, but it seems to be in the discard pile and is only shuffled back into the deck after next round end
I'm assuming your intent is a suit-changing tarot that randomly picks 1 of 2 suits to convert the cards to after(?) the player uses it
nope, my intent is a consumable that gives a card a random enhancement from a specific ObjectType pool
Oh, I thought mod_conv was only for suits
I do see now that is also for enhancements
neat
Right, let me rephrase then. Your intent is an enhancement-changing tarot that randomly picks 1 of X enhancements to convert the cards to after(?) the player uses it
yes
then what are you trying to show in loc_vars?
a constantly changing text for each enhancement?
nope, I put both enhancements descriptions to be shown when you hover over said consumable
this basically:
Okay, but I still don't understand then why you are returning localize{..., key = card.ability.mod_conv} as one of the vars
or more specifically, why card.ability.mod_conv is set using pseudorandom
That is my fault, I need to remove it
yet I wanna know how can I make mod_conv get a random enhancement from a pool
SMODS.poll_rarity, probably? See the docs https://github.com/Steamodded/smods/wiki/Utility#randomness
you can then use pseudorandom_element on the pool and pool key
see e.g. get_next_tag_key in the basegame source code functions/common_events.lua:1914
Unless there's something built into smods that automatically does all that for you (I couldn't find it)
and obviously make sure to do all of that in the use method of your consumable, not in the config
aight
SMODS.poll_enhancement with an options field for the allowed enhancements
I'm missing something but I'm not sure what exactly is
should the options be the the key of the objectType pool?
No it should be a table of enhancement keys
Think I got it working as I'd like anyway
i've made a couple patches to add a new sprite to the main menu
however, it's not appearing on the title screen
the seed and the set are reversed in get_current_pool
but yes you should be using SMODS.poll_enhancement
are u trying to add to the title hand
i'm trying to add a sprite to the title screen
[not a card]
it should look like this
the Ghost in the corner is her own sprite
^u^ hehe
-# unfortunately it wouldb probably be overriden by ortalab 😔
well that's the thing
i considered having the Phanta logo with her baked in
but i thought it'd be cuter for her to remain if something overrides the title
what's that short for?
milkys mod i forgot what its called
this seems to be what i'm doing
can i see what it looks like?
iuh cant rn sorry :(
ah grand :D
also ig maximus does it too
How can I shuffle the newly added card into the deck?
As of now it gets added to the full deck list, but only gets actually added after the end of next round, when the cards are shuffled in
why are you adding to the table dieectly
use SMODS.add_card
I do it based on how I see the implementation in VanillaRemade, so I figured that was the way to add it
i mean create_card
Doesn't create_card generate from a set? I need a saved card to be added to the deck
how to press the select button before blinds with code
see pins
i think theres a function to move a card from one area to another
yeah emplace
oh
thats the same way dna works i think
So I'm guessing G.deck:emplace(c) then?
its intended behavior
uhh yea ig so
yeah but then it doesn't go into your hand
just dont directly write to the table
it skips over stuff like add to hand contexts
and vanillaremade is wrong in this case
i think
why
I need it to go into my hand only if my hand is present, but go to my deck when getting a card while in shop without a hand, the hand part was done, only issue was that it didn't get shuffled in, but I'll try deck emplace then
its table.inserting into playing_cards
you should probably emplace into deck only if theres no hand and not always
oh
wait uhh
only emplace once per card
its ok to insert it into the playing_cards table because its already emplaced into hand
i guess
That's inside my code, I was told if G.hand.cards[1] does that
then have it emplace into deck in an else statement
what can i do next?
Thank you so much @loud summit and @wind steppe, it's working now with deck emplace!
I didn't get much deeper a chance to look into it last night but I'll be investigating more today. I'm just not sure where to start cause the crash log is weird?
what's the crash log?
now i wonder if i can make a blind have priority over jokers
its for suspense
(on mobile right now) It basically says that the first argument to the channel:push() method used for saving on the Save manager channel isn't a valid type
But it was pointing to a line in Game.lua somewhere in the 2900s (probably offset some compared to other mods due to my patches) where it was clearly passing a table, which is a valid type
main reason? i think its funny
where would i even begin to add a sprite here
I can get the proper crash log once I get out of bed but it's not super helpful IMO
I feel like I’m interrupting…
nvm i can figure something out
yipee
do u want to replace balatro oe
No
I just want help, okay?
Judging by this description it seems something weird is happening with the save manager (which cardsleeves doesn't even touch), so not even sure if I can help
man i want the blind to destroy chicot
That's why I'm confused, cause nothing I do uses the save manager wither
yea copy what milky did lol
It's clearly some weird interaction with my own content, because it's specifically one of my sleeves when used alongside its deck counterpart, and no other situation
^ here
And no crashes otherwise
No
what
... you guys aren't any help sometimes... honestly
largest middle finger to the player, i really wanna see it happen lowkey
ill go and figure something myself
if you can send me something reproducible I might be able to take a look today (or next week monday)
what if eternal chicot tho
But your legendary had other plans did he?
i could probably just render the sprite before the balatro text
i just want the blind to destroy regular chicot 😭
you can probably hook the disable blind thing chicot does
well yea if you hooked rhe title screen func and added the sprite before it then probably
wouldnt that double destroy luchador
and what about playing cards that disable blinds, like mine :(
fuck luchador
you can just hook to check if chicot is present and the boss blind is your boss blind i think
if context.setting_blind then
func = function()
G.jokers:remove_card(card)
card:remove()
card = chicot
return true;
end
``` idk you tell me
well you could just do that in the blinds disable function
i put the card = to always target chicot
idk im not familliar with blinds just a thought :)
SMODS.destroy_card(SMODS.find_card("j_chicot").next) might work
hello?
is it .next or .next()?
no idea
lol, im sure the smods wiki has something
next is a function
you havent really asked a question
scroll up
bam
... hang on what was the function again
the original code?
that would be this
a specific question
i mean, is there any variables that i can replace?
like popcorn/icecream?
yeah
since SMOKE IT TO THE BUTT is related to smoking, i'm thinking of the next 10 rounds
looks fine, if a bit op
both chicot and the blind activated at the same time lo
oh, probably put the destroy func in a event
it still has elements of popcorn in it though, so should i replace the "extra_mult" variable with rounds or something like that?
iits a variable
you can name it whatever you want
as long as youre consistent with it
a self-defined var*
send code
what about creating
event
im talking an SMODS.<thing>
?
basically is there an inverse to SMODS.destroy_cards
SMODS.create_card?
yeah
key = 'smokeit', --joker key
loc_txt = { -- local text
name = 'SMOKE IT TO THE BUTT',
text = {
'{C:mult}+15{} Mult for',
'the next {C:attention}10{} rounds.',
},
},
atlas = 'Jokers', --atlas' key
rarity = 1, --rarity: 1 = Common, 2 = Uncommon, 3 = Rare, 4 = Legendary
--soul_pos = { x = 0, y = 0 },
cost = 3, --cost
unlocked = true, --where it is unlocked or not: if true,
discovered = true, --whether or not it starts discovered
blueprint_compat = true, --can it be blueprinted/brainstormed/other
eternal_compat = true, --can it be eternal
perishable_compat = false, --can it be perishable
pos = {x = 0, y = 0}, --position in atlas, starts at 0, scales by the atlas' card size (px and py): {x = 1, y = 0} would mean the sprite is 71 pixels to the right
config = { extra = { mult = 15, total_rounds = 10 } },
calculate = function(self, card, context)
if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
if card.ability.rounds - card.ability.rounds_loss <= 0 then
SMODS.destroy_cards(card, nil, nil, true)
else
-- See note about SMODS Scaling Manipulation on the wiki
card.ability.rounds = card.ability.rounds - card.ability.extra.rounds_loss
return {
message = localize { type = 'variable', key = 'a_rounds_minus', vars = { card.ability.extra.rounds_loss } },
colour = G.C.MULT
}
end
end
if context.joker_main then
return {
mult = card.ability.rounds
}
end
end
}
@loud summit
the config is set to total_rounds but youre trying to access rounds
Nevermind the adding card is not perfectly fixed, when drawing the deck emplaced card, it's invisible. If I also start materializing it, it won't be invisible, but it'll be in my non-existing hand
what can i change about it?
change the word
to total_rounds?
yes
it also didn't output the mult, should be easy to fix
or not, since i tried to copy the code from jimbo
i'm that lazy, huh
return the mult val
card.ability.extra.mult
I don't see anything in your answer (might be Discord bug), do you have a solution?
And it crashed
did you misspell extra
by any chance
oh no you also need to have card.ability.extra.total_rounds
OMFG WHAT IS WRONG WITH ME
I’m still a beginner
ㅤ
And I forgot to put a value to “total_rounds_lost”…
you could also just put 1 there
since i dont imagine you would be changing by how much the round count decrements
IT STILL CRASHED THOUGH I PUT A FUCKING VALUE ON IT
sned log
never mind, i just needed to start a new run
the only thing i need to do is the joker art and i'll be finished
oh yeah, i forgot to show how many rounds the joker has got left
how can i show how many rounds does the joker have left?
https://github.com/Steamodded/smods/wiki/Localization#localization-functions use loc_vars, +look at how vanillaremade uses it as reference
@tepid crow Here's the crashlog, and the code for both my sleeve and the deck it accompanies:
Well, I'll do codesnap versions of these too
But what specifically it's crashing on is the block that saves every ten seconds in game.lua
i mean on the actual joker...
-- all keys in this return table are optional
return {
vars = {
card.ability.extra.total_rounds
},
},
``` ? something like that?
it says “nil rounds”
key = 'smokeit', --joker key
loc_txt = { -- local text
name = 'SMOKE IT TO THE BUTT',
text = {
'{C:mult}+15{} Mult for',
'the next {C:attention}#1#{} rounds.',
},
},
atlas = 'Jokers', --atlas' key
rarity = 1, --rarity: 1 = Common, 2 = Uncommon, 3 = Rare, 4 = Legendary
--soul_pos = { x = 0, y = 0 },
cost = 3, --cost
unlocked = true, --where it is unlocked or not: if true,
discovered = true, --whether or not it starts discovered
blueprint_compat = true, --can it be blueprinted/brainstormed/other
eternal_compat = true, --can it be eternal
perishable_compat = false, --can it be perishable
pos = {x = 0, y = 0}, --position in atlas, starts at 0, scales by the atlas' card size (px and py): {x = 1, y = 0} would mean the sprite is 71 pixels to the right
config = { extra = { mult = 15, total_rounds = 10, total_rounds_loss = 1 } },
calculate = function(self, card, context)
if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
if card.ability.extra.total_rounds - card.ability.extra.total_rounds_loss <= 0 then
SMODS.destroy_cards(card, nil, nil, true)
else
-- See note about SMODS Scaling Manipulation on the wiki
card.ability.extra.total_rounds = card.ability.extra.total_rounds - card.ability.extra.total_rounds_loss
end
end
loc_vars = function(self, info_queue, card)
-- all keys in this return table are optional
return {
vars = {
card.ability.extra.total_rounds
}
}
end
if context.joker_main then
return {
mult = card.ability.extra.mult
}
end
end
}
what the hell do you mean
oh maybe it doesnt work if you pass a nil value to destroy_cards?
also add .next() since it returns a list
no..
after the j_x?
oh
you need to have loc_vars
not in your calculate
its a seperate thing
in the joker
yeah and the third one is in it
okay, it's all done, thank fuck
why are you returning this
idk, it seems right
ok so I just tried to mod Balatro on another computer but for some reason when I open it it gets stuck in a pitch black screen with another window with various inputs.
is there a way to stop making it endlessly loading?
Does your setup have multiple monitors?
....no?
no it doesn't
Damn, then it's not the thing ive encountered
is it the lovely console
yes
thats normal just wait for a while until the game loads
or my pc is just really slow
aight
working on a card that cycles its description when i press a key, but it only updates after moving my mouse off and back on, is there a way to force reload the cards text?
maybe dynatext
try looking at like misprint in vanillaremade?
seems like you need a main_start function in the return for loc_vars
how can i permanently debuff a joker without it clearing its debuff?
setting joker.debuff to true seems to reset it when blind is started/finished
<joker>.perma_debuff = true
i tried that but it doesn't seem to do anything
it wont change until debuffs are recalculated
um.. it's still loading and now it says that Balatro is not responding...
so you also need to set debuff and/or recalculate debuffs on the card
there we go
restart balatro
since someone wanted to crash log
-# apparently showing just the crash and the responsible code is not enough
tried setting perma_debuff alongside regular debuff, it still gets cleared
actually
wait hold on
okay i think i just hallucinated card.perma_debuff since i cant find anything about it
but you could create your own version of it by debuffing all cards with a certain flag with a mod calculate
how... do i do that? what are flags? what is a mod calculate?
-# sorry if that's a lot
scary
it's actually this album cover, literally based the joker on it lol
mod calculate:
SMODS.current_mod.calculate = function(self, context)
--any of the usual calculate stuff
end
and flags are just variables, and more specifically variables that track one specific state of something. usually you should store these in a card's ability (for example, vanillaremade crimson heart does this to keep track of the debuffed joker)
uhhhh
good ep though imo
*SMODS.current_mod.calculate
id say try to recreate it in the balatro style, unless youre going for jarring images like tangents
candycane you're knowledgable
im trying to destroy a modded joker but crashes with a nil 'ability' when trying
sorta
oh, that's... handy. i'll try that
still wrong (you replaced the wrong underscore)
there fixed
i don't have the skills aaaaa
i think thats whats going on
ok so uhh send the code ig
this is the responsible piece of code
I think you should check if the find_card returns anything first and then destroy accordingly
there is a joker with that key
I know but you don't always have that card in ur jokers
so it's best to check first then destroy
it must be in a return {}
oh wait dont put a comma
...aaand it's still loading
same ordeal
ok hm
might seem a bit stupid but
for _, c in SMODS.find_card do
SMODS.destroy_cards(c)
end
huh
cards returns nil
so... i tried
if G.jokers ~= nil then
for i = 1, #G.jokers.cards do
G.jokers.cards[i].debuff = G.jokers.cards[i].ability.joker_services_chosen
end
end
end```
where `joker_services_chosen` is, allegedly, a variable that should debuff a joker, but that doesn't seem to happen
local chicots = SMODS.find_card("j_chicot") -- check if we got any.
if next(chicots) then SMODS.destroy_cards(chicots) end -- if we got any, kill. :)
it should be
SMODS.current_mod.calculate = function(self,context)
if context.debuff_card and context.debuff_card.ability.joker_services_chosen then
return { debuff = true }
end
end
oooh
This worked back when I had 0711a, but it's not applying the eternal in 0827c. Anyone know a fix?
it... still doesn't work!
didnt
cards returns nil
if it's any help, the code that should apply debuff is a joker that debuffs a card to its right. the code i use is placed in loc_vars function
if card.area and card.area == G.jokers then
local other_joker = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i + 1] end
end
if other_joker == nil and card.ability.extra.currently_debuffed ~= nil then
card.ability.extra.currently_debuffed.debuff = false
-- SMODS.recalc_debuff(card.ability.extra.currently_debuffed)
card.ability.extra.currently_debuffed.ability.joker_services_chosen = nil
card.ability.extra.currently_debuffed = nil
elseif other_joker ~= nil and other_joker ~= card.ability.extra.currently_debuffed then
if card.ability.extra.currently_debuffed ~= nil then
card.ability.extra.currently_debuffed.debuff = false
-- SMODS.recalc_debuff(card.ability.extra.currently_debuffed)
card.ability.extra.currently_debuffed.ability.joker_services_chosen = nil
card.ability.extra.currently_debuffed = nil
end
other_joker.debuff = true
-- SMODS.recalc_debuff(other_joker)
other_joker.ability.joker_services_chosen = true
card.ability.extra.currently_debuffed = other_joker
elseif other_joker ~= nil and other_joker ~= card.ability.extra.currently_debuffed and card.ability.extra.currently_debuffed.debuff == false then
other_joker.debuff = true
-- SMODS.recalc_debuff(other_joker)
other_joker.ability.joker_services_chosen = true
end
return {
vars = { card.ability.extra.currently_debuffed }
}
end
end```
i don't know a better way to make a joker trigger when it's moved
also you should be setting joker_services_chosen on other_joker
i guess i can just put it in calculate without giving any context, but that doesn't work consistently
so other_joker.joker_services_chosen instead of other_joker.ability.joker_services_chosen?
actually
you could just do this in a calculate directly without any of the extra stuff i think
because of context.debuff_card
it would just be delayed until blind select ig
and promptly crashed
i... think i tried that, and it still cleared somehow. i'll give it another try, hold on...
yeah... it does clear when i select a blind

actually nevermind. i tried simplifying the code to just G.jokers.cards[1].debuff = true and the debuff was kept consistently
at this point it's probably some error in my code
thanks for all the help! i'll continue workin on this thing on my own for now
i... made the game immediately close itself upon hovering my mouse on a joker 
This no work :(
Where would I start on making a deck?
smods wiki
How can I make an enhancement render above the rank and symbols on the card? Preferably even above editions
Someone suggested DrawStep a few weeks ago, but I couldn't figure out how to make that work
reference the Sleeved enhancement in the latest beta of Paperback, it does exactly that
Thank you!
sooo
hey @long sun so if u did want to do the >:) enhancement it seems like its possible :3
oooo nice :3
ya
I can't find a Sleeved enhancement, only Bandaged, Ceramic, Domino, Soaked, Stained, and Wrapped
Ah found it, thank you!!
I was trying to look for beta, but didn't know it was on another branch
How do i find the seed of the run, using script
alright thanks
Folks, can someone explain why my text get "squished" here?
for comparison
Or am I crazy?
G.GAME.pseudorandom.seed
ok thank's, i'll try that then
would you guys happen to know how i could move back antes via ease_ante, since the game seems to self destruct (no error log) when i have it as ease_ante(-1) in order to go back antes, referenced to the vanilla backtracking vouchers
so did anyone manage to figure this one out
nvm i just happened to use the wrong function, so that is solved, but the consumable seems to crash balatro if it has an edition like negative from perkeo
why does this stupid shader system not have dot products. why did it need its own shader language
f# is designed for shaders im pretty sure
if someone has a love2d shader that can change the hue of a pixel i will like actually pay you to have it please im so tired of shaders
wishing i knew how to shaders so i could get that bag 😎😔
you could just steal the balatro vanilla shaders 🤑
take the holo and tweak it a bit idk
14
kk
14
thanks!
all in a days work for eddy rob
oh my god bruh just work
ok turns out the polychrome shader has HSL/RGB conversion functions
which makes this. super easy actually
its Blue time
😭 im crashing out
Are you sure that is where the crash is coming from?
yes
getting rid of these two lines makes the code run normally
im sure its these lines that cause it (i just want to destroy a modded joker 😭
How do I make a joker check if cards have a specific edition?
i already set myself a deadline for tomorrow 😭
Extend it
no
i just want to destroy a modded joker but the code is just not letting me 😭
SMODS.destroy_cards(card, nil, nil, true)
return {
message = localize('k_drank_ex'),
colour = G.C.FILTER
}
else```
Here's this from Seltzer's code
from vremade
should help
im trying to do it here
Say, does anyone know how to check for commonality of suits in the full deck?
yeah
I'm making a joker for Szymii, and they wanted their card to retrigger every card of the second most common suit
i think it is possible for you to run a loop through every card in the full hand, where you can get the suit there and count it perhaps
like a for loop with i as the index, going through context.full_hand[i].base.suit?
Shouldn't it be like a lookup stat? Organize the suits by card total, ignore the first, and buff the second.
Feel like that should be easier than looping through every card
you could, but i personally think you could count the suits and pick the second most significant one
easier said than done, i want to do this in a specific boss blind
how would you code that?
the counting or the second significant one?
maybe through calculate = function(self, card, context)
i dont wanna do this in-joker, rather as part of blind code
i could try create a joker like the one you are trying to make, maybe i can make something work
good soup
yes hello
please?
alr give me a second
(I'll give you proper credit and a joker for that effort!)
-# its like finding needles in a haystack
What are you trying to do?
destroy a modded joker at the start of a blind
SMODS.destroy_cards(SMODS.find_card("j_luchador")) works but only for vanilla jokers
Hmm. Can't you invert it?
???????
Look, idk how you would, but I imagine you could rather easily
j_gj_fireicerealjokerlol is a valid joker key, i try to destroy it through that but it gives an ability crash
Hmm, maybe something like SMODS.destroy_cards {SMODS.find_card("j_luchador) = false}?
pardon my bad coding
i genuinely don't know what's going on with the crash but i don't think that would fix it
you're absolutely positive it's a valid joker key? show the code for the joker in question
i assume gj is your mod prefix
yes
and its a valid key
Mind if I show you the code I have for my version so far?
go to mods/lovely/dump/SMODS/_/src and send utils.lua here
go ahead
also my code is a little messy so you might want to modify it a little
sorry about that
key = "szymii",
blueprint_compat = true,
rarity = 1,
cost = 4,
pos = { x = 1, y = 1 },
config = { extra = { repetitions = 1 } },
loc_vars = function(self, info_queue, card)
local second.most.common =
return { vars = { card.ability.extra.repetitions }, {suit = [second most common]} }
end,
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play and context.other_card == context.card.ability.extra.suit then
return {
repetitions = card.ability.extra.repetitions
}
end
end
}```
fire away!
you dont mind it a bit messy
and yeah gj is the prefix
not that much
Might if I make a joker of you for my mod?
yea sure
anything specific you want for it?
and nothing was found :D
How do I make a joker check if a playing card has an edition on it?
I wanna make a joker that retriggers cards with editions.
yea i'm genuinely stumped
do me a favor and run eval SMODS.find_card("j_gj_fireicerealjokerlol") in the debugplus console to see what the output is
ok so that's at least getting a table back, that's expected if you don't have any of that joker
try eval SMODS.destroy_cards(SMODS.find_card("j_gj_fireicerealjokerlol")) then
ability nil!!!!
how in the world
the crash is because it's trying to check if a card (that doesn't exist) has eternal
NVM figured it out
You use context.other_card:get_edition()
its the same code that destroys chicot and luchador with no problem
Are you sure that’s your mod prefix
does lovely support multiline patches.pattern
@queen crescent test the same command with one of the jokers existing now
Does anyone know how to lookup the counts of the suits in the deck?
do you have any other mods on besides the one you're currently developing
i do play with a few
(i need localpoolfix btw, the mod has a similar problem back when pwx had that pool problem)
ok try with just your mod + debugplus + localpoolfix (+ talisman if that's a requirement)
btw what should it do if all suits are balanced?
exactly nothing!
localpoolfix is no longer available as per pwx takedown, but strangely balatro dash needs it
and uh, i could probably be an econ joker that gives $4 if the first scored card is a diamond?
that does not impede you from trying what i asked you to try
Alr!
ability crash on blind select, code seems to run fine outside
send another copy of that utils.lua file
This is probably because you’re trying to destroy an empty table
(it changed since you turned off a bunch of mods)
he has a check in the actual joker code for if the table is empty or not
actually @queen crescent add the check for when you're destroying chicot and luchador too
should it be where if all suits have different amounts, then it triggers?
uh, these two destroy themselves just fine, there is no problem there
you need the check for when you don't have any chicots or luchadors
so that it doesn't try to destroy an empty table
chicot and luchador destroy themselves just fine 😭
Well, only if there's a clear second place it functions. so, yes, barring a tie for 3rd and last
this is for behavior when you already don't have any chicots or luchadors
kk
they're destroyed fine but they are crashing when you try to destroy them but you don't have any
without the modded joker in, the jokers destroy just fine
for a voucher's requires: is the table "you need all of these vouchers to get this one" or "you need at least one of these vouchers to get this one"
without the modded joker, have you tested going into the blind without a chicot or luchador
this is entirely without the code to destroy a modded joker?
to be crystal clear
is it crashing when:
- you just have the code to destroy chicot and luchador, not the modded joker
- you enter the blind without either of those jokers
yes or no
i think its b
no those are the two requirements i laid out for a single test case
make both of the bullet points true and then report back if it crashes
no, the crash is caused by attempting to destroy the modded joker
-# just tested but the bottom one seems to be having priority
yes
?????? i need you to test both cases at the same time BECAUSE IT'S A SINGLE TEST CASE
i need to see if it crashes when you try to destroy vanilla chicots and luchadors but you don't have any chicots or luchadors
and i want the modded joker part out of the equation to prove that it's an issue with those lines and not the modded joker line
perhaps in video form will clear it up
can i have some help with a crash im having with "lovely" here? if thats okay i need a bit of help with it
and was this recorded with the code to attempt to destroy your modded joker, or only the code to attempt to destroy vanilla jokers
Can you send the crash
i removed the destroy modded joker line
i have the log ill just put it here edit not my real name
ok
then as i explained already, you need to do the same check to make sure that SMODS.find_card actually contains jokers before you try to destroy them
it would be nice to have destroy_cards check if it received an empty table before doing anything tbh
it does
so do i update
oh maybe thats not in release yet
yea it's not yet
where can i check the entire deck as a list, since im not sure if context.full_hand accounts for the entire deck
no
just check if next(SMODS.find_card("joker key")) before attempting to destroy any cards
G.playing_cards iirc
yes that should be correct
ability crash
are you sure you're saving the file
yes hello???? i always press ctrl + s when i test something
Is there a way to preserve card.GUID between quitting and loading?
It seems the card is losing ownership when the game is closed and then the save is loaded
it boots up fine if there aren't any jokers
oh wait i can't read
you still have to do SMODS.destroy_cards(SMODS.find_card("joker key"))
same crash different reason
ill consider just having it not trigger if all suits are balanced, since its a bit of a difficulty to check for a true second one, so if there would be a tie for second, would you not mind if it may resort to significance (eg. hearts, diamonds, spades, clubs)?
@gusty compass
👍
I mean, sure.
alr
@queen crescent
Plus, my code for your joker's ready to go!
32x blind size btw
im debugging my bit rn
would running SMODS.find_card every frame cause a significant amount of slowing or should i be fine
who up debugging they code rn 👀
im testing on ante 1
the blind starts appearing past ante 39
What
The fuck
yes
there’s also other joker who disables bossblind effect upon being sold
Kill luchador
yes
Or debuff it
luchador? that's already accounted for
actually, kill/permanently debuff with eternal on it to any joker that disables boss blind effect
that seems easier than just manually destroying boss disablers
that is unfun
my idea above
doesnt say anything about jokers
no way to check source of blind disabling
check every joker lua file for that specific line which disables it?
why isnt this code only getting vouchers that you can currently obtain or vouchers that need the voucher key
for k, v in pairs(G.P_CENTERS) do
if string.sub(k, 1, 2) == "v_" and v.requires then
local is_voucher_obtainable = true
for _, vv in ipairs(v.requires) do
if vv ~= key then
local is_voucher_matching = false
for kk, _ in pairs(G.GAME.used_vouchers) do
if kk == vv then
is_voucher_matching = true
break
end
end
if not is_voucher_matching then is_voucher_obtainable = false end
end
end
if is_voucher_obtainable then
valid2[#valid2 + 1] = k
end
end
end
okay but what if another mod then takes ownership of that joker and it doesnt do that anymore
what
what if a mod takes ownership of a boss disabling joker
the mod has an absurdly high priority so it loads way later than average
that
how does that change anything tho]
youre still destroying only 3 specific jokers
i only see this, but it debuffs all
yeah you would have to actually check what joker it is for that
and also make the cardarea == G.jokers
i didnt paste in anything yet