#💻・modding-dev
1 messages · Page 520 of 1
the t was just a dummy variable name to show a little bit about how table syntax works
then you used it wrong, show code
you can replace what's in [] for "Gold"
but yeah if ur still used to having to specify types in advance then vscode and other editors should have a lua plugin that lets you specify types with comments
Beautiful
that's how i been working on mt texture pack
except all the pack does is change stuff lol
not add
thank you thank you :>
Once again, I think you'll pick stuff up real quick
yessir!
i too recently picked up learning lua
i didnt know how to use lua until like a month ago
just dont be afraid to ask here, someone will have the answer to help you
Even if you get stuck there are very helpful people here as well! So dont be shy
np
i also learn a little bit every time i make a mistake helping people
don't click the ||spoiler|| or you'll get scared
I always get scared I give bad advice helping people
Bumming around this chat is probably one of the biggest ways I learned lol
i mean we're all human we make mistakes even with good intentions
especially if its late at night and our brains aren't fully functioning
i have never made a mistake
this is true
N is perfect its true
This is factual
true
nooo
i concur
now i feel bad
what do you guys think i start the mod from?
the mod id, name, author etc?
Definitely
You'll need a json file with all your metadata, and then a main file
I should buy N another game to praise his perfection when im home from the game store
nooo
praise be to N'
I wonder how long it would take me to buy Ns wishlist
"i've never made any mistakes, if you ignore all my past mistakes, then i actually never made mistakes"
-darkviper
I know you've been pointed to the Starter Pack thread already but that will really help you get development off the ground
He got so many games on there
I wish I had it when I got started
My beginning was the smods example mod
That lifted me right off the ground as initially I only did small edits
Vremade now is a fantastic tool for people
wait, can i ask something that is frying me?
go ahead
didn't work :(
i think i have these installed, do i have to do any of these?
yes
if u have smods installed then u do not need to do any of that
reloaded twice
Typically follow the manual instructions unless you really need latest dev code SMODS, or are uploading commits to SMODS
Since you're diving into dev stuff, I would recommend transitioning to using Method A, but either works just fine
Method A is preferred at high level, but also. Not everyone uses git with command line like I do cause im stupid and insane
is smods... steammoded?
yes
I've never used method a
yep
whats a command line? /j
my favorite mod manager
Fax
I should probably use vscode source control except, uhh, cd ../smods go brr
I'm too used to GitHub Desktop atp 
git checkout -b dumbass-branch
git add .
git status
git commit -m "insane commit message depicting my failing sanity"
git push origin -u dumbass-branch
same
Wow cant believe you made SMODS
And 2 VanillaRemade
Lol
Speaking of SMODS there are so many PRs on deck that I can't wait to see pulled 
it does start with n tho
i should get more comfortable with the command line but i aint got time for that when im tryna read up on gradschool-level books on diff eqs
what's floating around rn?
nh6574 is my username
lmao, i didn't see
(thats just a fork tho)
i need the in_pool one
Chip-Mult Operator API, N's Challenge API expansion (apply and calculate for challenges), your scaling tracker, is_in_pool
Just a lot of really nice stuff
obrigada :3
At least according to Eremel, I wouldn't expect the scaling tracker to actually get into SMODS
Feel free to grab it and incorporate it for yourself tho
Unfortunate but makes sense
I think haya had some problems with it
Haya?
haya of paya's terrible additions fame
(if people have problems with it they should comment so I can fix it lmao. I've not gotten any other feedback aside from the key blacklist feature that I added)
people dont like reporting bugs sadly
Felt
so, for starters, i need a .json file with the 'identification" of my mod, correct?
yes
yep
Who wants software to be bug free?: 🖐️ 🖐️ 🖐️ 🖐️ 🖐️ 🖐️
Who wants to report bugs?: 🦗
would it be considered... laziness if i used some templates...?
No
no
heres the appropriate page containing the info u need
https://github.com/Steamodded/smods/wiki/Mod-Metadata
If i never get told about a bug then frankly there are no bugs and I am perfect
copying code is not laziness and is actually praxis for development
bless
you should always steal from everyone
especially with open source stuff
i made mods specifically for people to steal from me
You'd be surprised how much code is "stolen" on the regular
nah nah, i'm aware
we learned that
assuming the approprate license
also please credit even if u steal, its just good practice
but realistically not many people are going to be offended
Im stealing Ns joker graveyard as we speak and making a yugioh mod called joyous spring
Nah I think plagiarism is generally acceptable in most cases and is only hightened as a problem by the vested interest of copyright, but that's typically a take Too Woke for people
very different from JoyousSpring
That said like giving credit is fun so people can see and point to your inspirations
can we abolish copyright
do i need anything on vscode to make the jason file
I want to so fucking bad
I love Jason file
TRUE
just create a new file, name it smth.json
json stands for joyousspring is on
be the first person to name their metadata file jason_smith.json 🔥🔥
oh, smods detects it either way?
yes
Yeah it doesn't need to be named anything specific, it's just the only json in the top level folder
I just typically give it the mod name
jeson smith it is
so mine is Fanworks.json
json*
smods tries to load all my json config files
mods don't come up which i type @ mods
Same link too
on "dependancies", that's like
stuff that my mod depends on to work right?
Mhm. Most mods won't have dependencies aside from an smods version
Feel free to put the most recent release version of smods, because people who use it should be keeping up to date
got it
iirc most recent is 0711a rn?
I think so
"dependencies": [
"Steamodded (>=1.0.0~BETA-0711a)"
"Lovely (>=0.8)"
],```
I still don't have lovely 0.8
can i get some info on some of these parameters?
like, priority, the badge stuff and prefix mainly
my mod needs lovely 0.8 because of cross mod patches on mac
what's the resolution for blind icons
The metadata page should give you the info you need
fuck, true
i didn't see it, my bad-
98% strikes again
?
98% of Balatro players/modders do not know how to read
i thought a gd streamer got 98% on a level and u just announced it here 💀
bump
i can't read 98% of the boss blinds
checkls out
- id is the identification for the mod within smods
- name is just a general readable name in the SMODS mod menu
- authors is an array of the author names, shown in the SMODS mod menu
- description is self explanatory
- prefix is what smods uses to index keys for added items unless specifically turned off, to prevent conflicts. so whereas a vanilla joker is
'j_joker', your jokers will by default be'j_prefix_joker' - priority is the order in which a mod is loaded. For most use cases this should be 0, but you can set it higher or lower if you absolutely need to load before or after other mods
- badge_colour and badge_text_colour are used to add little badges on your added items to show what mod they're from, as a little flair. These can also be disabled if you want, but it's useful for organization
- display_name is what's shown on the mod badge (and a few other places)
- version is the internal version numbering for your mod. 1.0 is typically used for first public releases
gf today lost a run cause she forgot to read too
rip
there aren't even 50 blinds
@proven belfry btw 34x34
thx
does the badge have to be in hex color code?
yes
time to pink-ify this mf
also don't include the #
samesies!!!!
i figured, yes
We pink!!!!!!!!
omg, we onto some gay shit :3
That's also like 98% of the dev community 😭
I already got my lesbian joker
How do you reach this card area? (i.e which G key)
what's main file?
G.pack_cards
It's only valid when a booster pack is opened, otherwise it's nil
gotcha, thank you
That's the main lua file of your mod
the value for that is just a string of the file's name, i.e. "main.lua"
so it has to match the name, so it can access it, yes?
main.lua is the typical practice for program entry files in lua, but you can technically name it anything here
(also a lot of other languages)
i'll keep it simple and keep main
i'm alread naming my metadata jason_smith

CHAT
it is working
i need to update it tho lol
yes lol
Also ugh Galdur................
j stands for jokers lol
I'll have to do smth here to properly add my mod badges because it maintains no_mod_badges by default
clown make up sexuality goes crazy
clowns are hot
we have another woke mod (biggest \j known to mankind)
Meh, not my type
mods, exile them
do u all fit in a tiny car
LMFAO
lesbians are jokers?
all my partners are fat so unfortunately probably not
Not real clowns smh
yes
source: me
okay, after the json file, is there anything else i should do?
what else do you want to add?
Assuming you've made your main file, start blazing your path
obviously, i'd like to try adding a joker, so i can get things started
nothing too complex
start brainstorming some effects
i'll need a folder for the images, 1x and 2x i assume?
yep
yep
Here's the documentation for a Joker https://github.com/Steamodded/smods/wiki/SMODS.Joker
danke!
assets/1x and assets/2x
Also yeah an assets folder is a definite
i don't plan on adding sounds, do i need the folder too?
nope
Nope
i'm so lucky i'm cracked at the artstyle department
You need the sounds and shaders folders only if you're using the SMODS.Sound and SMODS.Shader APIs
what does api stand for?
application programming interface
Its a term that basically means a set of functions used to interface with some platform
In this case, the "platform" is Balatro
correct
am i able to make joker artwork individually?
like
individual files instead of all smushed together?
yes
You can do that but it is not recommended
oh*
i mean it's an organization thing, having them all together is more organized and you need to copy paste less code
but you can just have them separated
i would recommend making them individually then combining them all together into a spritesheet
Are individual files not recommended? Lmao
i can do that, yes
Depends how many atlases you wanna make ig
i might use the original game files and go from there
i have like 30 atlases
I found larger atlases typically more clunky to manage, though a lot of my jokers use larger atlases for multiple effects
wait, what is the difference in game of 1x and 2x? is the smooth pixelart option?
yes
you can just scale it by 2x
if you want to use placeholder art then i strongly advise against using vanilla jokers for placeholders, use dedicated placeholder art so it's more easily detectable when you still have a placeholder
make your own, or use some from other mods
Based on my total number of additions, I have 176 atlases in the game at minimum
Cryptid has a really great placeholder spritesheet that I yoinked for my own uses. I would recommend that ngl
hi something
Genuinely though idk most people considered that odd. It means I can have a basic assumption that almost all of my items start at 0,0 sprite pos
I like my organization lol
I do wonder what the actual file size difference for a combined atlas would be
as long as i dont have to read anyone's code they can organize it how they want :3
I have 13 atlases for way too many objects to count
done, next
Hello hodler 
💀
My code is actually well organized so 💅
<------ might be lying I don't actually know
lmao here's my placeholder art
can i steal use that?
placehodler has too much charm lol
Knowing how things happen here, Place Hodler will appear as an actual Joker in your mod eventually

or in someone elses' idk
Nah probably not that
disclaimer: i don't actual mean this stuff, but if anyone dislikes my love language, do tell me and i'll stop
Sarcasm is usually picked up pretty consistently here
oh nah 
either way works, but i prefer starting at 1x
got it
so i dont screw up the downscaling
I know there's a script floating around that automatically makes 2x assets from files in the 1x folder. I think it might be in the starter pack thread
cuz you have to remember that if u start at 2x then ur gonna have to remember that every 2x2 area of pixels corresponds to a single pixel at 1x
i might actually make the artstyle individually... i know you all recommended to do the spreadsheet stuff but...
cryptid has it
but honestly i just made my own with a gui
so i dont have to deal with clis
adhd man....
I'm also adhd and I do a sheet 😭
brain already focused on doing individually, fuck 😰
fear my power
yup, this
atlas, who's she
This terrifies me
But yeah I do have a ton of atlases that are multiple units wide
I'm thinking to combine some of them that are currently split up, I have some in separate atlases because I just didn't write whatever shaders I was using well and they don't respect atlas sizes as much as they could
Ok but this is just very nice to me
Holy shit this is how I notice a dupe file
lmao
4d joker?
No
Not quite
backs and modifiers lol
oh yeah animated jokers
unfortunately smods does not natively support animations
Cardsauce does some internal animation for some of its jokers like Sprunk
Yeah, nearest neighbor scaling by 200%
I would like to devour this
Most paint programs have a resize option
yup, mine does
Hello, new to making jokers, trying to learn soemthing new, apparently my atlas is a nil value
whats ur joker code
each one of these is a pixel, yes? so i can use the proper brush
shilling my own joker animation lol
SMODS.Joker { key = 'test', loc_txt = { name = 'test', text = { "Retrigger all", "played {C:attention}Ace's}" } }, config = { extra = { repetitions = 1 } }, rarity = 2, atlas = 'MAKMOD', pos = { x = 0, y = 0 }, cost = 5, calculate = function(self, card, context) if context.cardarea == G.play and context.repetition and not context.repetition_only then if context.other_card:is_Ace() then return { message = 'Sog!', repetitions = card.ability.extra.repetitions, } end end end }
while we're at it
Oooo, cool stuff
I should steal everyone's animation stuff
atlas = 'MAKMOD', since the atlas png is called differently
yep, u need to put the key of the atlas
Thanks
best part: no hooks, done entirely within the update function
what's a hook?
one more thing i am going to ask, what is the context.other_card:() for aces?
context.other_card:get_id() == 14
Thank you
so basically (assuming you got to overriding functions in java) its like overriding where you can change what a function does by making it do new things before or after the original was called
huh it should be 142 x 190 for 2x
wait, what about 1x?
Math aint mathing
1x is correct
95x2 is 190
you prob messed up upscaling somewhere
typo, oops
oh
Lol
well hopefully it upscaled properly
yep
see? i just did a typo lol
👍
bless
i thought it was bad mental maths lol
no no, just a typo really
tbf a lot of people are bad at mental math so cant fault them
if it was bad math, i'd have to tell you to complain to my calculator
math sure is mental alright
drives me insane
bro those videos of people having 200 numbers flashed on screen for 0.1 seconds each then having to give the sum of all those numbers at the end makes me jealous
i learned early on math is not my calling
yet here i am, programming
idk what it is but the math i do in this sort of thing comes to me easy versus math in a class
i mean math skills and programming logic knowledge are not mutually exclusive
also math in high school often is just fancy arithmetic at its core, doesnt really get to what makes math interesting
they arent mutually exclusive obviously but you are still getting a general format together in both
there are very clearly similar applications within it which i can solve in a programming format to get my result than i could if you put the paper in front of me and told me to solve it
its unfortunate that most geometry classes (which is where proofs are usually introduced) dont teach proofs in an interesting way
and really, high-level math is a lot about being able to figure out what we can, especially since it's not all solvable

i actually intended on having a similar joker where it loses mult for time and then gains mult if you beat your previous time in a round
interesting
you hate me and want me to explode
😭


hows hot potato going
The first team just got their hands on it today
They've had it for around 7 hours now
i was pondering joining but im so inconsistent at even working on my own mod
but hope it turns out epic
It's gonna be an epic mess that's for sure
We love our soon-to-be codebase from hell
i shouldve joined to make one joker be 467 lines
Lmfao
Also even tho ur not participating you're still more than welcome to join the server and hang out with the cool dev people
i might do that, i know alot of you guys are very cool
(yes even u)
:0
thats awesome of people to ask
where is the link anyway i assume theres a thread yea
yeah
After hyperfocusing
I'm still working on it
Something i came up with
may differ from the finished version
Still ain't done as you can see
yass joker
Something like that
I will obviously make the artwork better
bimbo nation represent
Since i made a placeholder, can i just tell my jokers file to access the placeholder texture in the meantime?
Yeah changing what asset your joker points to is pretty easy
hi
Maybe look at an example of a blind that debuffs all jokers
Study and copy it
someone could tell me how use the utility functions please?
https://github.com/Steamodded/smods/wiki/Utility these explain what each one does
yeah i been reading and looking examples but i still dont get it
what one you aren't being able to get?
the ones that creates things like cards or vouchers
SMODS.create_card?
yea, for example
it take params like set(the set of the card Joker Tarot Spectral etc)
area (the area the card will be emplaced into)
key(the key of the card If you wanna generate a specific one)
and other stuff like edition enchancement seal
what are you not understanding though?
how to integrate it in the returns or context.smth then
like make a joker that when sold, creates a specific card (ik how to make the context)
you do:
SMODS.create_card({
key="<card_key_here">
area="<area_here">
edition={}(editions inside the table if it has any example:{"e_negative"})
stickers={}(same as above)
})
like
that goes where?
if context.selling_card then
SMODS.create_card({
key = "j_greedy_joker",
area = G.jokers,
})
end
this creates a greedy joker whenever a card is sold
ok and i can do the same with every function?
for creating card you'll just do SMODS.create_card()
but
you need to put it at the right place
this for example creates a card whenever ANY card is sold
cuz of if context.selling_card
If u wanted to do it whenever YOUR card is sold for example you would do:
if context.selling_card and context.card == card then
--rest of code here
end
did you understand now??
for that wouldnt be more easy put context.selling_self?
you can also do it that way
both works though
but yeah
ok, thank you very much man, really
thx
idk where to find one
VanillaRemade
i tried to make a new consumable and the game crashed fuck
@ocean sinew srry if its been like five minutes but could you help me?
nope, still crashed
It's at like 1031
You misspelled consumeable I'm guessing? Check the spelling in the docs
still
oh
@azure laurel
did you change it to SMODS.Consumable{
}
instead
and If you did whats the crash now?
THERE
it doesn't take a table it takes a key
debuff = { is_face = true } isnt debuffing face cards
can i see the code
now im testing the consumable as a tarot, then ill give another shot to the new type
also just now found out that winning the blind crashes the game
i dont understand what you mean
i meant the SMODS.add_voucher_to_shop
oh
wait whats a table?
and this is a key = ()?
key = ""
disable and defeat don't have context
the is_face thing might be that you cant use that and the context to debuff at the same time but idk
oh
i mean SMODS.add_voucher_to_shop("v_blank")
what am i supposed to do then? i copied the joker debuff stuff from vremade crimson heart so what do i toss and what do i keep
you will need to also add a check for face cards there I'm guessing
so toss the if_face stuff
k
yay it works
i already assumed i dont need the disable stuff cuz chicot and matador cant save you
how would i get celestial packs to draw cards only if you have a specific joker?
i dont think you can
how do I check that
could i, theoretically, repeatedly take ownership of celestial packs in add_to_deck and remove_from_deck?
so that when i get it it's true and when i sell it it's false (with a check to check if i still had more of that joker)
idk if booster packs uses add_to_deck and remove_from_deck but If It does couldn't you just hook Card:add_to_deck?
no in the joker
Idk
can i has some help? (card.ability.extra.suit = 'Heart' atm)
though If you want to not draw cards to booster packs you can hook Card:open()
should be context.debuff_card:is_suit(card.ability.extra.suit) == true
should be is_suit(card.ability.extra.suit) not is_suit() == card.ability.extra.suit
also i don't think debuff_card is called for jokers?
so
if context.debuff_card.area == G.playing_cards then
if rank = 'Jack' or rank = 'Queen' or rank = 'King' then
return {
debuff = true
}
end
end
if thats what youre doing
well we'll see
just do is_face()
context.debuff_card:is_face()
in discord
Am trying to make a edit button
ahhhhhh
that's the character you need
```lua
would look like this (i escaped it with backslashes to show you)
```
yeah ok that doesnt work, do i do it in like context.setting_blind
how i make that in the collection, this consumables had name, they just appear as ERROR in black
seems like debuff_card is called for jokers... (looking at grab bag code)
let me test if this actually works
your loctxt is not correct
one is outside
and you need a ["default"] one too when it has no loc_txt for a set language
also is es_419 a valid language prefix??
why aren't you using localization files
that is what happen
how?
collection in the loc_txt
oh yeah that
how?
and ["es_419"] is also outside
if context.debuff_card:is_face() then is crashing the game
outside where?
collection = ""
outside of the loc_txt table
Hi, I am trying to make a joker that changes played face card into queen
calculate = function(self, card, context) if context.individual and context.cardarea == G.play then if context.other_card:get_id() == 13 or context.other_card:get_id() == 11 then return { message = 'Queen!', assert(SMODS.change_base(played_card, "12")), } end
however, assert triggers before hand is played, crashing, is there G.play that happens before scoring but not after hand is played?
if context.debuff_card and context.debuff_card:is_face() then
ahhhhhhhhhhh
It's structured like this rn
{
loc_txt = {
["en_us"] = {
},
["es_418"] = {
}
}
}
your assert is in the return
take it out
ohhh thank you
also you might be looking for context.before?
there it works
nice
Is there a way to have a booster pack just pick from a table of joker keys?
and you make the set your objecttype's key
its currently doing a load of nothing
How do I center the background image?
put that in and played on a deck of only steel red seal kings, none of them were debuffed
if context.debuff_card and context.debuff_card:is_face(true) then
ahhhhhhhhh
is this right?
yeah that should work
it'll only apply in blinds though
bump
it doesnt >:(
update steamodded
if context.debuff_card and context.debuff_card.area ~= G.jokers and context.debuff_card:is_suit(card.ability.extra.suit)
still nothing??
are you in a blind
a string i think
would it be 'Hearts' or 'Heart'
"Hearts"
ahh okay
How can i modify the winning hand of a blind?
ok its debuffing for the first blind, it then debuffs the next one in the shop, and then when the blind starts, gets rid of the debuff
get a random suit at the end of every round and change card.ability.extra.suit based on that
thats what im doing
vanillaremade has a couple jokers that do that
how would i get celestial packs to draw cards only if you have a specific joker?
is there a context for after cards are drawn?
local function create_placeholder(align,colour,extra)
align=align or "tm"
colour=colour or G.C.CLEAR
extra = extra or {}
return {n=G.UIT.C,config={align="tm",colour=colour,button=extra.button,ref_table=extra.ref_table,},nodes={},}
end
function enter_edit_page(ref,target)
local contents = {
create_placeholder()
}
--create_edit_prompts(target, contents)
local edit_page=create_UIBox_generic_options({
contents=contents,
})
--G.FUNCS.exit_overlay_menu()
print("overlaying?")
G.FUNCS.overlay_menu({
definiton = edit_page,
})
print('overlay?')
end
why is this crashing?
it is, thank you
Modding dev might enjoy learning that I'm gonna make a lot of the experimental, custom features I use in my mod in a publicly available API mod
(I will document it well dw)
Any attempts of iterating through the ability table for whatever purpose fails as the ability table is empty
This means that Invisible Joker doesn't make an exact copy of a Joker for example
easily fixable afaik
I just hooked pairs for that 🚎
I mean yeah. If we had Lua 5.2 there's apparently a metamethod thing for it
But alas, stuck in the 5.1 mines
metamethod thing for what???
I'm just curious sorry
and what metamethod
that said I can update my PR for it
yeah, they're relatively recent additions
you can do it though
But in general we're talking about an SMODS PR I put up to track scaling changes
local o_pairs = t
pairs = function(t)
if t then
local mt = getmetatable(t)
if mt and mt.__pairs then
return mt.__pairs(t)
end
end
return o_pairs(t)
end
this works
it............ shouldn't
it does
I use it in my scaling_mod class
for some stuff
Unless Love2D 11.5 doesn't actually use Lua 5.1
meta.__pairs = function(t)
--print("pairs called")
return next,reference,nil
end
it uses
but you can just hook the pairs function
and then add it yourself
you can do the same for ipairs
overwriting ipairs to always do one less iteration
what context calculates selling a card with a specific key
context.selling_card and context.card.config.center.key == "<key_here>"
G.FUNCS.bl_utils_back_to_last_edit_page = function (e)
print("current page:",this_variables.current_page)
local last_page = this_variables.pages[this_variables.current_page-1]
print("last page:",last_page)
G.FUNCS.overlay_menu{
definition=last_page
}
print("overlayed")
for i = this_variables.current_page,#this_variables.pages do
this_variables.pages[i] = nil
end
this_variables.current_page=this_variables.current_page-1
end
why this doesnt work 😔
last page is valid
G.FUNCS.edit = function (e)
local card = e.config.ref_table
local this_menu = create_edit_menu(card)
G.FUNCS.overlay_menu({
definition=this_menu
})
table.insert(this_variables.pages, this_menu)
this_variables.current_page=this_variables.current_page+1
end
I'mma show error wait
is there a way to trigger something that isn't an unlock condition when continuing a run from the menu?
yess I fixed it
I just had to clone the table
local runstartold = Game.start_run
Game.start_run = function(args)
local ret = runstartold(args)
if next(SMODS.find_card("j_para_garagefork", false)) then
SMODS.Booster:take_ownership_by_kind('Celestial', {draw_hand = true}, true)
else
SMODS.Booster:take_ownership_by_kind('Celestial', {draw_hand = false}, true)
end
return ret
end
why does this hook crash on the third line
you're missing the self
also i forgot to answer before because i had to go out but i think the easiest way to do your effect is to literally make the joker draw cards
can you do that
(without significant patching/hooking)
this is all draw_hand does
you can probably just put that in context.open_booster
but i haven't tried it
N go to sleep
what property of the booster pack determines if it's a celestial pack?
Thank you for the invitation I will be in your bed in moments
.config.center.kind
I was very focused then my cat randomly jumps into the desks and starts pressing the keyboard keys
😭
how do I put this green thing down?
use G.UIT.C
config = {
extra = 2,
choose = 1,
},
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.choose, card.ability.extra } }
end,
weight = 0.9,
cost = 4,
kind = "BTCTPack",
create_card = function(self, card, i)
ease_background_colour(HEX("2a61eb"))
return SMODS.create_card({
set = "Batrocities",
area = G.pack_cards,
skip_materialize = true,
soulable = false,
})
end,
select_card = 'jokers',
in_pool = function() return true end
}
does anybody know why this booster pack crashes the game?
What is that line in the lovely dump?
don't return an SMODS.create_card call, just return the table that you passed as the argument
No, that is fine.
what does that mean? sorry I'm new to coding
Go to Mods/lovely/dump/functions/common_events.lua and what is on line 2168?
oh cool
for k, v in ipairs(_starting_pool) do
Is Batrocities a valid ObjectType/ConsumableType?
The pack is trying to spawn jokers from the Batrocities pool if that's what you're asking.
Yes, is Batrocities a valid SMODS.ObjectType?
Did you make a SMODS.ObjectType with the key Batrocities?
how do you tell if something is a valid object type? My friend coded most of the mod and I'm unsure if he did.
can you find anything like this
SMODS.ObjectType{
key = "Batrocities"
}
No, it's a SMODS.ObjectType
Consumable types can't have jokers.
Does anybody know exactly what function is used to sort Jokers when you drag a Joker?
-- Batrocity joker pool
SMODS.ObjectType({
key = "Batrocity",
default = "j_btct_MichaelWave",
cards = {},
inject = function(self)
SMODS.ObjectType.inject(self)
end,
})
like this?
yes
the set is Batrocities but it should be Batrocity instead @dense ginkgo
@dense ginkgo just do this
SMODS.ObjectType({
key = "Batrocities",
default = "j_btct_MichaelWave",
cards = {},
inject = function(self)
SMODS.ObjectType.inject(self)
end,
})
change that line
Yes, the key is wrong.
The key changing worked but the pack is only spawning the fallback joker.
You mean the default?
yes
How many jokers are supposed to be in the pool?
65 and counting
Did you solve the problem by changing the key of the ObjectType or by changing the set that the Booster was using?
The set
Are you using the right key when putting the jokers in the pool?
I will test that
It worked thank you very much.
key = 'catner',
blueprint_compat = true,
loc_txt = {
name = 'catner',
text = {
"Gives {C:money}+$1{}, {C:chips}+20 Chips{},",
"{C:mult}+15 Mult{}, and {C:mult}+x0.2 Mult{}",
"for each cat joker.",
"{C:inactive}Currently #1# cats.",
"{C:inactive, s:0.8}' 'catner catner catner; catns the amount of catners that catn catners in this encatner' when'"
}
},
cost = 5,
rarity = "cry_epic",
pools = {
["cat_shop"] = true,
["cat"] = true
},
atlas = 'spr',
pos = { x = 3, y = 0, },
config = { extra = { cats = 0 } },
calculate = function(self, card, context)
if context.joker_main then
local catcount = 0
for _, J in ipairs(G.jokers.cards) do
if J.config.center.pools and J.config.center.pools.cat then
catcount = catcount + 1
end
end
-- here is where it sets
card.ability.extra.cats = catcount
return {
dollars = catcount,
chips = catcount * 20,
mult = catcount * 15,
xmult = (catcount / 5) + 1
}
end
end
}```
why does the 'cats' local variable not get set to catcount every check (everything else about the card works as intended)
Because you're not putting it in loc_vars?
Is there a way to temporarily disable card selection?
G.hand.config.highlighted_limit = 0
can anyone help me understand why the ankh mod isn't working? It's showing as activated in my mods list but no menus/settings available for it. Timer doesn't start either
Hi something 👋
Works, thank you
hey does anyone know why the hell this tarot flip is happening in the wrong order?
use = function(self, card, area, copier)
for i=1, #G.hand.highlighted do --Flip to back
local percent = 1.15 - (i-0.999)/(#G.hand.highlighted-0.998)*0.3
local target = G.hand.highlighted[i]
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.15,
func = function()
target:flip()
play_sound('card1', percent)
target:juice_up(0.3, 0.3)
return true
end
}))
end
delay(0.2)
for i=1, #G.hand.highlighted do --Change enhancement (should be while still flipped back but it's not?)
local target = G.hand.highlighted[i]
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function()
target:set_ability(G.P_CENTERS[card.ability.enh_conv], nil, true)
return true
end
}))
end
for i=1, #G.hand.highlighted do --Flip back (should be after the enhancement happens but it's before????)
local percent = 0.85 + ( i - 0.999 ) / ( #G.hand.highlighted - 0.998 ) * 0.3
local target = G.hand.highlighted[i]
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.15,
func = function()
target:flip()
play_sound('tarot2', percent, 0.6)
target:juice_up(0.3, 0.3)
return true
end
}))
end
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.2,
func = function()
G.hand:unhighlight_all()
return true
end
}))
delay(0.5)
end,
i'm comparing it to the vanilla function and i can't see where the difference is
what if i just swapped their order. maybe the event manager just does things in the order of 1 3 2 and nobody mentioned this anywhere ever. that's not insane to think
-# can you tell i've been frustrated about this for quite some time
you set delay_sprites in :set_ability() to true
when its true another event is added
which will be after all the events below
shrug
I tried creating a booster pack for my custom consumables but for some reason I can't get the name or description for it to show up in game
Have you tried making the prefix lowercase?
which prefix?
that argument is used in vanilla for vampire and midas mask
... i think i figured out how i got here. lol. i copied that line all the way back when from the bucket of cement. the joker that acts like vampire and midas mask.
thanks past me for not even making a comment "i don't know what this delay_sprites thing does but vanilla did it in these contexts"
The mod prefix.
just tried that, it didn't work
Guys, is translating consumable type possible? I have a consumable type "Fruit" and I don't know how to translate it's label to other languages
Yes, you use a localization file.
How?
It translates anything but consumable type
k_consumabletypekey = "Consumable Type Name"
In Localization > misc > dictionary
And b_consumabletypekey_cards = "Consumable Type Name Cards"
Oh, I accidentally added mod prefix inside of key. Thank you very much
Theres a way to add animated jokers? And if so, how can i do it?
how do u replace a texture (not something u can do with malverk like jokers, i meant like the title screen logo)
I guess you can use set_ability(self, card, initial, delay_sprites) to do so
Found it in SMODS wiki
No.
Now I don't trust SMODS wiki
You use the same key as the atlas and you put raw_key = true in the SMODS.Atlas
whats the key to the logo in the main menu screen
balatro
Thx
how do i make a joker retrigger itself specifically 9 times
if context.retrigger_joker_check and context.other_card == card then
return {repetitions = 9}
end
Also you have to enable it in SMODS.current_mod.optional_features
SMODS.current_mod.optional_features = {retrigger_joker = true}
ok
how do i retrigger a joker 10 times
bumping from last night: trying to debuff certain suits and its behaving really weirdly
if context.debuff_card and context.debuff_card:is_suit(card.ability.extra.suit) then
return {
debuff = true
}
end
card.ability.extra.suit has a random suit chosen at the end of the round and that works fine.
however, it will debuff on the first blind, then it will debuff in the shop and remove the debuff for the next blind, then it will add the debuff for the next blind but for the wrong suit and from then on it does the debuff in the shop but not in the blind thing
if context.retrigger_joker_check and context.other_card == card then
return {repetitions = 9}
end
gurrrhh i think its like this but with like a ten mauybe
what about 11 times
dunno
yeah this is a thing with the debuff timing
are you using context.end_of_round to change it?
yes
try context.starting_shop
no
ok
what about 10 times
works great! thanks!
i wonder why the timing needs to be specific you'd think it would just work huh
debuff_card is also called at end of round and it undebuffs whatever was debuffed, if you change the suit it will instead debuff the other suit during the shop basically
so you need to change the suit after that debuff_card
ahhh okay
could i do
G.consumables.config.card_limit
to change consumable limit
consumeables*, but yes
ty
How do you add japanese characters in text
Do yknow how to do that or
have you tried just putting them in and seeing what happens
You could look at https://discord.com/channels/1116389027176787968/1326135270759993364 or https://discord.com/channels/1116389027176787968/1379136953307500645 because I remember seeing fonts there
Nothing displays
Won't display
ah fair enough
"text {f:5}日本語{} text"
Is it really that simple 😭
yes
Wow
Thank you N
N' the modding-dev legend
Indeed
good morning chat
good morning!
Good morning!
my head hurts
but only on the right side
maybe cause i'm left handed
time to go work on the artwork
good morning
help how do I make this actually work?
i.e. just change the spawn rate thing of rarities.
both vanilla and modded
get_weight function
how would i make something not appear in shops
like, would I just hook it and shit?
in_pool = function(self) return false end
G.GAME.modprefix_key_mod
(read the docs)
Which one
rarity
not helpful
I need to change that value dynamically, as well as vanilla rarities.
Can I modify directly default weight?
why can't you just change the value in G.GAME like N said?
Multiply certain rarities weight by 0.95, others by 0.05
those numbers can change via a voucher
oh yeah?
yassifies your jimbo
so why would it clash with other mods if you change the _mod value?
idk, I figured they would change the silly mod number and the fine-tuned bs would break
Am I doing it wrong?
the comment is the best part
is it not working? what are you trying to do
It's working. I have a consumable that gives 1$ for each fruit-themed joker. And it should work with gros michel and cavendish, so I just hardcoded this thing
I don't think it's a good implementation
it looks fine
it would be better with an SMODS.ObjectType but that basically does the same thing
is there a way to add certain things to pools
not as in cards, like effects on the cards (such as doing things to them like forcing editions or setting cost)
there's no pool calculate functions or anything like that if that's what you're asking
what abt the other 2 things
for those kinda stuff you just gotta pray other mods that add fruit jokers add them to a Fruit pool
:3
upscalling was... horrendous
why are things never easy
i need my glasses
shit, so do i
sorry maybe i misunderstood what are the other two things
what does "forcing editions" even mean
like, forcing them to have 1 edition that cant be changed?
ye kinda like that
and also spawning w/ that
Can someone give me a simple example code for creating ui boxes with squares and text?
look i got emperor glitched that had 13 on it, and i thought it was funny
hook to :set_ability (or create_card) and :set_edition i think
the former hooks are there to give the joker that edition
Yea i read it, but i still dont understand
you then want to hook to :set_edition to make sure they cant get other editions
ne way i just wanted to ask because i could have gotten some really funny ideas from that
also i have no clue how to hook currently and dont want to learn :P
sob
hooks are simple though
the whole idea, basically, is just making your code run whenever a function you hook to runs
i would recommend following the creating a uibox part
fixed the scalling issue
to me it seems the 2 hard parts about balatro modding is 1. hooks and 2. patching
its probably more something else for the first one but ive also heard stuff abt patching
so you can directly modify what the function does
hm neet
I guess I'll just take ownership
both are relatively simple to understand
the real beasts of modding are ui, using love2d functions and shaders lol
you don't need to take_ownership to add things to pools
you can add the key when you create the pool
yeah prob
Uh, does Lua have something like .contains? Or should I make my own search?
you have to make your own
but also what are you trying to do
<@&1133519078540185692>
:(
it's better to save it as an index in that case
omg im used as an example
hihihihihihihihihihihi
🥺
woah, another doggo person
I used tangents as an example not "Tuahngents" so yk
hawk tuah bro!
i still use you as an example of what modders shouldnt do :3
fuck..
haaaiii
How do I only show a button/text during a run (not in shop, or when selectief blinds)?
Selecting*
you would need to add a func field to the config that points to a G.FUNCS function that hides it
sorry i dont have any examples on hand
for jokers, do i need a jokers.lua or
you dont need one but some people like to for organisation
no it can be named whatever you want and you can add whatever other stuff there
i've just got all of my stuff in one lua file lol
Correct me if I'm wrong but doesn't that just hide the button when clicked
I think the question was more about when to show it to begin with but I might be missing smth
(I'm also trying to learn UI)
i might divide the jonklers, consumables, etc into different stuff
no, func runs every frame
you're thinking of button
That's generally what most do
You can take like 3 paths
- all in one file (sinful)
- one file per category (normal)
- one file per item (mildly overkill but can have benefits)
ohhhh thats not right
if context.debuff_card and not context.debuff_card:is_suit(card.ability.extra.suit) and not context.debuff_card:is_suit() then
return {
debuff = true
}
end
worked for the first blind
i'll go for the 2nd option, sounds like me
Fair
i am sinful and proud
I did that too at first then switched to the 3rd option
Cos I made smth that skips broken files/items instead of crashing
what's the second is_suit doing
stopping it from debuffing jokers
then the not is wrong
Check if a joker is inside of specified pool
but also idk if that works
Mods lobotomise this individual
it does because i just put it in and it worked
if you're doing pools properly with object types then it's just if (joker.config.center.pools or {}).poolkey then
see?
You can check if a card is not from Joker set
how do
idk how the not works there
context.debuff_card.ability.set == "Joker"
hello!
Hi!
im working on a deck that causes changes to ante to also effect the total joker slots
I don't actually know how to code in lua so i wanna ask to make sure this isnt gonna cause a
memory leak
or something
calculate = function(self, back, context, card) self.config.extra.current_ante = G.GAME.round_resets.blind_ante or G.GAME.round_resets.ante if self.config.extra.current_ante != self.config.extra.last_ante then G.jokers.config.card_limit = G.jokers.config.card_limit + (self.config.extra.current_ante - self.config.extra.last_ante) self.config.extra.last_ante = self.config.extra.current_ante end end
wow thats hard to read
since im checking for != instead of == like usual
it should be fine right?
i wont be able to test this until la-
now nothing gets debuffed
ah thank you
most of my coding experience is python
this looks fine, I usually wouldn't recommend doing stuff in calculate outside a context check but this one will work
yummy spaghetti noodle between my chopsticks! 💖
Sometimes Lua feels like it's not a real language
i thought it meant approximately but thought that made no sense so i wasnt sure at all
may i see the code
i dont really know what calculate is (i cant read im an undertale fan!!)
but okay!
Personally i hate lua syntax but you get used to it
NO! jk
Same
does this mean i could just do this outside calculate and it would work fine?
funnily enough it's because you need to use ~=
oh my fucking god
not a == b
is wrong
I think you better do it in an event
(unless b is boolean)
do it inside claculate but you should have an if context.whatever check
no, this is fine
i meant that calculate does things with contexts (check the docs) and doing things outside can cause issues if not careful
i have a bunch of context checks for beating the boss, hieroglyph, petroglyph, and even antimatter because i felt like nerfing it at first but changed my mind
and then i thought
maybe i should just not bother checking and it might work?
anyway thanks for the help
oh also i didn't notice but you should use card.ability instead of self.config
still debuffs everything after the second blind!!!!! 🤬🤬🤬🤬🤬🤬🤬🤬🤬
deck configs cannot keep track of state (unlike cards, they have the ability field)
when are you changing the suit
as in card.ability.extra.*?
yes
start of the shop like you said
you're telling me
and ⛓️ we winning we winning

