#💻・modding-dev
1 messages · Page 128 of 1
lemme have a look. its current function suggests you are referencing the cards held in your hand somewhere
got it
makes a nice little tune though when they trigger lol
it does lmao
what I wrote there was bollocks. I thought the held-in-hand cards were giving +3
ah sorry
they still shouldnt be doing it regardless though
they are doing it three times though
where else would they be getting the number of times to do that other than the round count in card.ability.extra.rounds I assume
right i should show those actually
yeah please
text = {
"{C:mult}+#1#{} Mult in",
"final hand of",
"the round",
"This Joker gains",
"{C:mult}+#2#{} Mult every",
"#4#{} rounds",
"{C:inactive}(Currently {C:mult}+#1#{}{C:inactive} Mult)"
}
loc_vars = function (self, info_queue, card)
return{vars = {card.ability.extra.mult, card.ability.extra.mult_gain, card.ability.extra.c_rounds, card.ability.extra.rounds}}
end,
having c_rounds and rounds could be dangerous
config = {extra = {mult = 8, mult_gain = 2, rounds = 3, c_rounds = 0}},
forgot the conf
I ask once again: Is there a way to check if someone is in a run or in the main menu?
got you
probably find it in game.lua
^
I used G.OVERLAY_MENU recently to check if one is looking at the collection or deck view. There is probably one for main menu/runs
An easy way is to check if G.jokers
you need to go into the game's source code if you havent got it already
will do i guess?
It will be nil if there isn't a current run
or just have someone who knows more than me say this
I assume c_rounds is like 'count rounds' or something
guys am I being silly
so I see you are ticking it up every round
loiterally my round counter yeah
Am I doing this right, it causes a crash when I load up the deck
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
local SuitChosen = PickRandomRank()
local NumberChosen = PickRandomCard()
for i = #G.playing_cards, 1, -1 do
SMODS.change_base(G.playing_cards[i], SuitChosen, NumberChosen)
end
return true
end
}))
end
}
btw this is what is done for the suit and Numbering choosing
Cardnumber = SMODS.Suits
Rankchoose = SMODS.Ranks
function PickRandomCard()
local index = math.random(#Cardnumber) -- Get a random index
return Cardnumber[index] -- Return the card at that index
end
function PickRandomRank()
local index = math.random(#Rankchoose) -- Get a random index
return Rankchoose[index] -- Return the card at that index
end
should that last bracket be there
SMODS.Back{
name = "One Card Deck",
key = "absolute",
pos = {x = 0, y = 3},
config = {polyglass = true},
loc_txt = {
name = "One of a Kind Deck",
text ={
"Start with a deck with",
"only one kind of card."
},
},
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
local SuitChosen = PickRandomRank()
local NumberChosen = PickRandomCard()
for i = #G.playing_cards, 1, -1 do
SMODS.change_base(G.playing_cards[i], SuitChosen, NumberChosen)
end
return true
end
}))
end
}
yea
can i see the crash log?
oh ok
No crash happens, the cards just dont change
oh 1s
@sonic cedar Id be so much more useful if I'd made a joker, I've just done consumables and seals so far
its no bigggieee this is literally my fourth day of modding this game i didnt expect it to be easy
are current chips and mult stored somewhere? if so, what variable are they
i know G.GAME.Chips is final chips
but like
what if i want the current amount of chips
I believe you're looking for hand_chips
for the chips (it's a global value)
and for current mult it's mult
@sonic cedar Something useful for debugging I've found is to just put print('test') after an if statement you want to check is querying properly.
ill try that then!
hold on why is config polyglass
your cards arent polyglass
use debugplus and do eval <command> to run code while the game is open
eval print() helps with a lot of things
what does evaluating a print do
@sonic cedar can't see anything glaringly wrong atm, sorry! Might try and make it myself and see where I get to.
i mean
that doesn't help with checking if branches are being followed when they should
well yeah but it helps with checking if a value or a table has the right thing in it
idk man, im trying my best lol
thats alr! thanks for the help where it was lmao
I usually type value get while hovering the joker
what
also try asserting the change base
another debugplus thing
oh neat
prints card info
that would've been helpful a while ago
ill see if i can
but right now i need to debug something absolutely awful that i don't understand
i've got a function in my mod that does something completely different on my computer than on elbe's computer and I don't understand why
cryomancer is making fused jokers for me but for elbe it makes fusion materials like it's supposed to
My inital thought is that it is somehow accessing the cards held in hand at the end of the round
https://github.com/Steamodded/examples/blob/master/Mods/DeckOf4s.lua
deck of 4s should help as well
i have a theory but let me do some print checks with how it is first
@sonic cedar also, this check doesn't really make sense with what you want. This checks if it's your last hand, not your final one (as in the one that breaches the blind score).
I should make more deck examples
can you make enhancement example
Oh sorry you want final hand as in what Dusk does @sonic cedar
take a shot every time bigfact pings toma
well it's a deck of nils
I did this earlier but that was because I deleted the cards manuakly and then put invalid cards into it
Should be 10 of spades tbh
that one seed for erratic deck:
Is there an existing way to prevent jokers from ever appearing in the collection?
Like, not just never getting unlocked, but never showing up at all
delete the collection
no_collection = true in the joker definition iirc
Yep, that's it, thanks
now that i think about it im pretty sure tmj doesn't respect that
ill add that to my todo list
how would I check if a certain voucher has already been redeemed this run in code?
G.GAME.used_vouchers[id]
alright, thanks
It chooses a random card every game and just makes that the whole deck
Anyone know how to find the code for Hanging Chad?
-# and maybe how to convert a card to a Lucky Card?
Im thinking about adding support for enhancments and stuff
Quick question: How does the game determine if a joker is compatible with blueprint and brainstorm?
card.lua in Balatro's game files has the code for every vanilla card
Not sure how for vanilla Jokers, but to make one compatible, just put blueprint_compat = true in your mod code.
ok
drunk off my shit
alcohol poisoning
yes dw that was on purpose for dusk effect
blueprint_compat == true only controls whether blueprint says "compatible" or not. To actually make your joker not compatible, you have to add a check at the start of calculate, something like if context.blueprint return end
this is just cosmetic
Also this ain't valid syntax, you missed a then
u right
WHAT????????
Kind of a nuissance, but I guess that's Lua.
yeah you have to manually exclude code from blueprint compat
no, that's 
1000% thunk coding
there could be an automatic check to exclude blueprints when it's set to false and just handle the other cases manually, but
didn't do that
it'd be super cool if smods had that
if only we had an smods rep somewhere around here we could forward it to
am i doing something wrong, cuz the enhancment is not giving 1.25 X mult
context.scored doesn't exist
but what if it did… 
no more syntax for this (signed from a person who does Java)
snippet from my latest code
calculate = function(self, card, context)
if context.main_scoring and context.cardarea == G.play then
return { mult = card.ability.extra.m_mult }
end
end
somebody’s having fun
assuming new calc
(no)
this sounds fun, it wants to make me implement quantum ranks
what have you done
(please this is a call for help how do i make a recursive function that searches for straights with arbitrary length and with support for suits)
Something something graph algorithms
Is there a neat way to add the little side boxes that display by a joker while hovering, like the one on perkeo that explains what negative is?
thank you, literally been trying to figure this out for 3 days now
in loc_vars it is the info_queue
wdym by support for suits
Check for Runner 2 in ModdedVanilla.lua
Thank you
💀
meow
i wish it was that simple
i wish
loc_vars = function(self, info_queue, center)
info_queue[#info_queue+1] = {key = 'e_negative_consumable', set = 'Edition', config = {extra = 1}}
end,
this is how it looks for perkeo's
no i really do wish it was that simple
definitely don't do recursion for this
why does this sound so simple
do you think it'd be possible to have is_rank in steamodded the same way as is_suit exists
it kinda is
prolly would require to modify all vanilla jokers accordingly tho 💀
😭"
would worth it at the end (100+ mods with wild rank enhancement)
hey where do I go to ask about modding/ game crash errors?
i am using recursion so it supports the "next" card attribute
- get all highlighted cards
- sort them by rank
- start from the left, if next card is +1 rank, keep going, else end, no straight
- if next card is same suit or wildcard, keep going for suit check, else end, no straight flush
- if reach end of list and straight check didn't fail, it's a straight, if suit check didn't fail, straight flush
is it not this easy?
don't do this
i mean
cards aren't guaranteed to be in ascending order for straights
where would i put my prints for this function?
well that's why you sort them in ascending order
oh
that's assuming there's a linear order
my algorithm assumed that i have already sorted the card which is the case
yeah idk better to sort the ids
oh, right, i didn't account for shortcut
arbitrary ranks can have any kind of structure connecting them
btw don't forget to account for shortcut joker
good to know.
and shortcut exists
just copy steamodded get_straight and modify it imo
i was doing recursion so it supports the "next" card property
if smods find card shortcut and next rank is +2 then straight continues
else if next rank is +1 then straight continues
else straight ends
there we go
just so I understand, what exactly is it you're trying to support that steamodded's get_straight currently doesn't?
oh I got so distracted i was here to ask about adding permanent +mult to playing cards
is that a thing
-# iirc the current implementation doesn't handle split paths correctly for relatively small straights in larger hands, so I do need to rework that one even if not for quantum ranks I think
add a for loop?
and then double that with two straight flushes from different suits
alright so straights of any length
quantum thirteen straight flush
oh
3 dolar
cryptid spoilers (you babies)
||The Entire Fucking Deck is a secret cryptid hand that contains every card in a 52 card deck||
so it's just that
so if you add straight wrapping to this
programmatically implementing these straight flushes
infinity straight when
in checkered its half right
ok so I am having a weird issue where if I redeem a voucher while in the round, the buttons below the cards don't come back up...
so does anyone know anything about adding permanent +mult to playing cards
ี้
uh
look at runner code
in example
that has
nothing to do with anything i just said
runner is a scaling joker that scales its own chips
I want the hiker effect but it adds mult instead of chips
but the value you increase for that is called perma_bonus so idk if there's an equivalent for mult
i'd start with makig custom card ability
there isn't but you can easily add your own permanent versions of stuff
liek playing card ability
thats what i did
alright then how do I do that
you would need to add it after perma_bonus
its usually a few lovely patches
this is a lot for 1 showdown blind effect of 1 fusion but excessive is my middle name so i'm fine with it
do you need to do anything else to make these functional
or do they just work
yeah you need to go to the respective Card:get functions to make them work
i don't know what that means
which then you call here
how can i make a joker have 2 luck factors? like "if 1 in 100 do this but if it hits 1 in 1000 do this"?
so using a pattern function, replace return self.ability.mult with return self.ability.mult + (self.ability.perma_mult or 0)
ok first method i tried was correct i just messed it up
yeah i'm kinda stupid ii think that's too much
i can just make it give 1.25x mult when a card scores and not scale
what does the third do
some unbalanced shit
why does it say print
you can do it
its the concept of the mod
like I definitely can do it but
it's a lot for something that like, nobody is gonna get to see anyway
this is an effect that would trigger after you start a speciifc showdown blind with a specific fusion (that being the chicot fusion)
if it were a regular joker fusion and not a legendary one i'd consider it
you gotta tell us now
even if you get the joker it's a 1 in 5 chance you get the showdown blind in question
showdown blind? thats a new term
if anyone can help with this i will be very much appreciated https://github.com/Aikoyori/Balatro-Aikoyoris-Shenanigans/blob/3d1ef24b19a9eb3b0699d297d9fab982290348f0/modules/pokerhands.lua#L73
that's the term bonus blinds uses for the final boss blinds
^7 billion mult
oh I see
is that not the common name for them
or add some other stuff
oh thats more interesting
i hear finisher blinds around
the wiki says finisher blinds
that's any boss blind though
there's no "official" user-facing terminology
ah right
showdown is what the game code uses
true true
wait how do i make that
idk
ima figure somthing out
check cryptid
.
oh yeah
just make it win the game
us modding nerds use showdown
is there a better way to debug
how do you make a consumable cound as any planet card for observatory
them normies use finisher
i use finisher 😢
998 print calls
😭
five hundred debug prints
why am i not debugging in normal lua environment to see if it would even work
print call every frame
why am i stupid
wdym
like
because you'd need to import a bunch of base balatro stuff to make it work in a normal environment
instead of desinging the algorithm in the game
and that's a lot of work
nah that would be boring
watching some op mult going on is better
DebugPlus is actually just a really convoluted collection of print statments
then make it give X100 mult 10 times
i love print statement
i'll try ^7billion
DO NOT!
way too much
theres a reason why cryptid gives only like ^3
What is the keyword in {C:} for grey text in loc_txt.text
inactive
inactive
inactive
inactive
active
Thank you all
CRUCIFY THEM
GET OUT-
we love some custom colours (does Steamodded have custom color hook because i missed it)
GET OUT
#brain #bruh #edit #effect #effects #freak #freaky #meme #memes #memories
#gaming #gameplay #games #game #getoutside #gta #gta5 #gtaonline #gtav
#lightning #lightningmcqueen #cars
you can just hook by yourself tho
btw can jokers just not share the same atlas?
do like ^3 mult
they can use the same atlas?
I tried, but the other joker is not showing.
^pi
hey gang ik there's a variable for money per hand but is there a variable for total money from hands? I want hand money to be fixed at 4 for an effect
did you set the x and y?
^banana
Yep, it's set to 71 and 95 for X and Y.
uh oh
now gotta check cryptid
chat am i supid
I want all last three lines to be grey.
Would this work or I have to add the modifier in each of the strings?
i did that 6 times in a row. I put the code outside of the brackets
each
okay yeah but consider
name = "Prideful Joker",
text = {
"Played cards with",
"{C:stars}#2#{} suit give",
"{C:mult}+#1#{} Mult when scored",
}
},```
this is correct is it not
check your loc_vars
Ah. You cannot use the same atlas and textures for 2 Jokers.
Also, how do I change the font size
its something like {G:}
i dont remenber
Fun fact: the bird is actually the Australasian Swamphen.
i love rhythm game
-# and magpies are birds with confirmed kills.
{s:0.9}
Thank you
where did i get g from
we share 3 rg servers
i might improve the art later rn i just want the straight algorithm working
Do I need to put them in separated brakets?
Or would this do?
(My brain automatically applied html logic, for some reason)
use double brackets whenever you want to use simple brackets
"this joker doesn't work"
greatest joker of all time 🔥🔥🔥
{C:inactive,s:0.6} or {C:inactive}{s:0.6}
it'd be cool if the pickaxe was striking a block with sparks coming off
the former
Is there a way to do this but with the funny spinny animation thing?
is there some way to force the Bottom button row to reappear? (the play/discard button, etc)
yeah i aint understanding anything from cryptid
:juice_up?
it does the wiggly thing
try :juice_up(0.8, 0.8)
after
so set ability, then juice up
ok
That ain't the spinning animation I am looking for.
I am looking for the one used when enhancing cards and stuff.
ye
then flip again afterwards iirc
and make sure to :flip() em back afterwards haha
we are so in sink
let that sink in
now, how do I delay the second flip so it doesn't look weird as heck?
... or delay stuff in general.
delay()?
?
Me when my stupidness kicks in
i saw it somewhere
Delay only delays events
If your code isn’t in an event it’ll evaluate straight away
gonna settle down with this
with my luck it'll go extinct immediately
X401.1
I love this gif so much
i mean i can just make it x4011
why he feet so freaky big
yeh i made it x4011
the better to play balatro with of course
anyome know if there's a way to make a joker immune to having its values changed by things like cryptid oil lamp
i feel like theres a config otion you can set to tell cryptid to leave you alone
You can blacklist the mod in your mod code.
Jen's Almanac does this for Pokermon.
generally my thought it to not break other mods with my mod
i'd probably ask in the cryptid thread or it's dev channel
probably morep eople who would know there
Extracted right from the source.
But yes, ask the official dev.
isn't this like
malware technically
classic jen moment I guess, christ
Ehh, that's a dicey definition.
time to lovely patch jen's in my mod
is that the balatro font
i guess i should ask in cryptid yeah
were can you download that font? now i gotta put it in my code thingy
this is the font in question
isn't this a list of mods that will stop Jen's Almanac from loading if detected
I mena this could just be conflicts then with steamodded
It'll just make Balatro "crash" if they're detected.
but this is code
It'll tell you to either remove Jen's Almanac or the blacklisted mod.
yeah
ok
They don’t conflict though right? Isn’t it just jens personal choice that you shouldn’t use those mods?
fusionjokers/infinite fusion i could see actually conflicting
the rest, probably personal choice
cryptid discord scares me i ended up going and looking around and coming back
what is going on i dont get it
Ah, I never even considered the implication of having that many hands on the first few antes
@rough furnace hey i've got a lot of reports of awful glitches happening with our matador-like joker retriggering horribly, do you think you could add matador to ModdedVanilla example so I can see how to properly do the context filtering on it
even when i mimicked vanilla it retriggers like 5 times
This deck makes it so you have like a bajillion hands and discards so to balance the hand money I had to make it to where it's $1 per 6 hands
whats your calculate look like?
oh i see it now
Did you check for context.repetition
yeah hang on i'm screenshotting the calculates
originally it looked like this which caused an infinite loop of upgrades due to it not returning
then i switched it to this
but it still retriggers way too many times
I feel like that context check is too narrow
yeah
just not sure what im missing
i tried printing context to see if there were any to add but didnt really get too far with that
so when do you want this to trigger
just like matador, it triggers when boss blind ability is triggered. once
but its a scaling joker that upgrades chips
oh wait I was thinking luchador
does anyone know how to make the upgrade message on a scaling joker display on the joker itself? i feel like this should work, but the "upgrade" message still appears above the cards rather than on the joker
if context.cardarea == G.play and context.individual and not context.blueprint then
if context.other_card.ability.effect == "Lucky Card" and not context.other_card.lucky_trigger then
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_mod
return { message = localize('k_upgrade_ex'), card = card, colour = G.C.Chips}
end
end
if context.joker_main and context.cardarea == G.jokers then
if card.ability.extra.chips > 0 then
return
{
chip_mod = card.ability.extra.chips,
message = localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } }
}
end
end
end```
seems like it just uses context.debuffed_hand
shit you're right
how did i miss that
think me and myst both missed that pretty sure they added the context filtering, might be misremembering though
looks like you still need the G.GAME.blind.triggered as well
does adding card = card to your return work?
yeah i kept that there
card = card is already there
you can ignore the second half thats just about the final message when it scores that works fine
card = card and card = other card do the same thing which feels... wrong
no wait its not just that actually
cause that doesnt account for all the other stuff
matador has two instances of the upgrade in the code
one for that context
Does juice_card = card work?
and one for else
it seems like its check is with context.before true
well it fixes the problem but now the lucky cards are shaking a second time?
what does your return look like now?
return { message = localize('k_upgrade_ex'), juice_card = card, colour = G.C.Chips}
hmmm
the color isnt working either but who cares
I wonder if this is a new calc bug or not
@wintry solar is this a bug or do we just not know how to use calc?
christ almighty we need a blind ability triggered context it seems like if i wanna make this work i have to actually filter out literally every context thats listed before the else in the code
what am i LOOKING AT 😭
someone in my discord found a solution, focus = card works
the color still doesnt work but i can live with that i guess
i tried doing the print eval
eval is a function
how would print crash your game?
printing too many times
I don't see how it would?
oh
I've printed like multile times per frames for a logn time and it was fine
yikes
i hate modding (i love modding)
what version of DebugPlus do you have?
y'all its holy banana time
Is there an extended guide on how to actually use this?
(dont mind the rarity)
ill update debugplus in case that has something to do with ti
wait what does your DebugPlus > config look like?
no config icon 💔
showHUD=true
logLevel="WARN"
ctrlKeybinds=false
debugMode=true
showNewLogs=false
I want to make mod that enables negative card modificator as part of game
mod is WIP 💔
no like in the gui
still having problems with that recursive shit i am talking about
Like, so i wouldn't need to use debug mod
I forgot to properly mark dev versions for the last bit so I can't tell if your on it rn
Do you have any advice how to do it
Contribute to Aikoyori/Balatro-Aikoyoris-Shenanigans development by creating an account on GitHub.
a lot of recursion
that's probably why idk
nvm
i am stupid lmao
hold up
might be
in SMODS.Blind, how is boss defined? Is it boss = { min = #, max = # }?
lemme limit the depth it prints
also if you upgrade DebugPlus you can just do print(table) and it will expand it for you
how do you do dump_loc with the new json metadata
yup limiting the streak depth fixed that
does glitched automatically change things or do you have to do other thins
"dump_loc": true
glitched changes values when the edition is applied and never again
iirc
like if i had a consumable with config.extra, do they get changed or do you have to specify that they will be changed
I think its autoamtic
🤔
hows the performance?
also aure hjow praticle do you think it is to not call a joker's update every time (for the vanilla ones)
yet to test performance, gonna go eat smth first
probably works for vanilla ones, though I'd have to check the use cases
I want to make a lazy_update where it will only be called in a few cases instead of every frame and I would want to make some vanilla jokers use it for performance
my thought for when it's called is
- generating hover ui (loc_vars)
- before calculate
- before/after add_to_deck (not sure exactly)
- remove_from_deck
- I'd have to double check other places
urgghh now it just crashes after the third round blind
how does one convert this to the new calc system
calculate = function(self, card, context, effect) if context.cardarea == G.play and not context.repetition and not card.debuff then effect.mult = pseudorandom_i_range(pseudoseed("mtg-squirrel"), 1, card.ability.extra.max) end end
is there a way to set the boss blind using DebugPlus?
you can hit reroll boss blind
but there may also be a thing you can do in the console to do it
I ask again: how does one make a custom deck? mainly, what the heck do I put in config = {}?
go to your collections, hit "blinds", then hover over the blind you want and press 3
Nice, didnt know that was a thing. Thanks!
for the config question put your variables' values in config
What language does Balatro use anyway
lua
lua
lua
anyone know how i could make a joker that counts all cards as wildcards?
just made yet another joker
how does psuedorandom work with the new steamodded?
idk how this works. Is there a place where I can read more about whatever the heck this is?
Look at code for smeared joker
Probably have to patch in a change to card.lua
is there a way to prevent the Play Hand/Discard Button row from not coming back up again after more than 1 voucher is redeemed at the same time?
Now I want to figure out how to do art So I can try my hand at Balatro modding
wdym by that
When making the SMODS.Atlas for SMODS.DeckSkin is the px and py the same as other cards (71x95)?
The card arts
if you use krita i have a template for the card size made
should probs put it in #1224362333208444989
is it all just pixel art?
Does SMODS.DeckSkin want the skin images to be just one suit each (4 atlases total) or can they all be in one image?
yeah
The colour should be capitals that’s why it doesn’t work
I’ll take a look at the message location stuff
is is now in there
Where can I look up all the sound I can play with play_sound function?
nvm found them
?
hey there, would it be possible to make a joker discard cards in hand, similar to how the hook does?
yes, but i dont know how it works, and expecially in new calc
yeh i’m trying to wrap my brain around how the hook works rn
in the mod im helping work on, there is a card that discards your entire hand, but i have not tested if it works in better calc, so let me check on that
sorry i’m brand new to modding, what’s better calc?
the new system for steamodded that was recently added
ah okay ty
so it apears that it is not working with better calc, so im going to try and work on it
Idk if i used patching right or not but this doesnt seem to work.
Do i need to reference patches in the json file or smth? or put it in a specific folder
pattern patches can be tricky with multiline iirc
you don't need a lovely patch for this, we have quantum enhancements
what is this?
will that wrok for what im attempting? i want my joker to make all cards work as wilds
you can just put this in your joker's calculate
if context.check_enhancement then return { m_wild = true } end
okay ty anyway!
this will make all cards act as wild cards in addition to any other enhancement they might have
i see. Thanks! had no idea this was a thing
@frosty dock so do you know how pseudorandom works with ne calc? or where to find any refrence to work off of
wdym
pseudorandom isn't affected by new calc
calculate = function(self, card, context, effect) if context.cardarea == G.play and context.main_scoring then return {pseudorandom_i_range(pseudoseed("mtg-squirrel"), 1, card.ability.extra.max)} end end
as an enhancment
you're just returning a table with your random number at index 1
if you want it to be evaluated as an effect, you need to tell it what effect it is
mult? chips? dollars? hand levels? how would I know
object_type = "Enhancement", key = "squirrel", atlas = "mtg_atlas", pos = { x = 0, y = 6 }, config = { extra = {max = 6}}, overrides_base_rank = true, weight = 0, in_pool = function() return false end, loc_vars = function(self, info_queue, card) return { vars = { card.ability.extra.max} } end, calculate = function(self, card, context, effect) if context.cardarea == G.play and context.main_scoring then return {pseudorandom_i_range(pseudoseed("mtg-squirrel"), 1, card.ability.extra.max)} end end
full code
ion need the full code
I just need you to make your calculate function tell the game what it's doing
the effect is trying to do a random +mult on a D6 (+1d6 mult)
you're not telling the effect to be +mult
your effect's key currently is the number 1
oh, so its missing the effect
return { mult = yadayadayada }
also how do i change the suit of a card in a similar way to something like the sun or moon
was that changed?
If you want to figure out how to do something that already happens in the game, you can look for it in the game's files. Anything that a tarot card or joker does will be in card.lua
well i have looked but cant find anything there that works
is there anywhere internally that stores boss blinds you've defeated this run
i wasn't paying attention and my joker did an oopsie but i need to know which boss it was on
Check obsidian orb from cryptid
Pretty sure it uses something like that
Hey what's the context for playing a hand that I can use to activate like the second you push the button? Because I'm trying to make a joker that makes it so hands have a chance to use 2 hands instead of 1, but most of the contexts I normally use for jokers happen after ease_hands_played(-1).
cool thanks
context.before
triggers before the hand scores
Lemme try
is there an easy way to determine that you're on a boss blind?
when you enter the blind, context.setting_blind and context.blind.boss does the trick
hey there! is there an easy way to add collab face cards to the game or is there a public template that you can use to add em? thanks
thank you!!! i thought it was a context thing but the drop-down autoconplete list didn't show this
Balatro be looking a little sus
anyone?
Like the skins? SMODS.DeckSkin can work with that
yeah the collab skins
https://github.com/Steamodded/examples/blob/master/Mods/ExampleJokersMod/ModdedVanilla.lua i think this should help?
Theres some info on the SMODS wiki, though it is a bit bare bone. https://github.com/Steamodded/smods/wiki/SMODS.DeckSkin
This is what I did for mine. This is for all Spade cards. You can remove which ones you dont need in the ranks section:
-- Spades
SMODS.DeckSkin{
key = 'skin_key',
suit = 'Spades', --Spades, Hearts, Clubs, Diamonds
ranks = { '2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', 'King', 'Ace' },
lc_atlas = 'SkinAtlas',
loc_txt = 'Skin Name Here'
}
actually how would you apply these in context? for reference this is what i'm trying to whip up, i've gotten it to work without checking for boss blind
I just want to make mod so you could find negatives modification in playing card booster packs
Given steammodded gave this thing functionality
I can't just leave it untouched, u know
ty!!! if i release the mod to the public i will credit you if you want
if context.setting_blind and context.blind.boss then
bossflag = true
end
if context.joker_main and bossflag then
---joker_main code
end
if context.end_of_round then
bossflag = false
end
something like this
probably put bossflag in extra
nb. You dont have to credit me if you want.
thank you! would you just initialize bossflag without any value?
Like i don't want to make jokers or anything like that, i just want negative cards be available without debug
initalize with false
How would I replace the Ace of Spades on the title screen with a different card?
Talisman's lovely.toml patch has an influence on the card, you can check there?
I see it in there. is there anyway to do this in lua or do I just need to use a lovely patch?
Haven't seen a Lua example, so no.
do you guys know any mod that adds custom seals
I think cryptid does
I checked, it doesn't
Green Seal, Code cards.
azure seal too
Cryptid\Items\CodeCards.lua, search for local green_seal = {.
for making a lovely patch, do I just create a lovely.toml file or do I need to do something in my main lua file for it to work?
Lovely checks for any .toml files.
I see Talisman has a [manifest] header with dump_lua = true. What does that part do?
The lovely folder in Mods contains a dump folder with the changes to the .lua done by patches from what I can see.
Makes it easier to see if a given patch was applied, maybe? I just kept the dump_lua part as-is.
Is there a way to make hand size automatically equal your deck size? Or should I just make the handsize a massive number
I want a Joker called "52 card pickup" that just makes you draw every card in your deck
#G.playing_cards is the number of all cards.
Cryptid also has a joker like that if you need reference
Effarcire, to be specific.
would I be able to change the replace_card on the title screen to a modded suit with a lovely patch? it seems to crash when I do so.
https://github.com/MathIsFun0/Cryptid/blob/78b16fbc28c4d61cbbd2303edc0e85f54efa943a/Items/Exotic.lua#L283-L310 See this for the potential implementation.
where would i start in terms of creating a custom ability? gonna try a different approach with this joker's code
hm this doesn't fully work in terms of quantum ranks
it can find invalid straights and even invalidate previously valid ones in some cases
are you also figuring out the straight algorithm
yes
hi guys !
i was wondering, how do you create a balatro mod ?
🔥
what i have currently should work for arbitrary split paths on single rank cards
I've tried making it like cryptid but the localization doesnt work (it keeps showing "test")
try removing the loc_txt
i hate everything about pools
can i like borrow yuor'e code or something i am so tired
i can check if there's actually a valid straight with hall's theorem or similar but i don't love the idea of doing this on every iteration
esp given checking every subset is exponential w length
I think I'm holding off on quantum ranks for now
is it different than Jokers where I could use loc_txt and the localization file?
also removing loc_txt from my seal made it worse
i don't mind too much, I'm currently taking graph theory anyways
tbf the course I'm taking doesn't focus on the algorithms that much
I took the required math classes and dodged everything else
im sorry for yoinking the code i want to do something more fun than coding straight algorithm for 3 days straight
i tried 3 times
and it's all a giant mess
the card choosing part doesnt work yet but the ui part does :3
context.other_card.lucky_trigger is not working, is it the right variable for seeing if a lucky card triggered?
this is my code
it doesnt give money like, at all
even if it should
does anyone know why the play/discard buttons don't come back up after redeeming more than 1 voucher at the same time?
is there some function to force it to show up again?
if I have global vars defined in fileA.lua and I use SMODS.load_file on it in fileB.lua, would I be able to access those vars just by calling them?
"You draw the {s:2.2}ENTIRE FUCKING DECK{}"
lmao bet I'll change it to this
can anyone help with this?
Does smods have an API for adding global values for a run that should be saved when exiting the game?
no need for an API, you just put your values in G.GAME
or any cardarea or the ability table of a card in a cardarea
Use {T:key} in your description
mr john smods can we have a mod that just adds poker hands with more than 5 cards as like a reusable part for many mods
or does that already exist and i am just slow
i don't see why we couldn't have that, afaik there's no uniform system in place
cryptid has ascended hands, which wouldn't want to have anything to do with other hands with more cards
could fuck up cryptid's ascended hands
maybe also for additional hand selection
Anything immediately jump out as wrong here? (hands_per_hand is in a patch)
disregard my message, person i'm working with figured it out
it's literally just {C:spades}
not G.GAME.current_round.hands_remaining == 1 could be reduced to G.GAME.current_round.hands_remaining ~= 1
can someone please help me with this?
huh, after you said that it just worked
swear it wasn't working before
weird
What do you mean by more than one voucher at the same time?
if I redeem more than one voucher back to back using this code:
function redeem_voucher(voucher)
G.E_MANAGER:add_event(Event({func = function()
local voucher = create_card('Voucher', nil, false, nil, nil, nil, voucher, nil)
voucher.cost = 0
G.FUNCS.use_card({
config = {
ref_table = voucher
}
}, true)
return true
end
}))
end
it will put the game into a state where the play/discard buttons are gone and the only thing I can do is select cards or do some other stuff
Okay guys for some reason this doesn't activate on the first hand of round
Someone is trying to download my mod but they keep getting this crash, on the other hand it's not happening to me
How do I troubleshoot this?
It looks to me like when your custom voucher is redeemed, you're creating another copy of it and redeeming that copy. is that what you're trying to do?
it's not custom vouchers, only in game ones.
All I am trying to do is claim 5 random vouchers when a joker is sold
the code I sent is the voucher redeem code but I also have the other code pieces for picking the 5 random ones.
I can send that code too if needed
Is there a reason you're not calling `voucher:redeem()'?
Does the wording make sense or can it be worded better? The X2 mult does not stack with the X3 mult.
how would I get the voucher object though?
Aren't you creating it with local voucher = create_card('Voucher', nil, false, nil, nil, nil, voucher, nil)?
yea, but didn't you say that that makes a copy? or did I understand that wrong?
(keep in mind that I am new to lua and modding balatro)
ok so I tried your suggestion
it does redeem them correctly
but now there are copies of them on the screen
also is there a way to change their position?
What argument is getting passed in to function redeem_voucher(voucher)?
how to get whether a consumable is owned or still in the shop?
do voucher:redeem() iirc
a string of the vouchers name, stored in these two tables:
local base_vouchers = {
'v_overstock_norm',
'v_clearance_sale',
'v_hone',
'v_reroll_surplus',
'v_crystal_ball',
'v_telescope',
'v_grabber',
'v_wasteful',
'v_tarot_merchant',
'v_planet_merchant',
'v_seed_money',
'v_blank',
'v_magic_trick',
'v_hieroglyph',
'v_directors_cut',
'v_paint_brush'
}
local advanced_vouchers = {
'v_overstock_plus',
'v_liquidation',
'v_glow_up',
'v_reroll_glut',
'v_omen_globe',
'v_observatory',
'v_nacho_tong',
'v_recyclomancy',
'v_tarot_tycoon',
'v_planet_tycoon',
'v_money_tree',
'v_antimatter',
'v_illusion',
'v_petroglyph',
'v_retcon',
'v_palette'
}
Gotcha. After calling voucher:redeem() you can can voucher:remove() and that should get rid of the copies on the screen
alright
i'm pretty sure you can pull this out of a table within the data and don't have to keep track of all this manually
and how would I change where the voucher appears?
what table is it? I haven't found one
oh vouchers are legally cards
first joker babyyyy
ah
G.GAME.P_CENTERS, look for set == 'Voucher'
that art is mad clean
thanks, I worked hard on my jokers
That's a more complicated question, because the game has different logic for putting cards in different places on the screen. What I would do if I were you is think of an effect in the game that puts a card where you want your vouchers to go, and then look at the code for that effect and copy whatever is moving the card to that place
if i were implementing this i'd do an inordinate amount of bullshit for something nobody notices like making the joker's texture have its sell value on it
ok
here's a not-yet-implemented joker I'm quite proud of (Foolproof)
doing this makes the voucher not appear at all on screen
another one I'm very proud of
i'm making a consumable that depletes money on use and want to prevent the player from using it if they don't have enough money
the JOKER!!! button
so i'm trying to account for the cost of buying the card in my can_use functions
what's this one supposed to do
BIG RED BUTTON:
When sold, instantly clears the current blind, and sells all other jokers.
oh wow
it's intended to be an emergency escape button
kinda like mr bones but more impactful
pretty much yeah
hmm
let me think, i think the single thing i'm proudest of in the mod i'm making is the bugfix i implemented for making madness (and other boss jokers) activate on the first two blinds on an ante even if they are bosses, like this
Foolproof's original idea isn't that great in all honesty so I'm probably going to do something else, but the original concept was that it stopped jokers from showing up while you had it and granted a x7 multiplier (minus 1x for every joker you had but it)
PDTA mentioned
the joke is that it's foolproof, so no more jokers show up
Purple deck
Is there any tutorial on how to make mods?
this is done by completely overwriting context.blind in calculate_joker with something called a "proxy object", which is a blank table with a special metatable which essentially "redirects" all accesses to another object, but intercepts certain keys (in this case blind.boss) and runs its own logic to determine what value it should give back
do you know lua? that's the best place to start
kind of
i know its like simplified C#
I have a couple of joker arts I need to add code to so here's the others why not
eh not really, lua and c# are totally different beasts imo
but anyway
the telephone is good
you'll wanna start out by making a folder in %appdata%\Balatro\mods called whatever you want, and then following this https://github.com/Steamodded/smods/wiki/Your-First-Mod
thank you
every blind is a boss blind but your hand side is 16 and you can play 10 cards at a time
Missing Poster is directly based on Walter White's missing poster but don't tell anyone
I'm crying
hand size and hand count is normal, actually, it's a custom challenge, but you get 6 hands a round and 5 discards
in exchange, grabber/nacho tong/wasteful/recyclomancy are all banned
removed the quantum rank jank because it wasn't working properly and would have to be a lot more inefficient. it looks to be about as fast as the previous implementation but slower with shortcut. Seems to be noticeable only when evaluating straights on larger amounts of cards, 28 cards gave me around 4x compared to previous, with 5 cards there's practically no difference
I'm going to make my own challenge
i will probably be reusing this proxy object system a bunch because it's very useful for hooking values
gl, look at SMODS.challenge
i just have a loop that loads a bunch of files and evals them, passing the result to SMODS.Challenge
like such:
-- Challenge loading
local challenges = {
'test',
'stencil_joker_1',
'escort_mission',
'the_lion',
'power_scaling',
'bleed',
'low_selects',
'eternal_egg_1',
'eternal_egg_2',
'low_hands_1',
'low_hands_2',
'grand_master',
'bullshit',
'power_scaling_2',
}
for _,i in pairs(challenges) do
-- use a metatable here to swap out the challenge custom rules to provide a description if locked?
local ch = SMODS.load_file('challenges/'..i..'.lua')()
ch.key = i
if not ch.deck then
ch.deck = {}
end
ch.deck.type = 'Challenge Deck'
if not ch.unlocked then
ch.unlocked = function(self) return true end
end
if ch.debug and not NSC_DEBUG_MODE then goto continue end
SMODS.Challenge(ch)
::continue::
end
what if there was a boss blind called the floor where you have to score less than the actual blind or you lose
ignore the comment about reworking the vanilla unlock system
that's on the roadmap, but i haven't done it quite yet
i am very confident i can pull it off though
i will be adding 30 stickers
funny, i had the same idea and tried to implement it in my mod
what is thy mod?
strange pencil
didnt work out tho cus of balatro's ante skip glitch
vanilla challenge definitions do not support adding rental or perishable stickers to jokers, nor do they support consumable editions, i have written lovely patches to add support for those things because i use them
Jokers and stuff for mods but all i can really do is art and stuff
if you ran out of cards it would just increment your ante forever
"cards not played previously this ante are debuffed"
TECHNICALLY there is support for consumable editions, but it's limited to them only showing up in the challenge select menu -- once the run begins they will all be default, which is very undesired
it is literally a one line patch though
[manifest]
version = "1.0.0"
priority = 0
# Make consumable editions appear in game
# The game technically already has support for this, but it's incomplete
# (they show up in the challenge select menu, but when entering a run they're default edition)
# Game#start_run
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "add_joker(v.id, nil, k ~= 1)"
position = "at"
payload = '''
add_joker(v.id, v.edition, k ~= 1)
'''
match_indent = true
must play 7 cards
adding custom challenge modifiers also kinda sucks but i've got it down
(custom rules like "blinds don't give reward money")
especially if your rules want more than one locvar
that's already in the base game i thought?
that is in the base game yes, i was giving it as an example of what i'm talking about
my modifiers look like this
why tf does this happen i literally changed nothing and it stopped working
internally they look like this
Can someone read this to me
best place to start diagnosing a crash is to crack open %appdata%\Balatro\mods\lovely\dump
that has the dump of the game's code with lovely patches applied so line numbers will be right
'attempt to compare number with nil' sounds like you should be returning a value someplace, but aren't
it's this line right here
if pseudorandom('troubadour') < G.GAME.probabilities.normal/4 and G.GAME.current_round.hands_remaining > 2 then
is there a good way to find what cardarea a card is in
maybe current_round.hands_remaining is nil for some reason?
im finally out of ideas
wait why are you using pseudorandom('troubadour')
are you trying to reimplement troubadour
oh
also
it's hands_left
not hands_remaining
yeah I'm rebalancing it for a specific deck
i use this variable here
hands_remaining does not exist therefore it's nil, the right variable is hands_left
Weird, it worked when I had it earlier
it should never have worked
the jimbo demons haunting the codebase
true...
Okay yeah that fixed it
ALSO
For some reason it's not proccing on the first hand of round even when the probability is 100%
talking about pseudorandom has given me an idea for a challenge mod
"All probability-based effects are guaranteed to occur"
which would majorly buff eg bloodstone etc but it would also include things like michael/cavendish's chance to break
calculate = function(self, card, context)
if G.GAME.selected_back.effect.config.ttr_red then
if context.before and not context.blueprint then
if pseudorandom('troubadour') < G.GAME.probabilities.normal/4 and G.GAME.current_round.hands_left > 2 then
G.GAME.hands_per_hand = 2
else
G.GAME.hands_per_hand = 1
end
end
end
end, ```
lucky cards would give 20$ every trigger 😭
That would nullify any negative effect
what is hands_per_hand
"You lose 0.1x mult for every $20"
oh it's in this patch to make it so the cost of a hand can vary
so this has a 1 in 4 chance of using 2 hands to play one hand
if you have 3 or more hands remaining anyway
Yeah
It would be kinda bs for you to lose when you have 2 hands and troubador rolls into using 2 hands
I'm wracking my brains trying to understand why this doesn't work - it's modeled off the logic of The Idol and the Walkie Talkie and i can't nail it down
certainly not a spelling issue i hope but i'm guessing there's part of the syntax i don't actually understand so I'm not using it correctly
what do you mean doesn't work
it doesn't provide Xmult and the message doesn't show up when the conditions are met
smods version?
should be 1.0.0 alpha
which one
would bettercalc even break this
what does the upper right of your title screen say
no but I dont remember what the key should be in old calc
alright if anyone wants to have a look at this https://github.com/Steamodded/smods/pull/389
1.0.0~Alpha-1220a-STEAMODDED
1220 is very out of date huh
for reference the latest version before bettercalc is 1303a
1304a*
1304a*
wow that's weird
wasn't 1304 literally the bettercalc patch
IN A CAVE"
