#💻・modding-dev
1 messages · Page 436 of 1
linux distros come with python??
holy moly, could it be? i organized my code! :D
crash is fixed but still gives mult for every card
also thanks somethingcom the random joker works now
why don't you have file extensions on 😭
yeah ik
You would probably have to hook G.FUNCS.play_cards_from_highlighted then.
it sucks not having em tbh
SMODS.ObjectType ({
key = 'type_areas',
cards = {
["j_ave_area_uncommon"] = true,
["j_ave_area_common"] = true,
["j_ave_area_rare"] = true,
["j_ave_area_legendary"] = true
}
})
SMODS.Joker {
key = 'area_common',
loc_text = {
name = "Common Area",
text = {
"common"
}
},
atlas = 'ave_atlas_areas',
pos = {x=0,y=0},
pools = {
["Joker"] = false,
["type_areas"] = true
}
}
c1_1 = SMODS.create_card({set = "type_areas"})
This is still just returning a default joker, I'm not sure what I'm missing
alright so right now, this joker evolution is just happening when I pay a hand and completely ignoring the wilds vs not wilds count
haven't used windows in a while but it should be under view
could we actually check for retriggers instead then?
like is there a context for playing cards that retrigger
would SMODS.create_card work when creating booster packs from tags?
50% sure Eremel is working on a retriggered flag for cards
good evening everyone!
how do I release my Balatro mod? Do I just like upload my files on GitHub?
Yes.
oki doki
How can I get the amount of hands played this round?
G.GAME.current_round.hands_played
Oh, that's easy, ty!
....huh
For some reason my Perkeo is triggering twice, once with the modded calculate function i added via take_owership(), but also with the original calculate behavior?
how would i check if a card being scored is face down? i thought it would be if context.individual and context.cardarea == G.play and context.other_card:stay_flipped == true because thats what rough gem does but that crashes
also related im curious what the dollar buffer does because im seeing that in rough gem and not understanding it completely
card.facing?
hmm that stops the crash but it isnt behaving the way i thought it would
i found that in an unrelated joker in femtolabs collection so i do think this is on the right track
waitttt this might be a i didnt pay attention to the formatting issue
You need to return something.
I've tried and it doesn't seem to stop it
if not context.repetition then
return {}
end
return
end```
You need to do return nil, true
hm its not that, i wonder if it's because it draws it face up after i play it?
Code?
Still doesn't work
oh been saying this
this is what im at rn :3
who tf thinks trying to pull that in a big server will even work lmao
There is no thought, only automation
lol
whats the context when a blind starts
context.setting_blind
How can i add +25 chips to the current hand's chips in a consumable? hand_chips doesn't work no matter how i try it
You cannot use a consumable during scoring.
no?
most of the time if an animation is playing, using cards is off limits
and that's why i can't use the consumable during scoring
Do you want to influence the chips before any sort of scoring occurs?
technically you can use lovely patches to bypass this
yes
but i would not recommend it
patching is scary to me so i avoid it when possible
patch everything always
You'd likely need to patch in a context much like Unregistered Hypercam 2 in More Fluff uses.
Then check for said context in your consumables' calculate.
just to clarify, you're looking to increase the chip amount by 25 for one hand? Or do you mean permanently upgrade that hand's chips, sort of like half a planet?
Patch in a card that runs a new instance of Balatro when playing the card, and only while it's being scored 
the former
hmm. yeah idk. you may have to patch how the score adds up internally to make that work
what if you lovely patch the love2d draw method so that the screen doesnt update anymore
either that or maybe upgrade the hand's chips and then downgrade it after the hand is played haha
i meant permanently
Ouh
just like, disable sight
Like blind chess, but it's Balatro
just patch the players brain to not see anymore smh
Add smellovision
neuralink users beware the balatro modding community
or literally any usermade code
Smell the bananas
a simple injection
while I was learning how to make UI I worked out how to just put a giant rectangle across the screen, ezpz
ssssssiiiigggghhhhhhhhhh ill try or edit the consumable to add the chips to a card, instead
I'm just saying as far as I know, balatro doesn't have the function to just add a constant to the score. Everything has to be attached to an object or a hand
you may be able to work out another way, like I said upgrade the current hand by 25 chips, and then downgrade the hand by 25 chips after the hand is played. That's probably simplest? Idk how it actually works tho
__ _________ ___ ______d_ ____```
Hm... Yeah, using the consumable to set a flag, which you then check in the patched function, and adjust accordingly. That could work.
slay the spire mod? :o
aw shit has somebody else already worked out a map system? Am I wasting my time? hahaha
terminate the tower mod! :0
How does one show the full path of the crash location instead of a cut off first part of it?
how did you even-
Obliterate the Obelisk mod. :O
pillage the pillar
topple the totem
that looks pretty cool with the shadow
brEak tHe builDing add-on; :()
ok im out of sts stuff now
-# hm... held in hand scoring first...
no destroying the den then?
if card.debuff then
return {
colour = G.C.GREEN,
message = "Fixed!",
func = function()
card.debuff = false
card.ability.extra.bugged = false
end
}
end
end```
why doesnt this work? when at the end of a boss blind it doesnt trigger the stuff i need it to
how do i make my booster pack's group name not return error?
patches are fun, just use protection and they'll generally work well
like it doesnt display the message or do the funciton
like is there something wrong with this?
scary :P
eternal for lore accuracy
n e 1 no how 2 access localization of a joker for a specific language?
bmuoupis
What is the goal?
Is Context.end_of_round bugged when it comes to creating jokers?
I have this code here
it works perfectly but it creates seventeen copies of the same joker instead of just one like i wanted
and i can't figure out why
...another potential deck gimmick?
if context.end_of_round and context.main_eval and G.GAME.blind.boss
it works!
but what does context.main_eval do exactly?
It makes it so it is the joker being checked and not cards held in hand.
bump
For existing contexts, you do not need to patch every location, you can directly borrow it. For those locations where there is no existing context, you need to manually patch.🥺
still haven't been able to work this out if anyone has any ideas
SMODS.ObjectType ({
key = 'type_areas',
cards = {
["j_ave_area_uncommon"] = true,
["j_ave_area_common"] = true,
["j_ave_area_rare"] = true,
["j_ave_area_legendary"] = true
}
})
SMODS.Joker {
key = 'area_common',
loc_text = {
name = "Common Area",
text = {
"common"
}
},
atlas = 'ave_atlas_areas',
pos = {x=0,y=0},
pools = {
["Joker"] = false,
["type_areas"] = true
}
}
c1_1 = SMODS.create_card({set = "type_areas"})
The card is spawning, but it's jusst the default +4 mult joker. Best I can figure, the pool isn't actually populating with the jokers? Idk how to work that out yet
when a boss blind is beaten, run that function with the message
is there a standard for how jokers that alter probabilities should be implemented? I'm tempted to just modify probabilites.normal but there's no chance in hell doing that manually will play nice out of the box with other modded jokers, and id need to manually check for oops all 6s.
maybe i cant return on that context
maybe i gotta do a manual message thing plus run the function
Yes, is the card debuffed?
if so how would i do that
Have you tried removing the debuff check?
just replaced the debuff check to check if the extra.bugged is true and it didnt work
extra.bugged has to be true because thats whats causing a redebuff every round
key = "malice",
blueprint_compat = true,
loc_txt = {
name = "Malice",
text = {
"{C:mult}+#1#{} Mult",
"{C:green}#2# in 6{} to become",
"{C:red,E:2}Bugged{}, which disables",
"this {C:attention}Joker{} until you",
"beat the next {C:attention}Boss Blind{}"
}
},
eternal_compat = false,
rarity = 1,
cost = 5,
atlas = "malice",
pos = { x = 0, y = 0 },
config = { extra = { odds = 6, mult = 20, bugged = false } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult, (G.GAME and G.GAME.probabilities.normal or 1), card.ability.extra.odds } }
end,
calculate = function(self, card, context)
if context.joker_main then
if pseudorandom('pwn_malice') < G.GAME.probabilities.normal / card.ability.extra.odds then
return {
colour = G.C.RED,
message = "Bugged!",
func = function()
card.debuff = true
card.ability.extra.bugged = true
end
}
else
return {
mult = card.ability.extra.mult
}
end
end
if context.end_of_round and G.GAME.blind.boss then
if card.ability.extra.bugged then
return {
colour = G.C.GREEN,
message = "Fixed!",
func = function()
card.debuff = false
card.ability.extra.bugged = false
end
}
end
end
if context.setting_blind then
if card.ability.extra.bugged then
card.debuff = true
end
end
end,
}```
full code if you need
While it's a stupid way to do it, does it still work to get a 1/4 chance of something happening by making a table with 3 false statements and 1 true statement then grabbing a pseudorandom_element of that table?
why would you need to do this rather than a different method
Probably.
anyway whats the context.other_card for when the other card is a lucky card
yes?
Stupid questions pop into my head at times, i thought i'd ask this one
this doesn’t work with oops though
if SMODS.has_enhancement(context.other_card, 'm_lucky')?
ah
how do you separate left and right card like in death?
any ideas as to why this isnt working, maybe G.GAME.blind.boss isnt the right term?
gonna remove that blindboss part and see if it works
i have looked at that but its all in the context of highlighting cards and using tarots, trying to implement it for a joker and discarding cards. unless the code just works and im stupid
like this?
You just replace G.hand.highlighted with your table of cards.
if card.ability.extra.bugged then
return {
colour = G.C.GREEN,
message = "Fixed!",
func = function()
card.debuff = false
card.ability.extra.bugged = false
end
}
end
end```
even with this, still doesnt work
let me try setting it without retrun
bump
if card.ability.extra.bugged then
card.debuff = false
card.ability.extra.bugged = false
return {
colour = G.C.GREEN,
message = "Fixed!",
func = function()
card.debuff = false
card.ability.extra.bugged = false
end
}
end
end```
even with THIS it doesnt work
wrong context im thinking...
please someone explain whats happening, this has to be dark magic
oh wait maybe it doesnt trigger because its debuffed
...
thats prolly it
disregard this
Yes.
oh nvm
func is a valid return for doing things when the joker actually triggers.
Why’s there no smods.poll_edition?
kinda need to know
bump
It's because it's just poll_edition
am i able to do SMODS.add_card({ key = 'c_soul' })? or do i do smth else for specific cards
that should work
How does one fix this?
Why SMODS.pol_enhancement but not SMODS.poll_edition
Because poll_edition is a vanilla function.
bump
What is your SMODS version?
good question, last I downloaded it was about 2 weeks ago I think. I'll check
1.0.0~BETA-0615a
oh, wait
1.0.0~BETA-0531a actually
I'll update just to make sure
same result on latest
When I use the function
print(get_current_pool("type_areas")), it returns
1: j_joker type_areas1
Maybe try setting a default on the object type?
if I set the default, it does load the default correctly. however it does not populate the pool, it looks like
was abt to come in here with a stupid question before realizing that i accidentally had my joker create a permanent delay in its calculate function
interesting thing i just learned: changing shop size negatively happens immediately, but doing the same to vouchers and boosters doesnt do anything until the next shop
its an smods thing from what i can tell since changing voucher/booster slots are both things smods adds
Is there a way to get this to destroy a joker next to it, get +2Xmult and use it in one hand?
Yes.
And what is that way?
What does "use it in one hand" mean?
Dagger destroys the joker to the left every blind
however i want this joker to destroy every hand and gain a certain amount of xMult everytime it does
if it's possible of course
This seems to be a hypermult issue.
https://github.com/TheCoroboCorner/JoJoMod/blob/main/JoJoMod/src/update.lua I updated it to hopefully help
Also it's documented now so you can look thru it better
any way to do a fake debuff, like a fake overlay on the card that uses the debuff tyexture
Just apply the debuff shader perhaps?
its a shader??
Yes.
how would i apply it
is it possible to do this?
Because it seemed to work fine before I updated talisman.
okay, I got it to work by manually setting the set values myself after the game started. Idk why SMODS wasn't doing it on its own, maybe it's a bug? idk
G.P_CENTERS['j_ave_area_common'].set = 'type_areas'
G.P_CENTERS['j_ave_area_uncommon'].set = 'type_areas'
G.P_CENTERS['j_ave_area_rare'].set = 'type_areas'
G.P_CENTERS['j_ave_area_legendary'].set = 'type_areas'
How do I keep a toggle config from reverting when I restart a run?
Put it in G.GAME
So like G.GAME["setting_1"]?
Yes.
this is a function i took from the cryptid consumable multiply and put on my own card. its designed to multiply the games probabilities by 2 after a certain number of rounds (1 rn for testing) but nothing is happening. ive tried removing the if statement to see if it was something to do with the variable, and ive tried it with cryptid on to see if it was a cryptid dependent function with no luck. does anyone have any ideas?
halved rounds is put as 0 in the cards config
init is cryptid specific.
shouldn't it work if cryptid is enabled then?
No, because init is only for cryptid items.
if i wanted to debuff a random card in deck when blind is selected, is there a specific process i should use to go about it in a way that wouldnt cause them to be undebuffed by other sources later? im hoping to debuff cards permanently via a joker
same goes for generally just affecting cards in deck really since i have another joker idea which removes a random card on rerolling
so is there a workaround to this or would I have to set up something more complicated similar to cryptid's init?
Just move it out of the init function and move it out of the joker.
anyone know what the code is to get an image on the thingy in the mod loader and what the size of the image is
So turns out, disabling pokermon made it all work flawlessly. I'm sorry SMODS, perhaps I treated you too harshly
--Atlas Mod's information
if SMODS.Atlas then
SMODS.Atlas({
key = "modicon",
path = "modicon.png",
px = 32,
py = 32
})
end
1x-> 32x32
2x-> 64x64
No, 1x is 34x34
wdym? 34 and 64
or 34 and 68
1x is 34x34, 2x is 68x68
idk why i think i like the regular box more than how the debugplus ones format is
thank you
in order to add multiple info queue boxes, do i just need to add more to one info_queue, or make a new line with another info_queue?
info_queue is a table, so you just put more things in it.
cool
how do i format that
how would i save custom variables in a save file?
Put it in G.GAME?
just G.GAME in general works? like i can just do G.GAME.var
info_queue[#info_queue+1] = G.P_CENTERS.j_joker
info_queue[#info_queue+1] = G.P_CENTERS.j_blueprint
```?
Yes.
im guessing i need to hook the game too to set the variable on new runs
ah, so i was right when i asked about needing a new line
You could also do: ```lua
info_queue[#info_queue+1] = G.P_CENTERS.j_joker; info_queue[#info_queue+1] = G.P_CENTERS.j_blueprint
Semicolon is treated as a new line I think.
playtesting my mod and uh
how
i dont have showman
is this something i have to like specifically set for it to not show up in the shop again?
Did you use DebugPlus?
Did you spawn them in with debug?
oh does that do it
Yes.
how do i loop through the held hand again
anyone have any tips on getting started with modding?
for k, v in pairs(G.hand.cards) do
end
thanks!
the mine definition can give you a example of how to replay the held cards
can i actually detect keypress input using smods or do i need lovely patch for it?
how do i check if v has a certain seal?
if v.seal == "modprefix_key"
for vanilla is it just v.seal == "Key"?
Yes.
what if i want them to detect as if the player is spamming the key?
Perhaps make a G.GAME variable and make it go down always from an update hook and increase that variable within SMODS.Keybind and check if that variable is above a certain amount?
ill look into that
hold on
Wow I hate this so much
they have an empty 1-pixel border around the edges
the actual workable space is 32x32
if it's a 1 pixel border wouldn't it then be 33x33?
No, because it is on both sides.
oh, i'mstupid lmao
sorry i literally haven't had a single sip of water in 24 hours im not very smart today
curious if theres a way to update text for jokers localization. Basically want it to take out once something happens ik u can change text
ty for explaining it regardless
Yes.
but yeah thats interesting dimensions, wonder why they opted for 34x34 instead of just making the workable space 30x30
what is it?
Returning key and set in loc_vars?
was this only added in the latest smods release
No?
thats not really what im talking about?
Seals have always existed?
then its not working
Code?
bump (iirc the joker doesnt score and the message never shows up)
Try v.seal ~= 'Red'
What do you mean then?
It was to have a way to dynamically change which ranks you havent played for high card easier than a whole for loop but imm prob just gonna do tedious way to make it work how i want
that fixed it thx
Is it context.destroy_card or context.destroying_card when I want to destroy a card
context.destroy_card
unless you mean like
on command
context.destroy_card is for all card areas and context.destroying_card is just for cards in play.
I just want to destroy the cards in scoring
I have a Joker where if your hand contains all the same enhancements, it destroys them all and spawns a new card where its rank is the total of the destroyed cards' ranks
So it's like "merging" a card
Held in hand or played hand?
Played hand
Then both would work.
How could I add a sprite to the front? (like in the sleeves mod)
The question is where I should put context.destroying_card at
This is my Joker, and said enhancements are these "Resonance" enhancements
- Checks if your hand contains all Resonance enhancements
- If yes, combines each of the cards' rank IDs into a variable,
total_rank - Find the closest rank to that
total_rank - Spawn new card with a suit and the said rank
I don't know when to handle card destruction
hey my joker's not scoring at all
context.scoring_hand doesn't exist in context.after
I see
If I don't include context.scoring_hand then I can't use for _, scoredCard in ipairs(context.scoring_hand) do
You could add another card with the sprite to that deck. That's what the sleeves do anyway
you could also draw a sprite on top of the CardArea, that's what sleeves do when you're in a run
(yes, the 2 different methods are weird)
where do messages like "saved by mr. bones" go in localization?
does it just go in dictionary
did you try ctrl+f'ing through en-us.lua?
(in general I'd put one-off localizations under misc.dictionary with your mod-prefix yeah)
what method should I be overloading to properly overwrite localizations dynamically? I've tried just handling it at the start but steammodeed overwrites my changes. I tried porcess_loc_text on the mod, I've tried G.set_localization. I'm trying to do something like: If lang was set to en-us Replace all instances of the word 'Money' with 'Gold'.
the final joker... it's done
if i wanted to make a rank considered a certain enhancement temporarily, how would i go about doing that?
i have this but it does not function i fear
(referenced from extra credit's alloy)
You would have to use Quantum Enhancements
where would i find the documentation for that?
Nowhere.
ok
Because it's not public yet.
oh so this joker just is not possible
It is?
do you mean the documentation isnt public yet or the quantum enhancements itself isnt
The documentation isn't public yet.
Firstly, you have to enable them: ```lua
SMODS.current_mod.optional_features = function()
return {
quantum_enhancements = true
}
end
is that done within the joker itself? or in like a different file
Secondly, replace you're entire if check with if context.check_enhancement and context.other_card:get_id() == magneticRank then
It has to be outside the joker.
In a loaded file.
if its just up here by the atlas does that work fine?
ooh no it does not the game crashes loglessly
is there a way to do x_dollars or something on an enhancment
wdym
like multiply dollars?
is multiplying dollars even something that exists
If you want that functionality as like a universal thing you'd need to patch SMODS
...and how would i do that
Otherwise you can do it on a case_by_case basis using some other functions
oh
I.E calculate the resulting mult, use ease_dollars with the difference between the new and old values, and then use card_eval_status_text to do the message
lets hope updating smods wont break my mod
how would i check when a gold card gives money? like for scaling a joker for example
it doesnt seem to have fucked anything up but out of impulse i need to fix my pseudorandom_elements
is n here to help with this
if context.individual and context.end_of_round and context.cardarea == G.hand and SMODS.has_enhancement(context.other_card, "m_gold")?
how would I get this silly guy to work
reverse dna
thats more like it yeah
i just want to make this efficient by it working only for Wild
It's SMODS.has_any_suit()
damn really?
never expect it to be like that
like this?
You need to pass on the card you're checking as an argument
got it
is there smth abt the way mr bones is coded that prevents blueprint from being able to copy it
are you trying to make something to check if a card as a spcific enhancement ?
isnt that just cosmetic tho
no its noit
then why does blueprint copy stuff even if you dont set blueprint_compat to true
that weird
yes yes
is it m_wild or
Yes.
I was going to ask too
gruh
Yes.
i think imma just
stick with SMODS.has_any_suit
the wild cards thing
or is there any better way to do it
SMODS.has_enhancement(card, key)?
whats the key for wild?
m_wild
?
for me its working
No.
thanks smth
Yes, it is purely visual.
but why its working for me
and I know sell_price doesn't exist I dont know why it pops here
so the description shows nil value, but i already specified the value inside of config, whats wrong? @daring fern
Mb if the english is kinda bad if its the reason of the question mark
he's just confused
he usually does this i tend to ignore it
You need loc_vars
okok
I GOT IT
thanks
bump
is context.destroy_card.ability.(modprefix_stickerkey) a viable way to check if the card in context.destroy_card has a certain sticker?
Yes.
context.destroy_card is the card.
alr
works perfectly even with mime, ty!
Im probably missing something
anyone know what the code is to make a consumable type
how do i define a custom shader that i could use with love.graphics.setShader? love.graphics.newShader() is empty rn because idk what to put in it for the shader to load
i dont know what im doing
what vanilla jokers have the capacity to destroy cards
playing cards to be precise
nothing afaik
for primary and secondary color, do i do the hex code or just "red" or "blue"
red
Code?
if youre using hex codes its HEX("FF0000"),
im noticing i put color and not colour
im using visual studio code, its different
you need to use HEX()
No?
what it works for me
it isnt different
my issue is i used color and not colour
wait what the frick
when i did HEX("FF0000") on other stuff it didnt work
yeah
let me try ig
now what
woah it works now
thanks guys
guys whenever i launch i get this does anybody know how to fix
not enough info to debug anything, but whichever mod is adding a bee bug ain't doing it right
I'm attempting to do some dynamic localization which involves reading some fields from my translation file if it's there. Problem is at a steamodded mod's process_loc_text function even though my translation lua does have this field, it looks like steamodded hasn't loaded it in yet. Is there a different hook I should be using?
how do you make a joker that plays a sound when they got bought
you could override add_to_deck(self, card, from_debuff) and then keep track of if it's the first time it was obtained, if so play a sound
trading cards?
yeah i decided im not fucking with it because the only vanilla jokers that destroy cards do so in such a way that you have to very intentionally play into the destruction aspect of them
turns out its easy to improve code if you do so while splitting your code up into pieces
huh, elaborate?
im new to this
this is the place to talk about making mods?
code stuff
Campfre
persistent across blinds
most jokers do that
i'm not trying to make a balanced joker btw
x6 mult by default, extra x6 mult when you score 4 aces, how?
Can someone help? Whats wrong with my code? Both 1x and 2x files are named "Tax Collector.png"
--- STEAMODDED HEADER
--- MOD_NAME: CustomCreations
--- MOD_ID: CustomCreations
--- MOD_AUTHOR: [Mr. (Ant)Tenna]
--- MOD_DESCRIPTION: My own Jokers.
--- PREFIX: xmpl
------------MOD CODE -------------------------
SMODS.Atlas{
key = 'Taxer',
path = 'Tax Collector.png',
px = 71,
py = 95
}
SMODS.Joker{
key = 'Tax Collector', --joker key
loc_txt = { -- local text
name = 'Tax Collector',
text = {
'At end of round,',
'earn 1$ for each joker',
'you currently have.',
},
},
atlas = 'Taxer',
rarity = 2,
cost = 7, --cost
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
pos = {x = 0, y = 0},
config = {
extra = {
dollars = 1
}
},
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.dollars, card.ability.extra.dollars * (G.jokers and #G.jokers.cards or 0) } }
end,
calculate = function(self, card, context)
if context.joker_main then
return {
dollars = card.ability.extra.dollars * #G.jokers.cards
}
end
end,
}
Oh sorry for inturupting
how do i make a joker that gains x6 mult when you score 4 aces? (by default, it stats with an x6 mult.)
do you know lua
well i'm beginning
could you condifentely code tic tac toe in lua?
no.
you probably should learn more lua
that’s a stupid criterion, i couldn’t do that confidently and i can mod this game just fine
give me a second firsttry i’m writing up a code snippet for you
i'm just making one joker as a mod
i'm surprised
tic tac toe is a pretty simple game
learn Lua 101 first would be my honest advise. But the jokers have some api methods. You can hold a local ref to their api and replace it with a delegate to you own method which can call the original and then act however you want.
local add_to_deck = joker.add_to_deck
joker.add_to_deck = my_add_to_deck
function my_add_to_deck(joker, card, from_debuff)
add_to_deck(joker,card,from_debuff)
if not joker.initial then
joker.initial = true
--do whatever you want to do, it's this first time obtaining the joker
end
end
depending on where you're at this may be too much for a beginner https://www.tutorialspoint.com/lua/lua_proxy_tables_delegation.htm, you'll get there
i think tic tac toe can be made with very few snippets but i'm not sure since i'm not mr alan turing or whatever the hell
it's tic tac toe, you do not need to be alan turing
here’s just the calculate function and related stuff
config = { extra = { xmult = 6, xmult_mod = 6 } },
calculate = function(self, card, context)
if context.joker_main then
return {
xmult = card.ability.extra.xmult
}
end
if context.before then
local ace_count = 0
for _, playing_card in ipairs(context.scoring_hand) do
if playing_card:get_id() == 14 then
ace_count = ace_count + 1
end
end
if ace_count >= 4 then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
return {
message = localise(“k_upgrade_ex”)
colour = G.C.MULT
}
end
end
end
written on mobile and without reference so this may have mistakes
but this is mostly right
you need to ensure context.scoring_hand exists before looping
wait
no you need to
ans also you are missing an end
yeah i can’t see shit on mobile
it appears context.before was not tested for at all
from what i remember it exists any time before context.after
there are multiple contects without sdoring_hand
forgot a then
i’m typing this directly into discord on mobile man
thanks
how do i prep my mod for uploading to github?
gonna see if i can modify the loc_vars for my joker
why does this happen when G.GAME.linear_scaling == false
Because the function doesn’t return anything if it’s false
Also please don’t just override the get_blind_amount function
Hook it instead
consumeable or consumable
ah i see, this code is reused from some old deprecated mod i found
Yes
i didnt realize it was already a function
wdym yes 😭
It’s inconsistent
vruh
is it 1 or "Ace"
ok, i'll show everything
Based
now for the hard part
bruh
tragedy strikes harder than the day that shall not be named
how can i get every consumeable there is ingame?
For some reason the joker tooltip is not showing
what do i return here if i want it to only let me if im playing a blind?
am i stupid or something? this is crashing the game
local dice = 0
local roll = pseudorandom("roll")
if roll <= 0.16 then
dice = 1
elseif roll <= 0.33 then
dice = 2
elseif roll <= 0.5 then
dice = 3
elseif roll <= 0.66 then
dice = 4
elseif roll <= 0.84 then
dice = 5
else
dice = 6
end
SMODS.Blind {
key = "dice",
pos = { x = 0, y = 2 },
boss = { min = 3, max = 10 },
atlas = "blind",
mult = dice,
boss_colour = HEX("26bc55"),
crp_credits = {
idea = { "Poker The Poker" },
art = { "George The Rat" },
code = { "Glitchkat10" }
}
}
are there any examples of mods (other than polterworx) that modify the chips mult operator
you cant call pseudorandom during startup lmao
its only available when you're ingame
i didn't know that
i thought this code does run while in-game?
i'm not that experienced with lua, sorry
well yeah
this gets run once, when the file gets loaded
but don't mods load after the base game or something?
aka at startup
i don't know, how do i fix this to work correctly without crashing?
that's kinda just what i want
well, no, that doesn't work how i would really want
it doesn't work well with balatro; reloading the blind doesn't change the value
it stays the same from balatro startup
i figured this would solve the issue
i want it so that if i'm in the collection and i turn a page and back, it redoes the random value; is that possible at all?
if not, math.random is fine
thats fucking devious but ok
youd have to lovely patch into create_UIBox_your_collection_blinds
if you want it to be changed only every time you see it during the collection
uhhh nope it works flawlessly actually
like so good
-# (i'm not doing lovely patches yet, curse them (for now))
i'm too lazy idc 😭
morning folks
i only have 2 lovely patches
one for a blind that does something similar to the serpent
tried making the seal give gold and planet when held in hand, doesnt work
anyone can help?
and another that adds type score to cryptid's kidnapping joker
planet part works
money part doesnt, it gives money when played intsead
bumpin
let me check
sure
it here somewhere
im looking it up, but u can search too
ill look it up too
I want to destroy scored and played (but not scored) cards after scoring the hand but using context.cardarea == G.play condition only destroys scored cards
here
bump
this is from vanilla remade, it shows exactly balatro keys and stuff
so Ace?
or A
yes
let me see
there is a lua and context.main_scoring condition
nah it doesnt work
i think its either reverse it some how or there is a condition for non scoring
did u try just 'A'
hold on
well i mean
the 9s doesnt work too
it doesnt turn into steel nor retrigger it
it doesnt work like that 😭
then HOW
someone better than me spawned 🥳
get_id returns an id
what the FUCK
WAIT 14???
thunk's code™
still need help?
me too, but will try to help lol
okay now im lost
i have been modding for more than a week now so
why are you setting it as an edition.
enhancements are like jokers in a sense
theyre just another center
card:set_ability("m_steel")
ok so how do I do this
shouldnt it be e_steel?
no because thats not an edition
enhancements are different from editions
true got them mixed up
so
i see
NOT THE JOKER
can i dm u?
sure!!
trying to implement a joker that makes certain cards be drawn face down, and then face down cards give money, but the giving money part isn't doing anything, what part would I need to change to get it working?
asking again...
anyone here?
SMODS.destroy_cards, not destroy_cards
@daring fern can u help with brrr code?
tried that and it also broke
hi
did that
what was the craah
but also, you might want to use context.destroy_card instead honestly
this was after I changed it to SMODS.destroy_cards
lnjgkjgrkgdjkkjjkgslksggs I am going insane
can you share the code that led to this crash?
that is a very loose context check
you want something like this
if context.before then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
SMODS.destroy_cards(context.scoring_hand[1])
return { message = localize({type = 'variable', key = 'a_xmult', vars = {card.ability.extra.xmult}})
end```
how do i make a deck start at a different ante
you could probably put an ease_ante call in the apply function
(itll be ante 0)
would this replace the if statement on line 20
works but id also like the score display to match as well
since it doesnt update
until you enter the blind
-- Gold Blue Seal
SMODS.Atlas {
key = "Seals15_atlas",
path = "B_Gold.png",
px = 71,
py = 95,
}
SMODS.Seal {
key = 'GoldBlue',
pos = { x = 0, y = 0 },
atlas = "Seals15_atlas",
badge_colour = G.C.BLUE,
config = { extra = {h_money = 2 } },
get_p_dollars = function(self, card)
return card.ability.seal.extra.money
end,
calculate = function(self, card, context)
if context.end_of_round and context.cardarea == G.hand and context.other_card == card and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({
trigger = 'before',
delay = 0.0,
func = function()
if G.GAME.last_hand_played then
local _planet = nil
for k, v in pairs(G.P_CENTER_POOLS.Planet) do
if v.config.hand_type == G.GAME.last_hand_played then
_planet = v.key
end
end
if _planet then
SMODS.add_card({ key = _planet })
end
G.GAME.consumeable_buffer = 0
end
return true
end,
}))
end
if context.end_of_round and context.cardarea == G.hand and context.other_card == card and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
return { vars = { self.config.extra.h_money } }
end
return { colour = G.C.SECONDARY_SET.Planet }
end
}```
i tried making a seal with gold and blue combo
yes
want it to give money when in hand
you'd need to recalculate those ui elements
I don't think it's G.HUD, but I don't remember off the top of my head what it is
now it doesn't do anything
waiting for the chosen one to look at my code lol

I downloaded steamodded but the "mods" button didn't appear
did you download lovely too
Yes
where did you put it
why is no one trying to help me 🤔 
your problem requires me to be on pc to actually help
and uh
my bike is currently fucked while im going home
so im chatting on my phone waiting for help rn :3
get_p_dollars(self, card)? Wiki says it "Gives money when a card with this seal is played."
Oh! Check VRemade!
checked
i want to make it give money when card with seal is in hand at end or round
oh, as in gold card: the seal
have tried various stuff last 2 days but nothing worked
u know how blue seal works right
its the exact same thing but with money
your planet part works right?
yes
can someone help me fix this slight "issue"? some of my jokers have a weird outline, sometimes dark and most often yellow, is that normal?
its the blue seal code
just put return { dollars = X } after that bit
if that works im gonna *** my self
yeah thanks, i will def credit you 😭
The outline comes because the jokers aren't properly aligned
its difficult to see from the picture but it does apear
tried, didnt work
put it every where possible
whats this?
no
a
oh well, it depends what you want the relic to do actually
that's adding an entire seperate calculation step for them
mm well i want to add relics their own calculate, since there r effects which affect other relics' calculate too like "Increase +Mult by (x)" and stuff
but do you not want them to be part of the normal calculation stuff?
so they have access to all the normal calc contexts?
🤔 idk lar said that i should add a new calculate for relics
What am I doing wrong? It shouldn't look like this (obviously)
your loc_vars is set up wrong
It looked like this before it gained the X Mult
what is the command prompt for changing the color of the shape behind the message?
return {
...
colour = G.C.RED,
}
well what you currently have there (assuming thats all the calculation stuff you've added) is a single call to the calculate function of relics with a context.ygg_main, they wouldn't have access to any other context if this is all that you have
aight, thx bepis!
yeah im adding :calculate_ygg to a bunch of other places too for other context
explain further, im pretty sure its aligned to the pixel
can you show me your code 🤔
are you adding custom contexts?
The line comes from a joker thats 1px too much to the right
i mean, this approach should allow me to add custom contexts in the future too, so thats nice
if you want ridiculously bloated code, sure
dang
what should i do then
this is what Partner did, so im referencing from their code 🤔
`SMODS.Joker {
key = 'tradeoffer',
loc_txt = {
name = 'Trade Offer',
text = {
"Gains {X:mult,C:white} X#1# {} Mult",
"when joker is sold",
"{C:inactive}(Currently {X:mult,C:white}X#2#{C:inactive} Mult)"
}
},
config = { extra = { xmult_gain = 2, xmult = 0 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.xmult_gain, card.ability.extra.xmult } }
end,
blueprint_compat = true,
perishable_compat = true,
eternal_compat = true,
rarity = 3,
atlas = 'TRBMod',
pos = { x = 5, y = 0 },
cost = 12,
calculate = function(self, card, context)
if context.selling_card and not context.blueprint then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
return {
message = localize('k_upgrade_ex')
}
end
if context.joker_main then
return {
xmult = card.ability.extra.xmult
}
end
end
}`
This is the entire code for the joker which I'm having trouble with, and I've tried everything I could think of to fix it
add the two areas to here and that'll give you every default context and you do a context.cardarea == G.ygg_relics blablabla check
it would be in the jokers type
didn't you say that relics are kinda just an invisible cardarea
oh then yeah
i would recommend having xmult in config at 1 by default
just add them there via lovely patch
you can even hook this function
I've done that now, but it's still the same
Not sure why but when I played a pair after I played a double pair, this joker didn't upgrade.
It was supposed to upgrade cuz the hand was a different one.
Is there a way I can fix this?
🤔 i wonder why card.ability.extra.xmult_gain seems to be set to 0
how much should i space each joker
Each card are usually 71x95
I mean, it looked like this before the joker gained the X Mult
And then it became this when it did gain it
Ooh if they're the correct size then it's pixel bleeding
you can move them apart and just adjust your atlas size
by how much
1 pixel off each direction like this
yeah there would need to be a 2 pixel gap between each, (1 pixel around the entire image) and then set your atlas dimensions as 73x97 in your atlas definition
whats the weird loop for?
idk, it seems to be in victin's code from when i referenced from their mod?
im guessing it adds the area specifically after G.jokers in the table
🤔 thats probably not necessary right
I guess it's making sure it inserts the areas directly after jokers
yeah
how can I put in a local variable the previous poker hand played?
(cuz I wanna check if the current poker hand played is different from the previous one)
it's not necessary unless you are particularly bothered about when exactly it calculates your area
mm i see
you can just do table.insert(t, G.ygg_relic_area) etc.
or t[#t+1] = G.ygg_relic_area
I'm not sure which is more efficient but it''ll hardly matter
also when did -# get disabled in discord 😭
yeah i actually dont know whats the difference between table.insert and t[#t+1] lol
-# it didnt? 🤔
Some says that #t + 1 just faster
oh, and also, i was wondering if theres a way to hook to the calculate of relics to change the return's mult, xmult and such? 🤔
of other relics?
of all relics, yeah
that'd be harder to implement but it's definitely possible
mm any approach you can think of? 🤔
my initial idea was this but clearly that wasnt the solution lol
this is the code to give money at the end of round, right?
is the consumable limit check really necessary
🤔
File "version.dll" is in folder "Balatro"
i would do this, probably
if context.end_of_round and context.cardarea == G.hand then
return{
dollars = card.ability.extra.h_money
}
end
you'd want to intercept the returns before they're evaluated and modify them, it'll take some patching of the smods code, though they're might be a hackier way depending on what exactly you need to do
Sorry for the slightly out of rules, but maybe it's because I don't have the steam version?
for planets it is
for money it is not
yeah that seems to be the money's code
i think i tried this in the past 2 days but will try again
this is basically what i want to do lol, but yeah i will try checking smods to see what line handles the calculate stuff, thanks
What do I have to add for this variable to have the previous hand played and not the current one?
did this
but crashes
tells me line 530 "extra" not defined
oh the pic doesnt have line num 
my bad
amm
now it works but doesnt give me money....
.
hm
wait, arent stuff stored in card.seal when it comes to seals 🤔
can you try card.seal.extra.h_money
ok
I have a Joker that divides the blind chips in half, it works but the blind number doesn't update to the new number
what do?
what did i do wrong here
this happened after hand is played
i assumed this is where i should patch, but turned out it doesnt print anything even though the calculate of the relic works 🤔
so thats not it
Yeah, about base seals...
might be wrong
but is it because of two returns?
line 1948, "vars" is defined wrong or wrong sentence
i only remember that someone said the extra stuff of seals is not stored in .ability.extra 🤔
Even then.
wait
fuck
wron
g
anyone please??
Store the context.full_hand somewhere that is not reset or initialized by calculate.
.
so?
Doing the reduction in an event?
G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
G.FUNCS.blind_chip_UI_scale(G.hand_text_area.blind_chips)
G.HUD_blind:recalculate()
but it says that the context is undefined and it crashes the game.
works!
thx
🤔 i tried putting print in self.ability.set == "YggItem" and it certainly printed
but o and t always seemed to be nil?
Are you checking the exact hand or are you looking to check if it is a different "poker hand" by name?
You'd probably want to store the latter as card.ability.extra.prev_hand = context.scoring_name, then compare.
I'll be right back
@manic rune, I'm sure
never freaking mind i fixed it
oh, that might be the issue yeah
what version do you have?
major pinch of salt but:
if its xbox gamepass then its currently not supported yet
am i calling wrong soul? cause this code works,but only makes card's h and w multiply not soul
hold
I'm checking if the player is playing a different poker hand by name: what I mean is that if the player plays a pair, and then he plays a double pair then this joker upgrades!
im pretty sure you will want to do
info_queue[#info_queue+1] = {key = "Dark", set = "Other", vars = {colour = {G.C.SUITS.Spades, G.C.SUITS.Hearts, G.C.SUITS.Clubs, G.C.SUITS.Diamonds}}}
for the info queue to read from 🤔
actually, not sure if thats correct
I can't say
if you sailed the sea then unfortunately i cant help you much lol
hi bepis
hi haya
is colour outside of vars or inside, actually
i forgot
colours should be in vars.
The return one is for the localization text of the actual object, not for the added info_queue one.
On what versions, besides steam, does everything work?
Can I somehow remove default first tab created in mod's settings by SMODS?
I just have no space for this empty tab at all
not that i know any of, no
I tried like this but now it doesn't upgrade when a different poker hand name is played from the previous one...
is context.cardarea in context.joker_main locked to G.jokers?
You set the previous hand in the same block as context.before, but after checking for if it is defined (if not, skip to setting the poker hand name) and doing the comparison there, at which point you call the upgrade part.
it worked
it was card.ability.seal.extra.h_money
Appears to be the case.
but triggers twice
damn.
i wanted to do smt like this to check if a relic is equipped or not, since the equipped and unequipped ones are in their separate areas
actually, realized i have a function to check if items are equipped or not, guess i will just have that as a mandatory check in the documentation later
Can I use mods without steamodded?
no
the fact that you dont see the "Mods" button means lovely never loaded to begin with lol
and lovely is basically a mandatory part for all the good mods rn
does this make sense from an api perspective 🤔 Yggdrasil.equipped_item returns stuff when the item in question is equipped, and not when its not equipped to separate equipped and unequipped effects
lovely console opens
it still doesn't work
oh wait
I had to set it == nil
cuz it won't update the previous hand
...you could always make your own context call involving context.joker_main.
no wait, it still doesn't work ;_;
ok as dumb as it looks it's working fine
if context.before and context.main_eval and not context.blueprint then
card.ability.extra.prev_hand = card.ability.extra.prev_hand or ""
local isnotsame = false
if context.scoring_name ~= card.ability.extra.prev_hand then
isnotsame = true
end
card.ability.extra.prev_hand = context.scoring_name
if isnotsame then
-- do upgrade
end
end
?
can lovely work without steamodded?
steamodded works because of lovely
Now I'm curious, what are some examples of mods that do not require Lovely?
none
Awesome!
unless you count mods that dont have lovely patches
but they still kinda do
because of steamodded
Because you need Lovely to put the mods in there in the first place
This is the same as the ye olden Minecraft modding by replacing stuff in the actual .jar and what not.
you could make a mod without both lovely and steamodded by directly changing the game's code
But why would you?
🤷♀️
-# "balatro.exe" creepypastas be like:
why does it trigger twice?
afaik it triggers per card held in hand
nah, no matter how many cards i have with the seal they all just trigger twice
