#💻・modding-dev
1 messages · Page 336 of 1
Any examples of mods that have a deck that has the player start with >52 cards? having trouble implementing that for myself and want to see how others have done it
What exactly are you planning? #1228825966940393483 has XXL deck with 2 of everything
oh yeah, i also was wondering how i could make a deck like checkered deck but with diamonds and clubs
basically, a 5th set of A-K with random suit and wild enhancement
thanks, ill check it out
Apparently that's what Argyle Deck from Too Many Decks is already
But that's not a reason not to have your own one in your mod
How can I get a joker to act at the start of a blind?
Well either of us can just look at their code
how do i look at the code again
context.setting_blind?
forgor
I'll give it a try! thanks! ^^
but, does no one know how i can apply the foil shader to a deck?
thatd be a first lol
Here it is btw
Answer being just open it in a text editor or look directly at github
how do i change this so it converts them into stamp cards instead of lucky?
What is a stamp card?
is stamp card a modded enhancement? if so change it to m_modprefix_stampkey
m_[prefix]_stamp
just a card with a stamp on it
You mean a seal?
do you mean a seal
Do you want it to be a random seal or a specific seal?
chosen:set_seal("Red")
stamps are the sticky rectangles you put in the corner
wait how do you even get seals on cards
spectrals usually let you do it yeah
certificate
certificate?
ye
you should also be able to get them from Illusion but there's a bug and you can't actually
what's with all these thunks
17 decks already lesgo
i feel targeted with all these thunks . sm h
local thunk = {}
now lemme see if my decks actually work cuz i havent tested like 8 of em
yall like my template sprite
thunks on everything
so real
:3
:3
is every thunk one idea for the Think joker
if so im such a good contributor to xmult
Yes.
only 1 visual bug tho
Gains ^^0.01 for every 🤔 somethingcom place
That would take way longer to count.
🤔
New edition?
it only happens the first time when you start up balatro
No, your only applying the negative_shine
and when you interact with literally anything it turns them back to normal
i mean they work
just not visually
Wait, no the front is negative but the back is only negative_shine
Playing cards are 2 different sprites.
how would you define a new key for the message variable
more specifically what is the "a" in something like a_xmult
This?
Ironically very weak for the first 100, and then immediately after it gets immensely powerful
does anyone know how i can add the foil/holo/poly/negative shader to some of my decks
Mayhaps check the docs on SMODS.Drawstep
Check some mod that make use of it or the function Card:draw() in the vanilla code
idunno how to get there
i just started modding 2 days ago lol
(and ive only been playing balatro for like a month)
Oh
yeah
You know how to create SMODS object in the first place?
i know how to make a deck
Close enough
do you think you'd be able to help me?
I'm not on PC sorry
That wont be until long sadly
Maybe this?```lua
SMODS.DrawStep({
key = "editiondecks",
order = 5,
func = function(self)
if self.area and self.area.config and self.area.config.type == "deck" then
-- following here is a horrendous mod compatability line
local currentBack = not self.params.galdur_selector
and ((Galdur and Galdur.config.use and type(self.params.galdur_back) == "table" and self.params.galdur_back) or type(
self.params.viewed_back
) == "table" and self.params.viewed_back or (self.params.viewed_back and G.GAME.viewed_back or G.GAME.selected_back))
or Back(G.P_CENTERS["b_red"])
self.children.back:draw_shader(
'foil',
nil,
self.ARGS.send_to_shader,
true
)
end
end
})
which parts can i delete/replace?
Try putting this in your code and it should put foil on every deck.
nice
now what if i want it on only 1 deck
okay but negative plasma deck goes hard
SMODS.DrawStep({
key = "editiondecks",
order = 5,
func = function(self)
if self.area and self.area.config and self.area.config.type == "deck" then
-- following here is a horrendous mod compatability line
local currentBack = not self.params.galdur_selector
and ((Galdur and Galdur.config.use and type(self.params.galdur_back) == "table" and self.params.galdur_back) or type(
self.params.viewed_back
) == "table" and self.params.viewed_back or (self.params.viewed_back and G.GAME.viewed_back or G.GAME.selected_back))
or Back(G.P_CENTERS["b_red"])
if currentBack.effect.center.key == 'b_modprefix_key' then
self.children.back:draw_shader(
'foil',
nil,
self.ARGS.send_to_shader,
true
)
end
end
end
})
``` Replace `b_modprefix_key` with your mod prefix and the deck key.
also somehow happened to fix the visual bug with negative cards
like this?
nvm, that doesnt do anything
Why did you remove b_?
Also you should change your prefix to something else.
You need the b_
oh mb i thought you said did you remove the b_
tried to add them to more of the decks but it only applies it to the first deck with the shader
idunno if it matters that i put this in each deck i wanted but changed the keys n stuff
Would send it here but it’s a lot of code
You could just copy the if where it checks the key and the shader in the first one.
this?
Yes, but including the end
Hi, I'm making a mod with a joker that creates some negative jokers (including Canio) upon selling, however I get this error message: [SMODS Cryptid "Cryptid.lua"]:2033: attempt to index local 'center' (a nil value)
After a bit of digging, it turns out Cryptid overrides the vanilla create_card function, however from what I can see this part of the code is identical to vanilla, so I don't think Cryptid is the problem (I also want this mod to be compatible with vanilla fyi). The first image is the code in question, and the second image is the code from my mod.
ralsei moment
It's j_caino
that's what I did, isn't it?
Its j_caINo not j_caNIo
Ohhh
🤦
Welp, I feel like a fool
it works
I even triple checked my spelling, extra embarrassing
No, you spelled it right, LocalThunk spelled it wrong.
how would i go about making the unused braided deck?
(+3 levels for each poker hand at the beginning of run)
I already did.
fair but i don't think thats a reason for me not to
That's also not what it does.
unused one does
oh
nvm i didnt read that properely
just wondering if this line does anything
because it has --- infront of it
You should probably remove it still.
also how would i make this replace with random cards instead of turning them into lucky cards
You mean randomize the rank, suit, enhancements and seals?
yes but only rank and suit
That's erratic deck.
kinda, its a combination of erratic and blank
since it would only replace 13
not the whole deck
this jus returns an error message, do i have to put it in another table or add like my mod prefix
i already have a function for only affecting 13 random cards
but i want it to change them into random suits and numbers instead of just lucky cards
uhmmm
don't worry, i'm not gonna make that one today
nvm i got it
Does balatro track overall most played hands between game sessions?
thats why lol
Does it go off planet card usage?
i have no idea
i see
It goes over most played hand profile wide.
I forgot that existed my bad
but does anyone know how i can randomize number and suit?
would actually be cooler if it was completely random
(with modifiers n stuff)
does anyone know how to do that?
local rank = pseudorandom_element(SMODS.Ranks, pseudoseed("seed"))
local suit = pseudorandom_element(SMODS.Suits, pseudoseed("seed"))
SMODS.change_base(card, suit.key, rank.key)
```?
card being a card in G.playing_cards
does that only do ranks and suits?
Yes?
okay
You mean wheel of fortune?
this doesnt seem to do anything
ty i found it
That's because card doesn't exist.
Code?
This deck.
SMODS.Back{
atlas = "decks",
name = "Spare Deck",
key = "sparedeck",
pos = {x = 0, y = 0},
loc_txt = {
name = "Spare Deck",
text ={
"Start run with",
"{C:attention}13 {}cards in deck"
},
},
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
local cards = {}
for i, card in ipairs(G.playing_cards) do
cards[#cards+1] = card
end
for i = 1, 13 do
local rank = pseudorandom_element(SMODS.Ranks, pseudoseed("seed"))
local suit = pseudorandom_element(SMODS.Suits, pseudoseed("seed"))
SMODS.change_base(G.playing_cards, suit.key, rank.key)
end
return true
end
}))
end
}
Put back the thing you used to get a random card from cards
like this?
Yes, but change G.playing_cards to chosen and add in the table.remove
how do i make it also add random editions, enhancements and seals?
Do you want it to have a chance to have a seal or it will always have one but it will just be random?
random chance
how do i make my own mod_conv consumable?
tried replacing suit with seal but that didnt work
You just set mod_conv and max_highlighted in the config and I think the rest is done automatically.
mod_conv being the enhancement key.
ty
do you know how i can make it randomize modifiers aswell?
including prefix?
m_modprefix_key
For seals it would be getting a random element from G.P_SEALS then getting the key then setting it.
so, what's the best way to cleanly delete something from a pool ? To prevent it from appearing ever again in the run, or at least "randomly" from booster pack/in the shop ; SMODS.remove_pool doesn't seem to work for me
:33< :{{
why don't you just not do it

how would i do that?
it doesnt matter if I split my mod into multiple lua files right? like one file for jokers one for planets etc
That's fine and I think most people prefer to code that way anyway
is this too many decks
you should install #1270516504470880357
and also how would i give cards a random seal with a.. say 50% chance?
ooh nice, thx
Hint how to make the Joker match in the hand when there are 4 distinct Jokers in the hand
how can I change this part of a card using take ownership?
is that too much?
anyway how would i make cards for this deck have a 50% chance to get a random seal, enhancement and edition?
For each card, poll those things, and weap that in a 50% chamce
Might be easier to just throw it away 50% if the time
How do i do that?
Hint how to make the Joker match in the hand when there are 4 distinct Jokers in the hand
:33< :DD
:33< :??
:33< why thinking react
Because @daring fern does nothing but sit and ponder every message in chat all day
:33< the thinkerrrrrrrrrrrrr
Hold W to Ponder
Do you know how i can do that?
https://github.com/Steamodded/smods/wiki/SMODS.Edition#edition-methods
And enhancements and seals have poll methods too
Just run each on every card in the deck, interacting through in a loop
And the 50% chance I think you already figured out
Honestly i have no idea what to do with this information, i just started 2 days ago lol
It's okay, I've been here for over a year and still haven't really started yet
You do seem to know a lot
Could you tell me what and where to put that code?
I already have a loop that repeats 13 times
Like, i know how to replace an exact number of random cards with another, but i don’t know how to make it replace a card into a random other card
Do you guys have any idea why this pattern search might fail?
SMODS patches it already.
You need to patch the patched.
Look at the lovely dump.
Aight, thanks
do you know how i do this?
Roughly but I can't really type it out rn
oh, okay
i'm assuming i need to use a pseudorandom_element
but i honestly dont know how to set those up
No.
poll_seal, poll_edition and poll_enhancement
hi, is it possible to make a joker impossible to create through stuff like judgement tarot cards or riff raff joker?
Put ```lua
in_pool = function(self)
return false
end
by defining you mean before loc vars?
it's giving an error
No, I mean inside SMODS.Joker
and what else do i need to add
like this for example?
Yes.
thank you !
You need , also get the lua extension.
but how do i fix the error?
oh right
okay and where do i put that stuff
inside the poll?
i have this i dunno what to do next
like.. this?
i barely know what i'm doing half the time, i need assistance
Seed is not a valid seal.
yeah mb
SMODS.poll_seal({ arg1, arg2 })
SMODS.poll_seal({ guaranteed = true, type_key = "seal" })
You don’t need the type key
You don’t need to add anything
it chooses from all seals in the game
It's poll_seal so it only chooses from seals.
how is this comparing boolean to a number?
It's in the calculate function for the deck pretty sure.
Could very well be wrong though
You also have to have it in a for loop, looping over every card in the deck
i currently have it just after the base atlas
should i put it in the function of the deck?
Put everything after the not in brackets.
i have this rn
do i need to add anything to actually apply the seal?
or is it good
now this whole function doesn't work
Thats because your checking if the table your defining doesn't exist which is impossible.
a
I'm not saying it'd bad I just think of it every time lol
aight, thanks
now what do i add
:33< it came off as very very rude!!!
for it to do smth
:33< felt very
:33< insulted
i think the poll works, now i just need to make it actually set the cards
how do i do that again
tried this but it doesnt work
and like crashes the game
so how do i make it work
You do chosen:set_seal(SMODS.poll_seal({ guaranteed = false }))
For the Pikmin Portion of The Carrot Field (my Balatro Mod)
I'm only going to start with red blue and yellow Pikmin, as I feel like I need to test the idea first in order to make sure it even plays well. Heck, I might even decide to just keep it to those three to avoid complicating things
tried to add multiple polls and now it crashes again
when I'm using take ownership how can I disable the original effect/function?
Crash log?
It's set_ability
oh yeah
Also poll_edition is not SMODS
hm?
like this?
or should the poll also be called ability
still doesnt work
how do i fix it?
poll_edition is not SMODS
Yes.
like this?
Also you don't need to poll it twice every time.
i really don't understand, what do i need to edit here and what should i put there
for i = 1, 52 do
local chosen, index = pseudorandom_element(cards, pseudoseed("seed"))
SMODS.poll_enhancement({ guaranteed = false})
chosen:set_ability (SMODS.poll_enhancement({guaranteed = false}))
SMODS.poll_edition({ guaranteed = false})
chosen:set_edition (SMODS.poll_edition({guaranteed = false}))
SMODS.poll_seal({ guaranteed = false})
chosen:set_seal (SMODS.poll_seal({guaranteed = false}))
table.remove(cards, index)
end
return true
for i = 1, #G.playing_cards do
local chosen, index = pseudorandom_element(cards, pseudoseed("seed"))
chosen:set_ability(G.P_CENTERS[SMODS.poll_enhancement()])
chosen:set_edition (poll_edition())
chosen:set_seal(SMODS.poll_seal())
table.remove(cards, index)
end
still crashes
how do i fix it?
it crashes whenever i start a run with the deck
how do i make it not crash lol
the crashing isnt intentional hah
so how do i fix it
I updated the code, try that.
How would one make a joker that cycles through all the joker sprites every frame?
The only hard part I'm thinking is the jokers with soul sprites.
still crashes
it looks like b_zodiac is the problem.
using SMODS.DrawStep to add this indicator, but not sure how I actually change the placement of a sprite. I want it to end up at the bottom, but I'm not sure what variables actually control its placement
Check your mod prefix, make sure that works
okay, but i have nothing anywhere that has zodiac in it
end goal is it ending like this
For reference, if this is an enhnacement you're using, it needs to be applied like this card:set_ability("m_Fox_grass", true)
Abilities are always prefixed by m_. Try changing it to m_b_zodiac
Are you looking at your lovely dump?
I don't have the problem, :), trying to help ceebee
I'm aware.
Zodiac is a deck.
not one of mine
I am almost certain nothing about b_zodiac is the problem?
im having a terrible time understanding editions... like they seem SO complicated to code compared to simple jokers
Anyone have a good tutorial on editions? something simple not too complex?
im trying to create an edition that gives 1.65X Chips
Im also trying to add a "smelt feature"
Basically, if your current hand score exceeds the blind requirement, and your hand contained a stone card, it gets "smelted" into a Ceramic card, which still has no rank or suit, but gives 2.5X chips
anyone know how hard this could be or any ideas on how i could do this
i would PAY a mf to teach me editions man these are SO HARD
like
doesnt have to be now either
just man
i am STRUGGLING people 💀
i'll send it in DM's cuz it'd be a big message, just running this with the balatro mod loader
Just put xchips = 1.65 in the config I think.
I've not messed around with editions yet, but besides the shader, they're very similar to enhancements, no? It shouldn't be too hard to get you to figure it out, soul. What's your code looking like for the edition atm?
And what's going wrong?
oh this is MrFreese btw lmao sorry
had a rebrand
anyway
hahahahaha
nothing is WRONG yet
like
looking at a friends "template" for ONE edition and bro had to like
remade almost everything
and he didnt know a better way to do it
one sec
Hi Soul, I have an edition I made, which effectively has 'Hiker' baked in. The card gains strength when played.
You could probably take a peek at this to figure out how some things are done
please
edition, not enhancement?
like im talking polychrome foil holo... how would your edition work on a joker lol?
Check this out 🙂 . It's an edition. Interestingly I found that Joker's need to have a separate calculation step for an edition to work on them.
Hi chat!
If it's a regulat playing card, when it is scored or triggered in any way (Even if it is held in hand!) it will proc the special edition.
If it's a joker, we listen for joker_main's context window
ooh cool
interestingggg
thank you thank you
looking now
usually in the sprite table is a T table. that should have an x and y that controls the position?
Hi folks, does anyone know how to add content to this pane?
I thought so too, but it doesn't seem to cooperate with me at all
I've seen other mods add a 'Credits' tab but I would rather do this
You want to put credits in the description tab?
🤔 ...what does your sprite look like?
blind_indicator_sprite = blind_indicator_sprite or Sprite(0, -10, card.T.w, card.T.h, G.ASSET_ATLAS["kino_ui"], {x = 5, y = 0})
Yes, if the default config of an SMODS mod puts 'Author' in huge text, I don't feel like its right that other folks contributions go into another tab. They should be right there and center IMHO
can't you just add authors in the field given?
and the 0, -10 isn't controlling the position at all when you change it?
comma seperated lists are common there
not at all
change the mods description lol
it's controlled by the draw_shader if you have it
blind_indicator_sprite:draw_shader('dissolve', nil, nil, nil, card.children.center, scale_mod, rotate_mod)``` I do, yeah!
It does make sense that the code that wiggles it also places it
self.children.lobc_prey:draw_shader('dissolve', 0, nil, nil, self.children.center, 0.1, nil, nil, 0.1 + 0.03*math.sin(1.8*G.TIMERS.REAL) + self.T.h*-0.2, nil, 0.6)
self.children.lobc_prey:draw_shader('dissolve', nil, nil, nil, self.children.center, 0.1, nil, nil, self.T.h*-0.2)
for the self.T.h*-0.2, lower value means sprite is higher
i think
top left
ah that makes sense. lm check to see which argument is which, so I don't actually erase a necessary nil, haha
ms mr mx my? are these new genders?
how can I make a card similiar to hiker but it adds mult to the card instead?
look at that one card from neato
frosted prime rib
Hiker example, but perma_mult instead, yeah.
aight thanks
@hushed fielddid you ever get that working?
if I seperate my mod into several files like jokers, backs, decks etc is there a specific thing I need to do for the game to "read" them? that you wouldnt usually have to do if you had everything in one file?
Sweet, this looks good to me 🙂
You need to load them with SMODS.load_file
tired coding is also really brainrot btw
but also, the smods contexts are ruining me
does anyone know if the wiki is up to date here?
https://github.com/Steamodded/smods/wiki/Calculate-Functions#contexts
Hi :3
hi carrot
if i do if context.after and context.cardarea == G.play then it never enters that
if i do if context.after then it fires too soon 😭
what do you want to do
i want to modify_rank a random scored card after scoring
Hi N', I am sooo inspired by the way you organized your code for your mod. I feel like we could just make a community style guide based on your mod as reference!
i also tried final_scoring_step but that felt too soon as well
i want to organize it a bit better honestly
are you doing it in an event?
it's not the context that's messing you up, it's the animation order. All visual changes happen after calculation's done, so if you're not using an event, the change visually happens immediately, even though it'll be scored as the proper card
nope, simply in Joker.calculate
what ice said
Hi guys, is there some documentation somewhere that contains all the things that start like G.something?
do I give it a path like SMODS.load_file("back.lua")? or what
no, you need to look at the code
Where in the code can I find that?
look at the source code, specifically Balatro/globals.lua
You need to give it a path from the root folder.
Ah, thanks guys
but i think G also gets updated dynamically all over the place
probably a good idea to do print(inspect(G)) or print(tprint(G)) right before you use it
Jumping back and forth from C#, C++ and yaml for work to Lua and PowerShell for afterhours / fun stuff is breaking my brain
i work with python so its not that hard but sometimes i write "then" after if statements lol
if it's already in the root folder isnt it just the filename?
Hi folks, somehow my toggles are out of sync with my mod config. When I do a print statment, I can see the value is set correctly, but the toggle does not show this
I want the toggle to default to enabled and the user can disable it if they like (or have bad taste)
In my config.lua I end with returning these vals as true.
I'm new to modding Balatro, where does it get printed to?
and what file should all the SMODS.load_file() be located?
whats the code
main file
can you make your own loc_colours?
the console
yes
oh, i always forget windows users don't have to start balatro from command line
use the DebugPlus mod to see logs in game
Thanks N!
My modinfo.json
Alright, already downloaded that so shouldn't be an issue
and if it gets too much, you can always look at the latest log in Mods/lovely/log
like especially print(inspect(G)) and print(tprint(G)) are huge
hmmm i dont see anything wrong
what if you delete the file under %appdata%/Balatro/config/modid.jkr
How would I go about adding a button to a Joker? Not making it functional right now, I just need to add a new button and go from there
Rise.
check how buttons are added to consumables through SMODS.DrawStep
Ohhhh yeah!!
Ty!
Look at Cryptid, it has doublesided jokers, or jokers which are also consumables and can be invoked at any point. That could get you started
i did it in my mod, animated soul sprite that is
animated base sprite is just as easy
Ty! I'm trying to make onions from Pikmin, as such they need to store. Well. Pikmin
Please share, but I still need to know a fix to the legendary problem.
a new button like the sell button?
Yeah!
you can hook card:highlight and modify self.children.use_button
Ty!!
i can share it in typescript and transpiled lua, here is the ts, which should still be readable
i basically yanked this from Aura though but simplified a lot of it
jokers here is basically just an array of SMODS.Jokers
and for base sprite instead of soul sprite, you can change every instance of soul_pos to just pos
const jokerEntries = Object.entries(jokers);
const jokerNames = new Set(jokerEntries.map(([key, value]) => value.name));
const defaultFps = 30;
const oldUpdate = G.update;
/**
*
* @param dt
* @example
*/
const newUpdate = function (this: typeof G, dt: number) {
oldUpdate.call(this, dt);
for (const [jokerName, joker] of jokerEntries) {
if (!joker.animation) {
joker.animation = {
frames: 60,
immediate: true,
target: 0
};
}
if (!joker.animation.t) {
joker.animation.t = 0;
}
joker.animation.t += dt;
if (joker.animation.t > 1 / (joker.animation.fps || defaultFps)) {
joker.animation.t -= 1 / (joker.animation.fps || defaultFps);
joker.animation.next_frame = true;
}
else {
joker.animation.next_frame = false;
}
if (joker.animation.next_frame) {
const loc = joker.soul_pos.y * (joker.animation.frames) + joker.soul_pos.x;
joker.animation.target = loc + 1;
if (joker.animation.immediate && joker.animation.target) {
joker.animation.target = joker.animation.target;
}
if (joker.animation.target >= joker.animation.frames) {
joker.animation.target = 0;
}
joker.soul_pos.x = joker.animation.target % (joker.animation.frames);
joker.soul_pos.y = Math.floor(joker.animation.target / (joker.animation.frames));
}
}
};
const oldSetSprites = Card.set_sprites;
/**
*
* @param c
* @param f
* @example
*/
const newSetSprites = function (this: typeof Card, c: any, f: any) {
oldSetSprites.call(this, c, f);
if (
jokerNames.has(this.config.center.name) &&
this.config.center && this.config.center.soul_pos &&
this.config.center.atlas
) {
if (this.children.floating_sprite) {
(this.children.floating_sprite as unknown as typeof SpriteType)
.set_sprite_pos(this.config.center.soul_pos);
}
else {
this.children.floating_sprite = Sprite(
this.T.x,
this.T.y,
this.T.w,
this.T.h,
G.ASSET_ATLAS[this.config.center.atlas],
this.config.center.soul_pos
) as typeof SpriteType;
this.children.floating_sprite.states.hover = this.states.hover;
this.children.floating_sprite.states.click = this.states.click;
this.children.floating_sprite.states.drag = this.states.drag;
this.children.floating_sprite.states.collide.can = false;
this.children.floating_sprite.set_role({
draw_major: this,
major: this,
role_type: "Glued"
});
}
}
};
const oldCardDraw = Card.draw;
/**
*
* @param layer
* @example
*/
function newDraw(this: typeof Card, layer: any) {
if (
this.config &&
this.config.center &&
this.config.center.pos &&
jokerNames.has(this.config.center.name)
) {
this.set_sprites();
}
oldCardDraw.call(this, layer);
}
G.update = newUpdate;
Card.set_sprites = newSetSprites;
Card.draw = newDraw;
and with the jokerNames.has(this.config.center.name) everywhere i make sure only my jokers get animated
Ah, I found my issue! My mod used to be called FoxesGarden and the config file still referenced that, so it wasn't getting updated. Thanks @red flower
if i have used a centralized method for my mod (putting everything in the main.lua), how hard it is to transition into at least a separate localization file?
but to simplify even further:
- use a normal SMODS atlas
- update (soul_)pos.x and y at some interval
- attach the sprite to the joker in
Card.set_sprites - call
set_spritesinCard.draw
oh and replace floating_sprite with front if you want to animate the base sprite
easy, smods provides a function for switching from loc_txt to loc files: SMODS.create_loc_dump()
is it in the docs?
yes but it doesnt say more than i did lol
@daring fern i can also share the transpiled lua but it has a lot of noise
mh, and i put it where? in my main.lua? or in the localization luas?
and im not sure if smods loc files have a particular structure too
(and i hate french translation, it's horribly inconsistant and unclear)
question why does lovely mod patching not work on macs?
I know it has something to do with the compiler that mac uses by default but I don't understand any of that
but where does it not work?
you can look at the discussion in the lovely discord
when patching other mods
where be that
oh shit what am i missing out on on macos?
btw i think this is the main blocker but idk: https://github.com/ethangreen-dev/lovely-injector/issues/208
lovely patching other mods
for most mods the problem is lovely patching smods, like to add new cardarea calculations
but the most important one is jokerdisplay support with morefluff : )
still doesnt work?
just cuz something should work doesnt mean it does 😭
thats like programmer 101
jokerdisplay with morefluff works on my machine
it's colour cards
are people not starting balatro with sh run_lovely_macos.sh ?
ah okay, now i get it...yeah color card jokerdisplays don't work for me
ok i think i rly misunderstood this..
no because we are not insane??????
Note: You cannot run your game through Steam on Mac due to a bug within the Steam client. You must run it with the run_lovely_macos.sh script.
i though you were on mac
no
okay
windows
does anyone know how i would make a joker use both mult_mod and chip_mod AND show the messages for both? would i need an event for it?
i have no idea how it works, sorry lol
you can do it manually
how is that confusing 😭
unless you're specifically trying to not show a message, I'd recommend not using the _mod returns
ah ok
maybe stop lovely patching?
i don't get it why it's needed for mods anyway, why not just hook? or maybe i'm dumb and don't see the reason
you would have to rewrite the entire function
dont do that.
that is a mod incompat factory
COUGH COUGH CRYPTID COUGH COUGH
rewriting an entire smods function is worse because that updates more frequently as well
and they literally provide an easy way to add more cardareas through patches
how so? set your priority to load after the mod you are depending on, check if the function exists in your code and then do the ol'
old_fn = fn_from_mod
function fn_from_mod() {
old_fn()
-- do your stuff here
}
I guess a solve could've been if smods patched in a custom function to hook where those targets are, though if order matters, you're still out of luck. Though that's gonna be an issue with any patching
not everything can be done before or after the function
i see
not if you need to add stuff in the middle of the func
thats just overly complicating it and also can cause issues
if functions didnt have side effects then maybe but sadly this is not functional programming
patching is just so much more convenient
i still do hooks when i dont need to rewrite everything tho
yea
i'll never do it if i can avoid it 
i will not write lua code in toml files lol
good fucking luck dude
thanks
get prepared for many issues down the line
maybe i'll do it if the patch format ever supports doing a patches.pattern where payload can be a file path
like {X:colour }?
or {X:colour} {}
no like {X:red,C:white}Something Something{}
and for it to give Something Something instead of SomethingSomething
{X:red,C:white}Something{} {}Something{} maybe?
it makes two boxes then no?
or is it an issue with X specifically
itdoes also in base game
(with french translation...)
ah
it should
This modifier uniquely strips all whitespace from the styled text
i figured X was a stand in and not x mult
yeah ur right i think, hmmm
@cursive sentinel
Unlike the similar Defined background modifier {X:}, {B:} does not remove or change the whitespace of styled text, so displayed contents will remain the same as their input string.
try it with B
oh yea that works too
to not code in the toml? why not make it a function in one of your files and patch that in?
B is like V but for the background
it should look the same tho right
X is also for background but only for defined ones
just with whitespace
mmmm yeah that actually makes sense lol
for some reason i read that as V lol
aight i could live with patching if i abstract out as much as possible
idk why you insist on overcomplicating it this much 😭
most of my patches are 1 line long anyway
its literally not that hard
replacing the X with B crashes when i hover the joker
what crash
'créer {B:tarot,C:white}La Mort{} quand',
pls log
ok
it's not about difficulty, i want syntax highlighting and sane commit diffs in my code
it's B:1
did you read the docs though?
https://github.com/Steamodded/smods/wiki/Text-Styling#variablecustom-background-colour-modifier-b
ahhh
B doesnt use colours as X
for what patches are used for you really dont need those
so gotta declare colours, thanks !
like N said most of the time its single lines
sometimes i code the patch in the file i want to patch for highlighting and then copy that
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "{card_limit = self.GAME.starting_params.consumable_slots, type = 'joker', highlight_limit = 1})"
position = "at"
payload = "{card_limit = self.GAME.starting_params.consumable_slots, type = 'joker', highlight_limit = 1e100})"
match_indent = true
this is literally what one of my patches for tmd looks like
what if i have 1e100+1 consumables
womp womp
you get a free bar of soup
yay
and an expensive bowl of soap
what happens if another mod patches the same thing btw? not arguing, just interested
i love eating soap
works fine most of the time
priority takes over then?
yeah
if its an at patch then one will happen the other wont (typically) otherwise its just priority
"at" patches are the most dangerous ones
i still use them a ton because UI code is a mess
most of tmd's at patches either are inconsequential or contain the original code
not if i change ur patches
that would be pretty peak
very very stupid but also funny
im turning your patterns to regex
a modding api that patches all the hard coded values in game.lua would be nice
to configurable ones
anyone know how i can disable the sounds of the cards for my deck here
so then mods don't need to patch anymore (for the most part)
i really need to move some of my qol patches and stuff to their own api
it's kinda annoying hearing 13 of those sounds
whats the context for a joker like oops
ohhhhhh
i dont have a single patch to change those, i would use hooks for that personally
seperate funcs
tyyy
is it still in calculate or should it be in loc_vars
or other way around i think is how vanilla works
seperate funcs
The values I patch I generally patch to make them adjustable without causing issues. Like changing odds for lucky cards on a per card basis that doesn't mess with other mods
-- This function is called when the card is added to deck. from_debuff is true whenever a card gets debuffed and then undebuffed.
-- Debuffs usually call both of these functions, essentially, when a joker is debuffed, it's simply removed from your jokers, except for the fact that it takes up a slot.
add_to_deck = function(self, card, from_debuff)
-- Changes a G.GAME variable, which is usually a global value that's specific to the current run.
-- These are initialized in game.lua under the Game:init_game_object() function, and you can look through them to get an idea of the things you can change.
G.GAME.round_resets.discards = G.GAME.round_resets.discards + card.ability.extra.discard_size
G.hand:change_size(card.ability.extra.hand_size)
end,
-- Inverse of above function.
remove_from_deck = function(self, card, from_debuff)
-- Adds - instead of +, so they get subtracted when this card is removed.
G.GAME.round_resets.discards = G.GAME.round_resets.discards - card.ability.extra.discard_size
G.hand:change_size(-card.ability.extra.hand_size)
end
-- Because all the functionality is in remove_from_deck and add_to deck, calculate is unnecessary.
from the merry andy modded vanilla code @long frigate
ty
like this?
its F all over again
hey @daring heron quick test
what do you think a function called play_sound would do
probably play a sound
correct
do you think youd need to ask a discord server what that function does upon seeing it for the first time
Squid has ptsd after the F debugging incident
which incident?
not really, but idunno how to make it silent
ok nevermind it isnt f all over again
I got this:
There was a dude here who didn’t know what play_sound() did
damn
Sent a screenshot and asked “What does this do” unironically
flashy :D
do you filter for your jokers only?
and how often do you update the pos?
ngl thats actually a really cool concept for a joker
Looks sick!
because that's how my game looks if i install aura
hurts my eyes though
how do i make it silent tho, idunno which line actually makes it silent, but one of these does in one of my different decks
No, It's only vanilla jokers, and I couldn't figure out how to make it slower than once per frame.
silent is one of the arguments for the function
where can i add it, just after the function?
im going to slap you
enhancements dont make a sound
oh yeah
please read about function arguments, like just search a youtube video
That’s an edition
see what it does
you might want to learn general programming structure for lua, it will make problem solving a lot quicker
Not an enhancement
they want an edition
yeah, those make sound
they want it to be silent
Ah
can i ask what i did to be slapped tho
You were told silent is a function parameter
okay so for the fps (this is straight from aura):
if not anim.t then anim.t = 0 end
anim.t = anim.t + dt
if anim.t > 1/(anim.fps or 10) then
anim.t = anim.t - 1/(anim.fps or 10)
next_frame = true
end
if anim.extra then
if not anim.extra.t then anim.extra.t = 0 end
anim.extra.t = anim.extra.t + dt
if anim.extra.t > 1/(anim.extra.fps or 10) then
anim.extra.t = anim.extra.t - 1/(anim.extra.fps or 10)
next_frame_extra = true
end
end
and for vanilla jokers: i can't really help a lot there, because as i said Aura, which is also supposed to modify vanilla jokers, has the same bug you shared in the video for me...Aura additionaly changes SMODS.injectJokers
i know what to add, but i have no idea where
No, I want it to change into every joker.
since it already has true, true
dont know what it does cuz ice made it for me
but that confuses me
Learn to program in Lua. Lua is a popular scripting language that is widely used by many apps and game engines including Roblox, Manticore, Solar 2D (formerly Corona SDK), Defold, Cocos2Dx, neovim, minetest, Amazon Lumberyard, WoW, Adobe Lightroom, and many other great tools.
In Part 17, we examine how to pass arguments to parameters in fun...
oh so the behavior in the video is intended? i don't get it sry
The true, true is for the poll_edition function, not set_edition
As I said in my first message How would one make a joker that cycles through all the joker sprites every frame?
Silly idea for a mod: make a joker for every food you have for supper
sorry i'm slow today
Jimbo’s Feast
That actually sounds like a really fun idea
im pretty sure this is how localthunk does the food jokers normally
NO TI DOESNT
yeah, that's whats inside the set_edition
but congrats i guess, you did it! :D
lower fps shouldn't be too much of an issue
no it doesnt thats in poll edition
and poll edition is inside of set_edition
So if those parameters are for poll_edition, do you think they would apply to set_edition?
yes
well how do i give it to set edition
I’m boutta crash out
lol
the reason we're not giving you the answer is because if you don't learn how to pass arguments to functions you're going to have a really hard time
Do you have access to base game source code
https://github.com/Steamodded/smods/wiki/SMODS.Enhancement This might give some insight on enhancements
:3
function a(p, q)
end
function b(x, y)
end
you are doing this:
a(b("x", "y", "p", "q"))
you should be doing this
a(b("x", "y"), "p", "q")
when i said this wasnt f all over again i was a fool
please dont mock people too much for trying to learn
At least they’re for coherant than F lol
true
and have enough critical thinking to understand what a function does
and ideally you should be doing this
b_result = b("x", "y")
a(b_result, "p", "q")
You are doing a great job at explaining this, bravo
i respect anyone that doesnt just copypaste from chatgpt
honestly i tried and the code sucked
I respect anyone that doesn't just chatgpt
Take a look at what strmnn is saying
ngl at some point we should've started charging F per question
btw i think people are frustrated because even gpt 3 could have fixed your issue if you prompted it better lol
whats f btw
yeah, mb
^
atleast you were trying to learn so thank you for that
i have a rule that i only help anyone make an entire joker (or object) once
the next time i stop helping them unless they start asking specific questions
You're all gonna be in shambles when I release my mod all balatrogpt
evil
haha thanks, i figured the deck creator mod wouldnt cut it anymore with the ideas i have
a mod that is all AI but it's actually someone pretending that is all AI and just making up hallucinations would be funny
like those fake AI scripts
i wanted to like resprite default jimbo at 100x100 and scale it down to 71x95 and put it in as "AI Joker"
and add like a 4th thing to the hat or something
The thing about them is they keep asking and end up making dev chat really annoying to talk in, so we attempt to help to clear up chat (even after telling them we don’t want to and will not hand hold them through an entire dev cycle)
i thought about that too recently, but then chatgpt gave me better ideas
It’s genuinely insane behavior
Truth nuke
just do like me and have your chat be half filled with "Blocked message" : )
I think a problem is some people also dont learn in a necessarily traditional format
I learn best by taking someone's code and ripping it apart until it makes sense to me
Honestly that’s not a half bad idea
do i really also need to start using stuff like "/jk" here like an insane person 😭
Damn n has me blocked he hates me
not true
Lmfao
the blocked part
This is totally fine! The problem with F is that they do not learn and essentially expect us to go step by step to make the code for them
cant believe n blocked me i was just asking how to play a sound 😔
Thats it. You dont get my extra kitkat
noooo
can i have a kitkat
When I have this, It changes frames a few then it stops, and it does that a few.
i do have some frequent posters blocked tho
Thats fair yea
Admittedly i get very irked when people ask 'is this possible' when 98% of the time whatever is being asked is obviously possible
But I just click away
does anyone else use llms as a faster form of typing because sometimes it can predict your next line of code based on what you already wrote? (or to check syntax because having a 2nd pair of "eyes" is nice)
I do not
i do not
i always have the urge to just reply "yes" to those and walk away lol
i guess if you are already proficient there is no point
what is llms
intellisense is a good ide feature, full on code completion is yuck
i had to disable all the copilot shit vscode enabled for me recently
like chatgpt and shit
ah
yes this, lol this is what i use (im new to lua so it helps me learn how to do it right)
I only use that stuff when I'm programming for roblox bcus i don't know enough about roblox programming
isnt roblox also lua?
yeah that's not an llm nor is it new
At most I've used things to help me figure out where the fuck i missed a comma if an error is obscure, but I dont often have that here since vscode is pretty good about telling me where smth fucked up
Gmod lua errors when I missed a comma use to fuckin obliterate me
fair enough
How else does calculate_effect work? I'm trying to use a function for general scoring but using unpack doesn't let the guy score. So i tried putting it in calculate_effect but I'm getting a parameter error? What did i do wrong? (unpack version left in for comparison)
You shouldn’t be using that function in a return. That function is essentially calculating a return table independently from your actual return
oh so literally i can just do an ifthen context and just drop it in
No
someone should remake this with F and the text being "showing our constant beggar things they've never seen"
Last one just being a lua 101 website
Documentation
i admire people that have the time and are so anti ai, they rather go line by line through error logs full of garbage spanning literal meters instead of just giving it to an llm and see if they can find it faster
TRUR
if i see someone with an ai pfp I will literally force them to let me draw them a pfp
the issue with using an llm is you train yourself to not actually think about the problem
What exactly are you trying to do with this?
as always it's not that black and white...i get the sentiment but yeah...
that's why you just get the worst llm known to man
that stuff actually rots your brain
But noooooo it's so convenient guys
scoring setup that i can reuse instead of having to put the whole thing again and again
Ah ok
i'm also talking from a position where i learned to code without llms (because they kinda didn't exist yet)
so maybe while learning to code one should not use llms or just very sparingly
This
the main issue with constantly asking an llm (or a discord chat for that matter) is that you can't move forward if you keep getting the answer given to you
So that return table you have, basically just replace the word return with SMODS.calculate_effect and wrap the table in parenthesis
the other issue with using an llm imo (at least just generally feeding your code to chatgpt or whatever) is that it's NOT SUPPOSED TO BE USED FOR PROGRAMMING. it's a model that predicts how the english language works. it's mashing stackoverflow posts together into something that at least superficially looks right, and maybe it actually functions but maybe it doesn't
True...
oh it IS the return table THATS what you meant 😭
the one i just sent or the one in calculate
The ome you just sent
thinking is for losers, but good luck getting any balatro mod coding done with an llm
but a benefit of llms is less people will ask dumb questions in this discord lol
That way you can have your helper funtion and the functionality you want
hey guys what does create_card do
video ai will always look like shit.. image ai will always look like shit.. llms will always get better.. what more does AI have to complete
got it!! off to test
you aren't going to believe this....
wins the blind
I think thats a strange response though
In life you are often given the solutions to problems rather regularly
And then you apply them to your day to day
I think it depends more on the person
Regularly people are given answers here even and then learn off of that
unironically ive been thinking of configuring a local qwen model to explore balatro's codebase and answer reverse engineering questions
eh i guess
that way you arent piping balatro's code off to a remote server
look if you keep asking the same question then that's the problem
I mean... I don't think so? I think, for better or worse, it will all improve
Oh last thing, the function also takes a card object as a second parameter, so don’t forget to add that
Agreed there yea
what so card or
Yeah just put a , card after the table in your calculate_effect parameters
i remember back in the early days of modding when someone said "i asked an llm for variants of your Blood Pact joker, now you should add these!"
new speech bubble just dropped
True...
a capable llm with balatro's codebase and smods documentation in context would be very useful for modding, sadly the latter is a copyright concern since you're literally shipping proprietary code off to a server so you're stuck with worse local models
That's insane
You should be so touched...
the actual issue is reading comprehension and adhd, llms can actually explain some concepts or issues pretty well, doesn't mean people will magically care more about taking the time to understand
I think llms surpress thinking insofar only as things like calculators and google do
were you even asking for ideas 😭
BRO

"hey I know you didn't ask but here's some ideas for your mod that an ai thought of since i can't have original thoughts"
oh god what have i done
and then he proceeded to post two shitty ai images with The Joker wearing some crown of thorns thing
“Yo bro add these” I’M DYING
I have totally used ai for names cause I can't ever think of cool names lmao
you have chosen the wrong kind of font for coding
Oh nononono, don’t run the function in calculate_effect, make the function run calculate_effect
i should add these :trol:
my main quest in this discord is converting people to monospace fonts
ai for placeholder art and names are Yuck. have a shitty ms paint drawing named tempname412 as has been done before
novel thoughts are required even for automatically executed creativity. It's a tool, and yes I do fully believe it can be a tool for genuine expression, but we've had this conversation 3 times in the last couple weeks and I don't feel like arguing against the strong consensus atm
If I were on my computer rn (which will be soon) I’d show an example for you
not to start this discussion, and I'm generally not blanket-ai or anythin,g but this is definitely not the case, judging by what my teacher friends are saying, and what my teaching researcher friends are currently looking into. AI's potentially very detrimental to thinking, it seems, but probably not due to the most common reasons given against it.
i legitimately do art first before anything just so I don't have to do a placeholder sprite
pfff placeholder sprites?
I just ripped Cryptid’s placeholder atlas for placeholder sprites lmfao
ai def can be good (just look at doug doug or vedal) but most of the ways it's used are terrible
i'm not actually blanket ai ban i just cant think of a good use for it
I tried working with placeholders but at this point I just make art before I get into something
My goats…
peak art
ai is funny
OK.
I would personally think age plays a factor
(Not that I'm educated in it)
I haven't lost my critical thinking skills cause I've asked chatgpt some things
Still not there…
the only reason I made placeholder art for TMD was because someone else is working on it now and they don't do art 😭
Hold on imma do this for ya
I mean idk I'd have to wait for the research to really pan out before I take super preliminary stuff as meaning much. Not to be contrarian for the sake of it, but I just highly doubt it.
Plus no one wants to learn in a school setting anyway. I was the fucking validictorian and cheated whenever it was convienent becuase fuck that shit
LMFAO
And this was well before LLMs
💀
awful. thank you
Also names being AI is such a triviality. If you get a good idea for a name from an ai, who the fuck cares
rate the placeholder art
discord should add votekicking
why is it placeholder
because i needed placeholder art
ive got a question,
so ask it
no
Guys what if we are all placeholders
next person
ive got an answer: 42
I don't like AI joker art because it looks like shit, but I do not object to it on a deeper level, but again, this discussion is very overplayed recently
i meant to press shift+enter not enter, oops
something something dont ask to ask
guys i have a question about a question about a question
can i ask my question about a question about a question
hey guys can I ask if it's okay to ask about asking
This is literally all it should be. Cut down on a little extra fluff for ya too (sorry notmario, your fluff is not welcome here >:( )
there's like 5 more of me down the line this isnt a "what if" it's a "which one"
Guys I dont have a question
i made a less fluff joker dw
guys i took someone's question
in terms of actual art for my mod, i'm uh. slowly learning
I accidentally eated the other yous so it's just you now temporarily
I am so blessed to have dedicated artists for Maximus 😭
are you one of those "system" people?
I'll end on the note (to prevent taking this over for more ai discussion, ofc) that generally with any technology, it's not some inherent cancerousness that makes it detrimental. The issue with llms and learning aren't inherently llm based, just harshly enabled by them. But at the core is the same issue that makes social media, google search, and youtube algorithms detrimental, which is that there's patterns that enable and then promote behaviours that are detrimental, and use is prioritized over correctness. The nuanced take, I guess, is 'phone bad' but this time a zoomer says it. The entire crux of it comes down to the use case and accessibility of it, and LLMs make this worse due to feeding into sci-fi narrativization that even people that work in the ai field can't properly separate themselves from
Ive had to bribe my artist with mcdonalds
this sounds so bigoted 😭
it's capitalism
okay yeah im not inherently anti ai im anti ai slop
Eh, yeah and no I guess, haha
british
do ask