#💻・modding-dev
1 messages · Page 68 of 1
i always have bad ideas this is nothing new
if you're learning as you go, you'll make bad decisions for e.g. the structure of the code
which will be hard to fix if you're new
that doesn't sound too hard
i do already know python
so fundamentally i feel like im okay
well good luck then
SMODS will always be like that
i see so that's normal
(as will fusion jokers)
because it's not a part of your project
makes sense
i made sure the priority is higher than fusionjokers so this mod loads after fusionjokers
balatro gave me the same error though
that atlas registering looks rather horrendous
at least take a look at example mods for better understanding of how 1.0.0 steamodded works
https://github.com/Steamopollys/Steamodded/wiki/03.-API-Documentation
https://github.com/Steamopollys/Steamodded/wiki/04.-SMODS.Atlas
https://github.com/Steamopollys/Steamodded/wiki/05.-SMODS.Center
oh okay
so I need to write
SMODS.atlas {
key = "Tsunami",
path = "TsunamiJokers.png",
px = 71,
py = 95,
}
did i get that right
ye
and I do that at the top of the code
uppercase Atlas
okay
it doesn't matter
👍
I am still getting the same [ expected near local error
the rest of the code looks like it'll work
i'm having a weird issue with steamodded's consumeable api
i have my consumeables and they're working normally
but the use function's card doesn't refer to the actual card
for whatever reason
are you sure you got your arguments right? it's use(self, card)
it is
the issue is that the values in ability are always the values of the default center
any other mods?
cryptid, talisman, debugplus
i remember cryptid causing similar issues at one point?? though they really should be resolved
hm
i'll try disabling cryptid
okay yeah i turned cryptid and talisman off and it works now
🤔 that's interesting
do you have latest cryptid?
i have the release version of cryptid
that would explain it
yeah use git
Never said you didn't it's just that dev versions of cryptid usually include those fixes
true
latest is generally the most stable (ironically), release version has a lot of bugs that are patched

the only exception to that is lovely beta7
What is even going on with lovely beta7 atm 
i haven't even updated out of fear cause of the crashes
all i know is that the priority is limited to an int32 for some reason
and even then that's just because i heard someone say that jen said to lower priority to within that range
it's a mystery
all i know is that lovely beta6 works just fine
and beta7 doesn't
okay, latest cryptid still has the issue
huh that's wack
I would say something in their discord or in the mod thread abt it as well to see if it can get checked out or fixed
🤔
ya if you post relevant mod code and stuff in the cryptid bug report channel it should get fixed relatively quickly
or look through the cryptid code and figure out what's wrong yourself but that's only if you think you'd find it fun
that's still there?
it's to fix vanilla stuff i think
nah i just fixed it
hm?
i just added self.ability.set ~= "Colour"
still i don't think removing the patch should cause any issues
okay yeah removing it works fine?
i've submitted a PR to cryptid that removes the patch
anyways, colour cards are in again
real
morefluff 1.0.0 will also have jokerdisplay support
can one of y'all Ctrl+f balatro source for if not OmegaMeta for me?
that's Talisman
gotcha. thats the code that's causing lovely's UTF-8 crash
it's odd because it's being passed as the chunk name
:jimball:
I never bought nitro lol
just a question, as i'm getting back into the swing of things for balatro modding:
if i don't set a sprite for an existing joker, will it retain its default sprite after i take ownership of it?
Guys whats the height and width of the jokers, vouchers and consumables?
Also for atlas's you do draw the jokers as individual sprites then import them into one big one?
1x 71*95, 2x 142*190
Wait, did you buff coupon catalog? Bold move if so
it's uncommon now
making a texture pack that replaces face cards with just more queens
oops all queens
your never gonna guess what i called the mod
my favorite cards
Queen, Kueen and Jueen
is there a way to include a literal # in a card's name?
estrogen
i thought that was a suggestion for a method for a moment
yeah that works too
first bit of New Content for the morefluff 1.0.0 port: Cryptid colour cards!
in order:
- Purple: Epic Tag (4 rounds)
- Moonstone: Jolly Joker (2 rounds)
- Gold: Negative Gateway (9 rounds)
- 00FF00: Negative Code Card (4 rounds)
another bit, there's now a T3 voucher for Colour Cards
hey guys, how do you all add joker text on your joker sprites?
I presume they just draw it like anything else or copy the pixels directly from another joker
now we also need oops all kings & oops all jacks 🤔 , but they look good! nice one :D
ty :D
morefluff 1.0.0 will also be compatible with cardsleeves
indeed, it isn't a dick... or a deck for that matter :P It's a sleeve
(it really does look like an i at a distance to me)
What
bottom right
Says "this is not a deck" in french, the e looks kinda like an i
That doesn't look like an I to me...
I may be slightly blind
lmao
for reference, this is kinda what I see when it's all zoomed out
how can i get the edition of a joker?
if you're using steamodded then card.edition.key
@hearty mesa
otherwise its wonky
you need to check like card.edition.negative card.edition.polychrome etc.
also make sure to check that card.edition exists
why did you buff it
it's uncommon now
wanted to test if a card worked while another language was on, picked italian at random, and then got jumpscared
thank you!
SMODS.Atlas {
key = "Tsunami",
path = "TsunamiJokers.png",
px = 71,
py = 95,
}
local splishsplash = {
loc = {
name = "Splish Splash",
text = {
"Creates 1",
"{X:red,C:white} Splash",
" at end of round"
},
rarity = 5,
cost = 8,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
atlas = "Tsunami",
pos = { x = 0, y = 0 },
},
ability_name = "Splish Splash",
slug = "j_splish_splash",
calculate = function(self_card,context)
if
context.end_of_round
then
local card = self_card("Joker", G.jokers, nil, nil, nil, nil, "j_splash")
card:add_to_deck()
G.jokers:emplace(card)
end
end
}
FusionJokers.fusions:add_fusion("j_riff_raff", nil, false, "j_splash", nil, false, "j_splish_splash", 8)
still getting that unexpected [ near local error, it says it happens near local splishsplash = { and near apparently means within one line?
this error happened before i cleaned up the atlas too so I know it's not the atlas
you're probably missing a comma?
i excluded the steamodded header and footer from the code here, rest assured they are in my actual lua file
somewhere
uh, that's very odd
wait isn't there an extra comma? I don't think you're supposed to have one in the last item
you're allowed to do that
ah ok
you miss a } in your loc
makes appending easier
I was guessing
that one's the end of the object
can you screenshot the code? it should show the pairs of brackets
should be here
but there is a } there
no, another one
i need two??
the one there closes the text
you need to close the loc too
then delete the one under pos
so like this
👍
okay i'll try it now
also it's
supposed to be when blind is selected
what's the state name for blind select
context.setting_blind
same error happened
can I see where you try and create the joker object?
is that not what I'm doing
no
when does it crash?
on boot
of balatro
and it still says unexpected [ near local
and it's on the line local splishsplash = {
can you send the crash screen?
it's here
the only difference between this crash and the one I just got is that the crash in the new one happens on line 18 because the code got moved down when i added the atlas
i made sure my mod loads after fusionjokers because i'm trying to register a fusion
oh god fusions, i've never been able to get that working personally lol
I... have expereince in shoddily making fusions... not fusions, lol
i haven't gotten past booting up the game yet so
¯_(ツ)_/¯
once i get past this error
the next error will show up
as is the nature of coding
it also just occurred to me that i forgot to add the line of text that lists the fusion material
added that now
nice
as long as the error changes, progress is being made
I wonder if you're gonna run into problems with Fusion being 0.98 when your mod is native 1.0 code
at first i did it the 0.9.8 way but they told me to not do that
it didn't work before or after i did that though
Jen's Almanac rewrote fusion jokers for 1.0.0 iirc
he just fixed the uhh
should be fine if you pass it the values it expects
it's been fixed by multiple people
can you drop your main file in here for me to look at?
(yes I deadass forgot for a second I was the first one to fix that bug, lol)
that's not what you sent before?
yes that's exactly the same thing
but with the header and footer
this is all the code I have so far
theres no atlas in this
are you editing a different file
oh my god i'm editing a different file
I MOVED A COPY OF THE MOD OUT OF THE MODS FOLDER SO I COULD PLAY BALATRO WHILE I WAS WORKING ON IT
hold on let me
if this works it's gonna be really funny
oops didn't realize i was scrolled up, don't mind me
i mean that's progress
okay it shows up in the mod browser
and doesn't crash on startup
so now I need to create the joker object
that's with smods.joker right
yeah, though I don't see why you'd create this table to then take the values of it and put them in the function, just put them striaght in instead
"put them straight in"?
so by values of it you mean like
the ability and the text and the name of the joker and stuff
right
yes
will my joker by default be undiscovered
i can't find it in the collection but the number of jokers went up so
it's a parameter on making it
if you go via the mods menu you'll find it easily
it also occurred to me I made the mod badge green instead of blue
oops.
fixed that
okay the picture of the joker showed up
but the text has not
is it formatted like the example here?
i think i fixed the format
let me try
okay i formatted it wrong but IT WORKS
also i need to update the text to say when blind is selected
oops
what's the formatting for a joker name
did you fix your calculate function parameters? it should be self,card,context and not self_card,context
oh i'll do that now
👍
and what's the formatting for the (must have room) text
{C:inactive}(must have room){}
thanks
you can open the base game's code by opening the exe with winrar
and then the default localisation string are under localization/en_us.lua
i think self_card should be card and your local card variable should be something different
does it matter what i name the local card variable
nah
okay
(Keeping in mind this is 0.98 code) Does anyone know whey this joker doesn't work?
It just... does nothing, at least when you try it with a lucky card. I don't think the specific enhancement would make a difference though
Joker is originally from Jestobiology and the code is identical. I don't know if it works there, but I'm unsure why it would
Replace context.other_card.ability.set == 'Enhanced' by context.other_card.ability.effect ~= 'Base'
oh fuck are you coding for 0.9.8? i think i take back what i suggested
no
ah
fusionjokers is 0.9.8 i don't know if coding for 1.0.0 will have implications yet
if it causes problems with the first joker it won't be too hard to go back
i am gonna try it with 1.0.0 coding until something breaks
i thought the code was 0.9.8 because there is SMODS.Sprite in it
Shouldn't this be create_card instead?
oh yeah they got me to update the atlas
oh should it be
idk any function called self_card lol
according to 0.9.8 that's how you'd create cards
no dice
What?
Ooh I get it
You also have to change Xmult_mod to x_mult
when i assign x and y positions for a joker
do i need to do anything special to make it work with 2x sprites
or does it just do that
It automatically loads both x1 and x2 with the same pos
?
or does it 2x the position values
You need 2 different spritesheet
well yeah
one for x1 one for x2
And that's it
o kay
alright so
after setting the position values
(since i'm fusing every joker i just decided to copy over the vanilla joker sheets and slowly replace each joker on the sheet with its splash fusion)
i set it to 71 1140 which should be for riff raff, right?
but the sprite is invisible on 2x
olay so it's also invisible on 1x
pretty sure the pos isn't absolute pixels and is like.. the joker grid
oh I know what I did wrong i think
these should be the size of the entire sheet right
unless it was changed for 1.0
i was wrong
there we go
now it's showing up as riff raff
final step is to check if the ability works
uh
okay so when I fused them
I got a cryptid crash?
what
i will now check the joker itself but the fusion is not working
upon starting a blind with the joker it gives this crash
i'm guessing it's one of these nil values that should have something in them
This should be create_card not just card
Ah ignore it
okay
Yeah you're using a library that the IDE doesn't know anything about
(at least I think that's what's going on)
what about the cryptid crash
uhhh
LMAO
it made splash but splash did not get put in the joker slots
Does your thing have the emplace line?
This should have the name of your local variable
ohhhh
okay
fixed
that means the ability works now
but the actual fusion does not work right now
i changed it and it didn't work
is this because of the second line here
Yea this card should be splishcard too
okay
do you know anything about that cryptid crash
dude i just got a seed that drew the hand K Q J 10 9 8 7 6
while testing the ability
everything is working ability side now :D
should it check to see if there's room available?
i don't know i'm gonna test if it already does that or not
it does not check right now
honestly, might just change it to "don't need room" as a buff
yeah i'll do that
but what about this cryotid crash when i fuse it
i don't know about that
🤔
What does your fusion line look like?
does anyone know how to give something a sell button if its in a specifc cardarea?
i have no idea how ui stuff works
i'm pretty sure both nil here are for the carried value
because fusionjokers lets you carry values like sellvalue of the original jokers
and splish splash should not carry any values
@wintry solar
j_tsunami_splish_splash then?
If that’s what you set your prefix and key as, yes
should the slug be j_splish_splash splish_splash or j_tsunami_splish_splash
You don’t need a slug
It’s old 0.9.8 jank
Yeah
alright
Your joker should have a key value
This then
okay
the same crash still occurs
this crash still happens if cryptid isn't there
Did you set your mod prefix?
In the header, or just use the first four characters of your mod id instead
like this?
I think it’s just prefix iirc
did not fix the crash
It might be case sensitive
did not work
still have not solved this crash :(
it is the last roadblock to my splash fusion journey
i need a lua wizard to save me
What’s the problem now?
Hasn’t this error happened before?
Cryptid’s create_card getting a nil center?
Something like that.
Oh nah it’s just missing the mod prefix
This is lacking the mod prefix
ah okays
but i
put the prefix in
on the steamodded header
is it supposed to go somewhere else
show your code
--- STEAMODDED HEADER
--- MOD_NAME: Tsunami
--- MOD_ID: Tsunami
--- MOD_AUTHOR: [Maratby]
--- MOD_DESCRIPTION: FUSES EVERY JOKER WITH SPLASH!!!! Eventually. Except for the ones on the front page.
--- BADGE_COLOUR: 0000FF
--- PRIORITY: -9999
--- PREFIX: tsun
----------------------------------------------
------------MOD CODE -------------------------
SMODS.Atlas {
key = "Tsunami",
path = "TsunamiJokers.png",
px = 71,
py = 95,
}
SMODS.Joker {
loc_txt = {
name = "Splish Splash",
text = {
"When blind is selected, creates {C:attention}Splash{}",
"{C:inactive}(don't need room){}",
"{s:0.7}(Riff Raff + Splash){}",
}},
rarity = 5,
cost = 8,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
key = "j_tsun_splish_splash",
atlas = "Tsunami",
pos = { x = 1, y = 12 },
ability_name = "Splish Splash",
calculate = function(self,card,context)
if
context.setting_blind
then
local splishcard = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_splash")
splishcard:add_to_deck()
G.jokers:emplace(splishcard)
end
end
}
FusionJokers.fusions:add_fusion("j_riff_raff", nil, false, "j_splash", nil, false, "j_tsun_splish_splash", 6)
----------------------------------------------
------------MOD CODE END----------------------
change your key to just splish_splash
you don't need to add j_tsun, smods does it for you
your actual key right now is j_tsun_j_tsun_splish_splash
also, please fix that indentation 😬
i see
will that solve the crash
it should do yeah
i will check soon i am on overwatch
what role?
support
W teammate
Btw for blinds it works different
It will add if it's not present only, so it has some checks
are you sure?
Yes. In my mod I register blinds with key = "twbl_test" (where twbl is my mod prefix) and they added to a game like bl_twbl_test instead of bl_twbl_twbl_test
how does one make a new button
sounds more like the prefix isn't defined properly, I'm not aware of any objects checking whether the prefix is present or not
seems like he's right
if string.sub(obj[key], 1, #prefix + 1) == prefix..'_' then
-- this happens within steamodded itself and I don't want to spam the logs with warnings, leaving this disabled for now
-- sendWarnMessage(("Attempted to prefix field %s=%s on object %s, already prefixed"):format(key, obj[key], obj.key), obj.set)
return
end
How would this behavior be exclusive to blinds?
it's not
huh, I guess you can add your mod prefix to your keys if you want to
and as usual, you really shouldn't 🙃
there's UIBox_button?
it'll also not recognise your prefixes if you put the objects prefix there too, so again, don't prefix your keys
yeah, won't work if you do [obj-prefix]_[mod-prefix]_[obj-key]
you probably start with a github account
yeah i'm doing that
how it feels to spend like 30 minutes figuring out how to make a custom rarity because there is no steamodded api for it
how do I upload a file to my github
also which license do i use
I don’t think it was
yeah, I misread my emails
also it is occurring to me that a fuck ton of these fusion effects require being able to count how many unscored cards were played
is it possible to apply splash's effect while also counting cards that would be unscored normally, to count how many extra cards were scored by splash?
this would be a major help
if only
I think I achieved this by calculating the diff between the poker hand size and the played hand size
When I made splash evo
okay
is there a way i can detect which cards are not part of the poker hand size
some of these effects apply things to those specifically
I made a table with that info, with the poker hand as a key and the size of the poker hand at its value
Taking four fingers into account too
half joker is called j_half_joker internally right
i assume every joker is internally named like that, but after registering a fusion between half joker and splash just like last time, the fusion did not show up
thunk might've named it differently
you should double check in game.lua
(showman for example is j_ring_master or something)
also i'm pretty sure i got the calculation right for how much mult my joker should give
but it's not actually giving the mult
okay it's just called j_half
how do I make the joker output mult
okay
big thanks to frich for helping me understand how take ownership works
i have 4 more joker changes i wanna do 
this is concerning
it seems to have been a fluke?? i'll test again
i am looking at the example walkie talkie
i can't figure out what part of the ability actually sends the mult
not sure, I've never actually made a joker 😅
can someone tell me why ability is a nil value? i'm taking ownership of square joker so it should use all of it's other code
I think it should be card in this instance
I haven’t modded in a while but I think Steamodded reserves the first argument here to the prototype objects the game builds, while the actual Joker during the game is the second argument, card
it also says card is a nil value
this is raising more questions than answers
out of everything card shouldn't be nil lol
Try checking a mod that takes ownership of existing Jokers then
bunco is the only one ive seen and they just implement entirely new effects, what i'm trying to do is add abilities that rely on the existing card's code
Aren’t you copy-pasting the existing code?
no, i'm adding onto it, here's a screen shot of my working code for credit card, i gave it the ability to wipe debt
for square joker i'm adding a new context where if you discard exactly 4 cards it also adds chips, i'm using what should be an existing ability to make this happen
I see. I do think you need to copy-paste because I reckon Steamodded would overwrite the native calculate function
Credit Card probably doesn’t break because it doesn’t use calculate
Credit Card probably works when added or removed from the deck, which have their own functions
yeah it will overwrite the default behaviour
oh! that helps because in testing i recreated the card as a new joker, shouldn't be too much work
Thanks for confirming my suspicion
I wonder if a setting to keep the original behaviour would be good
It would avoid mods copy-pasting code
then what about loyalty card? it's working just fine as well looking like this
i think it's funny how many if statements you can find in the code
I mean you don't need to touch the base code at all
localthunk’s if-else-if Tower of Babel
Well, it’s a good reference
No touching, only looking!
anyways how do i fix the ability nil problem i have, because when i made new joker through SMODS it seems to take care of that problem for me?
try returning something?
when i remade square joker this is it! that's why i'm confused
I'm sorry what is that
the function should be (self, card, context) and then replace self.ability with card.ability
a remaking of square joker with my changes i wanna do in new joker form
lets try that
isn't :register 0.9.8 stuff
IT WORKS
tank you!
thank
my old code is working again
But that’s the first thing I said
It’s fine
it's funny because i have local card = self at the top
in other news, I have loc_txt working with my texture pack stuff 🎉
🥳
now to build the actual selection UI 😭
What does watermelon mean
So is 
now i'm proud to share reworked square joker
well not to diffrent this time around
How do I use it tho
look at what thunk does in the base game
Do you know where I find that
I use notepad ++
But don't I have to open all the files with it
Oh
like this :)
Mods won't load for me 😦 I've followed the steps, and tried several different mods, but when I launch the game, it just runs the base version of Balatro. Am I missing something?
no version.dll
also mods is in the wrong folder I think
the folder they're supposed to be in is c:/users/user/appdata/roaming/balatro
just copy and paste the mod folder into the balatro folder
Thanks for the help. Moving the files there has made no difference. What's the version.dll? I can't see any reference to that file in the Steamodded installation guide
It's Lovely. You need it for Steamodded
ah, ty
im about to cry i cant figure out how to make a button
okay seriously how do i make my joker give mult
the example mods did not help
i just can't understand why theirs gives mult and mine doesn't
here's another example, it's a bit conveluted due to its dual nature, but it's what I found on short notice
it looks like it's almost done by default
so it's the
if context.joker_main
return {
mult = card.ability.extra.mult,
card = card
}
right?
I'd guess so, but you might need more for context
also I haven't seen context.joker_main anywhere
this joker should give +5 mult per unscored card
and i'm using the same method as sdm0's splash evolution to determine the number of unscored cards, which is checking how many scored cards there should be and checking how many cards were in the played hand and then subtracting them and multiplying the difference by 5 to get the number of mult it gives
even when i just tried setting the mult to a static value (was 5 for testing) though, it never gives out mult anyway
most of this code is unchanged from sdm0's, except with me changing the mult mod to 5, because the effects of the splash evolution and the soaked joker fusion are really similar
everything else about the joker works except for the ability
I need to get this working because this function is the backbone to a LOT of splash fusions
where are the joker abilities stored in balatro? i was looking in the source code and it only has the description and stuff i think its loc text stuff
does it work if you don't hardcode the 5 and keep it as card.ability.extra?
keeping in mind to set that extra value in the definition
where should that go
okay
but if this works won't it give +5 mult if there's at least one unscored card instead
i guess i'll find out
nope
i will try that
Also sorry if I'm wasting your time, by coding at all you're well ahead of me at this
nah it's cool
it didn't work
did you set the extra=5 in the joker definition?
What I'd do is just copy the whole thing again completely verbatim, and change stuff while keeping it working
yeah thats what im doing right now
it
didn't
work
i copied everything except the function that calculates the evo condition
it does nothing
seems like there's some problem with variables or something
like... he uses a variable that he set up himself somewhere else
if that were the case it would tell me
the lua extension for vscode doesn't flag anything
gotta go check if the splash evo even works itself
good idea. Most of the problems I've run into with DeFused were problems with the original jokers
speaking of, still trying to figure out why Collectable Chaos Card isn't working
oof, but also good news for your sanity, lol
yeah lol
okay so
I broke splash.
like the vanilla joker
is not working
lmfao, so there's something in your mod probably not letting any of the splash related stuff work
does SDM's splash evolution work without your mod loaded?
i will check that
i can't get the evolution to check it
i don't have it discovered and i can't discover it because splash does not work
even without my mod loaded
splash is not working
well... does splash work without evo loaded?
if it doesn't i'm gonna be
a little annoyed
slightly pissed
yknow just
a tiny bit
no
so... another mod must be breaking it
i turned the speed to 4x and turned off fast forward and the issue is still there
guess it's time to figure out which mod broke splash
when i find the bastard that broke splash
That would imply either a mod screws with this line or a mod/SMODS broke find_joker
This is basically 100% of splash's logic
oh also this is why we need a discover all button
can anyone help me with this?
I just realized that the "#" in front of the variable doesn't seem to be done anywhere else that I can see. Is it that simple?
ahhh, i don't know why it's not working, i feel silly, could i get some help?
nvm, if I remove it it just says it's a table and it can't do math with it
should have expectd something like that
#chaos is the number of things inside of the table chaos
yeah, figured it must be something like that
I imagine the key for the mult return is probably wrong though I don’t remember what it should be off the top of my head, you also have two different key value pairs for mult when you should only have one
Does it do anything right now?
do i need the "mod" configs if its not scaling?
like if i want flat chips nothing else would it be like
config = {chips = 300},
no
Have you tried throwing some debug messages around your function to check where it’s getting to?
right now my bigger concern is that splash, the vanilla joker is not working with a certain mod
and that is fucking up sdm0's evolved splash
and thus also fucking up my fusion since they are very similar
did you figure out what mod it was?
almost
i have it down to 8
i have it down to four
ceres, nopeus, SDM_0's stuff and more joker packs
it's ceres or more joker packs
it's ceres
i fixed it, made a rookie mistake
now a new problem, how do i get the messages to both show and with delay between each other
yeah 100% ceres is causing it
now that i've gotten to the bottom of that
i will test my joker again with ceres disabled
you know what I think I figured out why my joker isn't working
it doesn't apply the splash effect
yep that was the issue
if splash is in play, my joker works properly
now how do I add the splash effect to my joker
well it seems to be basically a single line of code from what was said before
this
okay
it says scoring_hand is an undefined global
(i am putting splash effect on my joker)
again, you're using outside libraries, so that sort of IDE warning is irrelevent
You can probably just check the size of G.play and compare to scoring hand if you don’t need to actually score the other cards
Maybe somebody should make a steamodded VSCode plugin, lol
You just need to open the folder where you pull the files out of the game into your project
Or open your entire mods folder and the lovely dumps will probably have most of it
ah fair
However for this, it should be context.scoring_hand
My coding experience is one quarter each of beginner Python and c++ at a community college 5 years ago that I haven't used since... and it shows
so this before the other parts of the joker ability?
okay but when i booted up balatro it told me scoring_hand was undefined
soooo
Yeah, in this case it was. As Eremel said, if you have your whole mods folder in your project those warnings will be more consistently relevent
Does the joker need to score the extra cards that aren’t in the hand?
i think it's too weak if i don't add that
in future i will need to know how to do this though
You’ll probably need to patch the part that checks you have splash then
what does that mean
like replace the code?
i believe it should be context.scoring_hand and not just scoring_hand?
not sure tho
ye, it's context.scoring_hand
progress!
that's the plan
would there be a simpler menu option? this seems rather overwhelming
I think most people would just want to have a texture pack management like in minecraft, with priorities per pack
individual cards might be good for edge cases tho
unless I am misunderstanding how this would work
Select the object type from the left, the texture displays zone will display all the textures you have installed and then you can reorder the oens you want to use at the top respecting priority
is this awesome
i completely forgot to make it give Xmult 💀
also cost is weird
nvm fixed it lmfao
I agree, this seems drastically overcomplicated / overwhelming. It should be a simple button press / action to start using a new pack imo. If people want to have custom textures on specific cards they can just add a texture pack with only a specific texture
eh, I can work on simplifying it down, the issues arise when you want to combine texture packs, and having a blanket apply button wouldn't work nicely with that
Does selecting the object type just change the example display or do you set textures per object?
set the textures per object
Another Ouroboros :0
I agree that sounds too granular for the average use case
I expect most texture packs to either change everything or one specific set, so the only conflict is when two different texture packs change everything.
Otherwise, you could beg the question of more granularity: why not set texture packs by suit, like the Friends of Jimbo?
I think a global object setting is simpler to use and sufficient for 99% of use cases
when using take_ownership, how do i completely overwrite a joker?
I think you just redefine every thing about it
what are you trying to do?
make it so 8 ball gives the last used tarot instead of a random one
i'm guessing that will need a rewrite of the card
you should be able to take ownership and just replace it's calculate function
what would that look like? if you don't mind me asking
imma be honest I've never used take_ownership
lol, that's fine
for this i never touched the hand context so i'm asuming when i do that i'll replace it?
working with this game spaghetti before won't it just try and do both?
for some reason my planet cards are not localizing anymore, but tarots and some spectrals are. Both Tarots.png files in assets have the correct sprites so I'm clueless what's going wrong.
SMODS.Atlas { key = "Booster", path = { ['it'] = 'boosters.png', }, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas { key = "Tarot", path = { ['it'] = 'Tarots.png', }, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas { key = "Voucher", path = { ['it'] = 'Vouchers.png', }, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas { key = "icons", path = { ['it'] = 'icons.png', }, px = 66, py = 66, prefix_config = { key = false } }
SMODS.Atlas { key = "Joker", path = { ['it'] = 'Jokers.png', }, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas { key = "blind_chips", path = { ['it'] = "BlindChips.png", }, px = 34, py = 34, prefix_config = { key = false }, atlas_table = 'ANIMATION_ATLAS', frames = 21 }
SMODS.Atlas { key = "shop_sign", path = { ['it'] = "ShopSignAnimation.png", }, px = 113, py = 57, prefix_config = { key = false }, atlas_table = 'ANIMATION_ATLAS', frames = 4 }```
I belive smods will just call it's calculate instead of the games built in one
okay ill try it out
I think that smods still separates planets and spectral out into their own sheets, so using the key Planet would work maybe?
As we talked earlier just defining a calculate function with a return will override the native one
OH RIGHT
☝️ this person (me)
goldfish memory
Oh yeah this worked for now. Pretty odd tho to happen so suddenly with no updates since it used to work having only tarot key
nope that was removed when i cut palettes
i do recall seeing something about localized atlases being jank though
so apparently thunk never actually uses set_deck_usage meaning every deck's count is just 1 lmao
lol
what is line 104 even for Rose?
that looks like it came from an event, but I don't see one
i'm mashing 8 ball code with the fool
oh oops there actually is an event I'm blind
lol thats fine
you really need to fix that indentation though
actually, fixing the indentation will probably even show you what the issue is
do you know what I mean when I say "fix the indentation"?
indentation in coding usually is however many spaces (or tabs) you have before a line of code
so this code is not indented at all:
local x = 1
and this code has a lot of indentation:
local y = "hi"
so this is used to space stuff out like my code here?
yeah!
its used for visual grouping and organization
compare no indentation (or imagine nonsense indentation)
if (self.methods.init) then
if (tostring(arg[1]) ~= "___CREATE_ONLY___") then
obj.init = self.methods.init
if obj.init then
obj:init(unpack(arg))
end
end
end
versus "proper" indentation
if (self.methods.init) then
if (tostring(arg[1]) ~= "___CREATE_ONLY___") then
obj.init = self.methods.init
if obj.init then
obj:init(unpack(arg))
end
end
end
this is better
Yeah 🥳
it's like an aspect of grammar in coding
funny you chose the word "grammar" haha
most languages don't force you to indent, and you can do whatever you want
but there are languages that use indentation as actual program control flow
so indenting less/more means it does/doesn't get executed
that is cool! 
anyway, do you spot the issue with your code now?
not yet, but it might been seen in time :)
try matching the "beginning statements" (such as if ... then, function ...() or for ... do) with their end
this seems right so far, good thing it can show me the starts and ends :)
ooh, be careful with that
notepad++ makes some small assumptions about beginning and ends
in this case, something went wrong, but notepad++ just ignores it
oh i see, probably has to do with , then
could you quickly paste your code here?
calculate = function(self, card, context)
if context.individual then
if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
if (context.other_card:get_id() == 8) and (pseudorandom('8ball') < G.GAME.probabilities.normal/self.ability.extra) then
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
if G.consumeables.config.card_limit > #G.consumeables.cards then
play_sound('timpani')
local self = create_card('Tarot_Planet', G.consumeables, nil, nil, nil, nil, G.GAME.last_tarot_planet, 'fool')
self:add_to_deck()
G.consumeables:emplace(self)
used_tarot:juice_up(0.3, 0.5)
end
end
return true end }))
delay(0.6)
colour = G.C.SECONDARY_SET.Tarot,
card = self
end
end
end
})```
uhhh
use ``` for multiline blocks haha
that's better
i have a hand full of jokers in the works so the one you're looking for is 8 ball
I'm gonna turn your code into a very abstract tree of ifs and (){}s, one sec
yeah, spaghetti code
calculate = function(self, card, context)
if then
if then
if then
(({function()
if then
end
end
return true end }))
end
end
end
alright I think this is only the ifs and brackets
that's a good visual
what you see there makes sense?
as in how its just your code without any actual variables?
this is what i'm thinking
yeah, exactly
but there is an issue with the code
because not only the ifs and ends have to match up, the ()s and {}s also need to match up
and they really can't cross lines
if then
(
end
)
can't really do this, right?
is this what's happening?
the ends included are messing this up, so i need to restructure
this end is messing up yeah
I think line 103 isn't needed
almost :)
no, the return true needs to be inside the event function
there it is
103 is ending it early
does Eremel's comment make sense with the explanation I just gave Rose?
here's there working code! i fixed a few other things by the game telling me and now i can counite troubleshooting the rest of the code :)
thanks for explanation how the ends were interacting with the code
would it be possible to see the full code just to double check?
perfect, code looks good
might wanna indent this part though
since its still within the if
haha you don't have to, I don't mind 🙃
did you change a base game joker? nice!
it's using an existing function by the mod tool
last time i was around i dont remember if i got an answer
how do I add splash's effect to a custom joker
Its just a joker check in G.FUNCS.evaluate_play
reminder that i am stupid
what does this mean
Look for the function G.FUNCS.evaluate_play (using ctrl+shift+f) and you'll see it calls next(find_joker("Splash"))
in which lua
ctrl+shift+f lets you find it in every file it exists
what
You use VSCode no?
yeah
Well you can use this nifty shortcut
It search every occurence of the word in every file that's in your VSCode workspace
it's like ctrl+f but better
i can't find the thing
oh wait
i found it
Did you drop your unzipped balatro folder inside VSCode?
okay
Ok nvm
so how do I add a custom joker to that
Either hook or lovely inject the joker you wanna check in
which one of those is easier
actually i should do the first one
because your evolution might have a lovely patch collision with my fusions
am i understanding this right
Lemme check cuz I'm not sure
okay
Nah I don't override it, I write after it
# "Ripple" joker scoring
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "scoring_hand[i] = G.play.cards[i]"
position = "after"
payload = """
elseif next(find_joker('Ripple')) then
scoring_hand[i] = G.play.cards[i]
"""
match_indent = false
oh that's really easy actually
how would I add multiple jokers to the list
patching again for every joker seems inefficient
elseif next(find_joker('x')) or next(find_joker('y'))...
How many jokers there is?
almost all of my fusions will require this
Maybe make a global table with all your fusions and add a check in the lovely inject see if it exists
a table is {} right
Yea, to make it global you just don't write local behind the table variable
would I have to do something like
for x in splashtable
if next(find_joker(x)) then
scoring_hand[i] = G.play.cards[i]
or does it just work if i do elseif next(find_joker(splashtable)) then on that line
I think theres an easier way, you could add a "is_splash: true" to your joker object's ability, then during the function you iterate over your jokers and check if any jokers you got has the attribute (and isnt debuffed)
and how would I check that value
actually that sounds like similar if not more complexity than doing the for loop
if i'm gonna iterate over every joker anyway then what difference does it make
Whatever suits you
i tried out this rarity api you mentioned btw and its like not functional
that is not getting merged anytime soon
it says unexpected symbol near [[patches]]
when i try to do this
Did you do it in a lua file?
oh does it have to be in its own file
ahhhhh
okay
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0
should i change the priority
Idk if it matters really
okay
^This one is from JokerEvo so
well i'd want it to happen after my mod loads right
Doesn't really matter
okay
About this, what if, when your joker is added/removed, you add a G.GAME variable for example G.GAME.has_splash = true
And when it's removed you set it to false
Actually it might cause issue if one joker gets debuffed and you got another splash so nvm
yeah
Oops! The game crashed:
Syntax error: functions/state_events.lua:804: 'then' expected near ')'
?
¯_(ツ)_/¯
Show the content of your toml file
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "scoring_hand[i] = G.play.cards[i]"
position = "after"
payload = """
elseif next(find_joker(Splashtable))) then
scoring_hand[i] = G.play.cards[i]
"""
match_indent = false
trying it with just putting the name of the table in and if that doesn't work i'll do the for loop
oh there's an extra bracket
oh i see
Wait are you sending the whole table to find_joker?
well i'm gonna see if that works yeah
I don't think it will
yeah it didn't work
when i used the for loop method it crashed trying to call the table
i did put the table at the top of my lua file
do i need to put it elsewhere for the game to recognise it
Check if the table exists before looping over it
but then it'll just return false and move on won't it
Was the crash "table is nil"?
the crash was "attempt to call a table value"
Show what your table looks like
Splashtable = {
"Soaked Joker",
"Splish Splash",
}
splish splash isn't supposed to be here, but I wanted to add it to the list just to make sure it works with multiple entries
And whats your loop iteration like?
payload = """
for x in Splashtable do
if next(find_joker(x)) then
scoring_hand[i] = G.play.cards[i]
break
end
end
"""
oh i
left another extra bracket
but that was not the issue
Not only that, but you need to specify pairs or ipairs for the table
huh
Check the vanilla code there's plenty of example
i think i get it
well it didn't crash this time
but the splash effect is also not triggering
which makes me think something is up with the table entries
do i need to put the joker key in there
that didn't change it not working
Show your changed loop
i think i know why it's not working
actually no i don't
but i did move the pattern up by one line because I couldn't figure out how to write elseif for x in... in a way that made the code actually function on that line (it was just being skipped most of the time)
but i think i moved it to the wrong place and I should actually put it lower inside the else part below
this was wrong
If you want to iterate over a keyless table you do for k, v in ipairs(table)
i suspect that's what it is? but the code is still clearly being run because of the call table crash
