#💻・modding-dev
1 messages · Page 363 of 1
im talking to Blackbox
I did yeah, I always reload if I make a change to the mod file
yeah not really sure what is wrong here, deck calc is outside my area of expertise
Let me try something
mustve missed that, how do i do it again?
might got it
awesome
i did got it
well it works but i cant use it
90% of development time is spent on stupid mistakes, its fine
does it work now?
oh and how do i make it so it only adds one if you have room
Yeah I see my print message we gucci
Check if there are free joker slots
"Huh I wonder why I don't see my message"
The Intersex seal I applied to my card: he doesn't know
yessss, finally!
calculate = function(self, card, context)
if context.selling_self and (card.ability.extra.invis_rounds >= card.ability.extra.total_rounds) and not context.blueprint then
local jokers = {}
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] ~= card then
jokers[#jokers + 1] = G.jokers.cards[i]
end
end
if #jokers > 0 then
if #G.jokers.cards <= G.jokers.config.card_limit then
local chosen_joker = pseudorandom_element(jokers, pseudoseed('vremade_invisible'))
local copied_joker = copy_card(chosen_joker, nil, nil, nil,
chosen_joker.edition and chosen_joker.edition.negative)
copied_joker:add_to_deck()
G.jokers:emplace(copied_joker)
return { message = localize('k_duplicated_ex') }
else
return { message = localize('k_no_room_ex') }
end
else
return { message = localize('k_no_other_jokers') }
end
end
if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
card.ability.extra.invis_rounds = card.ability.extra.invis_rounds + 1
if card.ability.extra.invis_rounds == card.ability.extra.total_rounds then
local eval = function(card) return not card.REMOVED end
juice_card_until(card, eval, true)
end
return {
message = (card.ability.extra.invis_rounds < card.ability.extra.total_rounds) and
(card.ability.extra.invis_rounds .. '/' .. card.ability.extra.total_rounds) or
localize('k_active_ex'),
colour = G.C.FILTER
}
end
end,```
Invisible joker code by @red flower remade in SMODs
I have been staring at this shatterfoil XYZ Dragon for like a month trying to get this effect to work
hi
hi N', i was just crediting your vanilla rewrites
rn it wont let me use it
oh this is a tarot?
honestly dont think this is of any use to me, this is a tarot, not a joker
yeah
First I found an example doing something similar to this on GSL.app and I began to adapt and modify it to work with Love2d's shader system.
It was a lot of work, the GSL.app one used a projected light to achieve a shiney affect. I saw how it was done over in Gold seal and adapted that approach
let me see the code for judgement
do i perhaps need a can_use?
@daring heron
The overall steps are
Determine our position, render polygons, and then shade them using the shaders.r and .x values. We use .r which is modified when the card is hovered over and 'skewed' and the .x constantly shifts a small amount frame by frame
Those two values plus the position on the texture are all we need to know which color to overlay then we blend in with the udnerlyign texture
sounds like a lot of math
wait should i put this in the calculation?
does this even work lol
did i perhaps put it in wrong
?
can_use = function(self, card)?
wait is that a function?
Yes?
Yes?
You're missing an end?
but i put an end there
Then why was it not in the picture?
Then you are missing an end.
nvm got it
Functions need ends.
🥺 baby's first edition 🥺
hehehe
I still gotta, like, get the effect for it done and everything, lol
not sure how I'm gonna do that yet, lol
Can you tell me if there is any way to make the Joker count last when counting?
You mean it always goes after the other jokers?
No, so that he'd be the last one counted.
No, so that he'd be the last one counted.
Over all scoring?
is it possible to hide the rarity badge
Probably.
I can't be bothered to learn how to code
is there anyone who would want to adopt my jokers or help me make my mod
Hi guys, what should I edit in the game files to minimize or remove this 'swaying' effect on the cards?
That just means your game is lagging more than usual.
I know, but is there any way to remove this effect, within the game code?
I want to move the cards without the 'ragdoll' effect that the game has
Probably not, you should probably try optimising your game instead.
does anyone know what id put in default_weight for custom rarities if i wanted to make the weights equivalent to the weight of vanilla rarities
I've already managed to do almost everything, all that's missing is this card effect.
Do I need to be mindful of how much I use the update() function in my jokers? Just seems like using that in a lot of things at once could bog the game down since it runs every frame
Yes, I would actually avoid update unless you really really need it
Good to know, thanks
Showdown mod?
I'll take a look! Thank you
Is there a way to add a new variable to a card?
just put shit in card.ability
The player to move or the game to move?
It's this effect of the cards in the player's hand, 'swinging' to the sides as if they were made of rubber, when dragging a card over them.
whats wrong here?
You can use even unorthodox characters in Julia, including emoji
Imagine using emoji to name a variable
Can’t you set motion to 0 in the options menu?
i would never
still dont know how to get this to work
I feel like I should know how to do that but my brain isn't braining today
just put everything you want to inside card.ability
brain.ability.sleep = true
I've already tried that
Do you want to stop the cards from moving or do you want to stop the cards from sorting
bump
Is there an easier shorthand to using a calculate return table to make a card juice but not give a message?
what is hand name
unsure, i copied this from vanilla arm
😭
I think G.GAME.hands is nil
if handname is not global, it's nil in context
handname in vanilla arm is used in modify_hand, which does pass in a handname
If you want to do something similar, you should use that function instead
You could juice it manually
alright, how would i do that?
That's what I've been doing but the timing is a lot more difficult
You can just pass a value to make it juice right?
context.scoring_hand?
I just want to remove this effect of the card being tilted when being dragged
At a specific moment or all the time?
it's for an extremely small screen, that's why the font is so big 👀
I copied the rank-adding code from Showdown mod, and it displays the same issue I was facing
Which means this must be handled elsewhere, right?
just at dragging a card
Did you also copy the localization?
i did this before but the card was actually broken lol
Idk, I’d try to find where card click and drag is defined, either in card.lua or node.lua , and go from there. If you want a hacky solution, you could try to do something every frame and remove a dragged card’s tilt before it’s rendered
Do you know if the localization file is recognized by default, or if I need to include code for it?
Yeah, what stumps me is that everything works except the tooltip lol
If it’s named correctly then yes.
This is what I've been trying do (this is an overwritten Glass enhancement)
return {
func = function()
for _, v in ipairs(dances) do
G.FUNCS.csau_flare_stand_aura(v, 0.5)
end
end,
extra = {
x_mult = self.config.x_mult,
delay = 0,
func = function()
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0, func = function()
for _, v in ipairs(dances) do
v:juice_up()
end
return true end }))
end
}
}
end```
But various combinations of extra nesting keep having the juice either occur *way* before it should (at the beginning of scoring) or in combination with the aura after the card has been scored rather than in combination with it, which is what I want
there was also the time i did this
both the error of spades and nothing would just crash the game if played lol
Hmm, copying over the en-us localization file wasn't enough
I must be missing something ^^'
But what about letting the scoring itself decide when to juice?
Is it in a localization folder?
Doesn't account for needing to juice multiple cards, and would overwrite juicing the scoring playing card
how could i increase the level of the played hand? copying code from the arm doesnt seem to work and i dont know how to make it work properly
I’m not sure what’s the issue
You can specify which card is juiced
And you have extra
So you can specify multiple juiced cards
juicing doesn't seem to work without a message. I'd need some way to arbitrarily trigger it
Inside the blind's function it takes an arg for handname
Have you checked where it calls debuff_hand?
Regardless, if you have multiple copies of Dance Macabre, I need to juice all of them simultaneously
i dont understand what you mean
What have you tried
Return {level_up = true}?
just specifying a card
I think it should work
I don’t remember all of the options, but maybe message = ‘’ helps
But it still doesn't fix the multiple simultaneous card issue since afaik the game doesn't support multiple targets for it
I could build an arbitrarily nested table to do it I suppose
Okay I think I know what the issue is now
can i set a in_pool function for a consumebaletype instead of setting it for each consumebale of that type?
SMODS.Blind({
key = "blind",
name = "BlindName",
debuff_hand = function(self, cards, hand, handname, check)
if G.GAME.hands[handname].level > 1 then
self.triggered = true
if not check then
level_up_hand(self.children.animatedSprite, handname, nil, -1)
self:wiggle()
end
end
end
})```
Would something in this lieu work?
It seems like the x_mult return is actually still the base glass card one
Which is.... annoying
chat how do i make my edition work 💔
Okay yep. I fixed something and now it's giving xmult twice, with correctly timed animations
dont think so
happens when i highlight a card
My main issue is how to disable the default config of the glass card without potentially breaking anything else that overwrites base glass cards at a higher priority
Does it still crash if you change if G.GAME.hands[handname].level > 1 to if true
Although
If its crashing on highlight, this wouldn't fix it
You can do SMODS.calculate_effect({level_up = true}) if you don’t want to return.
This is smarter
it doesn't
how do i integrate this
You just put it where and when you want to level up the played hand.
I was silly, and hadn't changed the Showdown prefix inside the localization file to my mod's
With that, it all works now
Thanks for the help
The problem here seemed to be that the atlas was nil for some reason?
how do i modify base chips and mult like the flint?
Modify hand_chips and mult?
I managed to do what I wanted
Nice!
i'm a huge fan of that ui
I think you would just do mult = mod_mult(mult operator conditions)
The game does open, but when I try to spawn the necisarry jokers that I need (specifically Ian) it crashes
Your not checking for a context so context.other_card wouldn’t exist.
What does the joker do?
every time Ian Chesterton is triggered, create 1 tarot card
context.post_trigger then.
No, it should stay as context.other_card you just need to check if context.post_trigger then index.
like this?
No, you need to check before you index.
then which line do I put it in
if context.post_trigger and …
Why do you have an event in an event in a func?
Try a single event outside of the return.
Its cause it's copied from the Cartomancer but changed
the reason it's in func in the mod i made is for retriggers
i need to find a way to make that clear
oh
it should work anyway
Every time Ian does trigger because of another doctor, she just does not
do you have the post_trigger optional feature enabled?
I believe so
you should have SMODS.current_mod.optional_features somewhere
been there for a bit
cause if Ian triggered, than she should too but shes doing jack shite
hmm does it work if you remove the IanC check?
(it will do it for all jokers of course but just to test)
can i see the atlas definition?
still nothin
hmm the feature might be wrongly enabled, try doing SMODS.current_mod.optional_features = { post_trigger = true }
oh so even if your atlas has only one card you still need a pos =
what's wrong here
not really, the default pos is 0,0
stillllll nothin, I find it funny that no one knows whats going on
What’s going wrong?
question, is there any way for me to change the way foil/holo/poly look in the textures ?
The lua extension tells you about syntax errors.
bc i dint find anything
You could change the shader?
where do i find that, lets say in the hd mod
The shader in the source is resources/shaders/
quick question, when adding a dependancy, what do I put for the name? only reason I say is cuz I tried myself and it's saying I don't have the mod when I do lol
The id?
does fusion jokers use that version formatting?
The id is FusionJokers?
this was it, lol, thank you
this is stupid, how can i implement this better?
not to be that guy, but could you tell me where do i need to look ? (2nd pic is the HD mod)
The HD mod doesn’t replace the shaders.
what's the effect you want?
+1 handsize for each free joker slot
always? or does it need to be at those timings?
how do i check if a specific boss blind has been defeated
the lua extension is NOT showing syntax errors, its only making text that should be yellow green
Hook blind defeat and put its key in a table?
What are the issues? I would do something similar to what you're doing but putting all the things in update inside those timings OR changing the hand size directly in update, basically one or the other
changing handsize in update explodes the game
because it changes it every frame
Which line is line 37?
change it only when it's modified
tried, it adds it more than once
in the main lua?
let me test something real quick
In the file with the problem.
first is the main lua, which is referenced in the crash, and the second is the lua that contains the blind, also referenced in the crash
so uh resources/shaders/ doesnt exist for me, or im looking in the wrong place
Are you looking in the extracted exe?
Your trying to do things after a return.
ok wait i have an idea
why doesnt the lua extension tell me this, all it does is change the color of some text
the shaders are in Balatro\resources\shaders
It should? Did you turn off lines?
it should be default settings
oh wait you said it doesn't exist?? you might be looking in the wrong plac
this is why i dont use the lua extension
it does nothing for me
except make my code harder to read
they are in the extracted exe or even better in the lovelydump
Are you using the right one?
yeah
sumneko
first image is with extension, second image is without
all it does is change the color of my text
If you type a bunch of random characters are there any red lines?
no
this works for me
update = function(self, card, dt)
if card.area and card.area == G.jokers then
local new_limit = G.jokers.config.card_limit - #G.jokers.cards + #SMODS.find_card("joker key")
if new_limit ~= card.ability.extra.h_size then
G.hand:change_size(new_limit - card.ability.extra.h_size)
card.ability.extra.h_size = new_limit
end
end
end,
remove_from_deck = function(self, card, from_debuff)
G.hand:change_size(-card.ability.extra.h_size)
end,
how would I make an edition that lowers reroll cost? I've never made an edition before, lol
Try looking at its settings?
You mean if you have a playing card with this edition in your deck the retool cost is lowered?
bump
hmm I wasn't thinking of how this'd interact with playing cards, hmm
What cardarea contexts do consumables receive when they're send calculation contexts?
I could go with +discards instead, maybe
still not sure how I'd make it work tho, lol
I've tried both G.jokers and G.consumeables and neither seems to work
i think i managed to get it to show syntax errors
i still would really like for it to not change the color of my text though
not working
8+5+5 is not 11
Is that not an option in the settings?
i tried looking for it
ok so, i did find the shaders, BUT i dont know where the actual imgs / whataver is on the extren lines is
The shader is not an image.
so that means i cant change it ?
You can.
like, how do edition effects work? can you make any regular joker effect into an edition effect? I'm not really sure what I'm doing here, lol
this is the whole thing
gn chat im too tired for allat, its 1am
I'm looking in edition examples rn but I can only see basic config stuffs, hmmm
i'll look into it tomorrow
the example are old and jank, just use a calculate function like you would for a joker
okey, so calculates do work with editions, good to know, thank you 👍
alright, i fixed the syntax error
but it seems to be extremely broken
it's multiplying mult by 10 instead of two
and its not even multiplying chips
No, it’s setting mult to double chips.
Return only once and return the values in correct order.
so, I tried to make an edition which lowered reroll costs and it crashes lol, uhm, what do I do to replace the "jokery" parts here with "editiony" stuff? lol
Log?
Did you define the shader?
I think so, I mean, it used to work before I made it about rerolls
it used to just give +chips
twas a copy of foil
Which line is line 30?
You need to use self.config card is the card it is on.
what on earth is on_apply
ahhhh ok
on_apply is the add_to_deck of editions, according to smods wiki at least
idk if I understood it right, tho, lol
it's called before the card gets given any of the properties of the edition
I mean the code 🤣
Code?
no these functions are basically useless for using values
nsdhf
so, uhh, does add to deck work here or? lol, idk what to do here lol
translating a joker effect into an edition effect is hard lmao hehehe
it appears as if add/remove to deck does not work on editions asdbfsdhbj
idk what to do now lmaoo hebjdajs
do something else and wait until we fix it 🤣
lmaoo
ok lol, hmm
well, back to the drawing board on what to make this effect do I guess lmao
hey y’all- looking for anyone willing to help me out w my balatro mod idea in #1371168036740137070. i’m specifically in need of coding expertise since i quite literally dont have the time this summer to learn how to code in this language 💔
How can I stop this from happening? The joker's effect is instantly winning the blind, like Gaming Chair from Polterworx, but the playing cards always get bugged like this and I don't know what to do
wait a sec, if this isn't possible, how does negative edition work? negative would also work on apply, right?
ahh, sorry, didn't see u were offline, lol
does G.deck.cards hold an array of every card even whilst some are drawn to hand?
Wait wait wait, Balatro basically doesn't support multiple text inputs on a screen properly?
Like, I'm selecting 1 of 3, all of them became looks like they're selected
What a heck
hi dudes, whats the path to the balatro save file for windows? I want to back up my file and then try the mod as a new user to hunt for buggoees
nop, just in deck
G.playing_cards does
one up from the mods folder in the 1/2/3 folders
You need to do it in the SELECTING_HAND state
what do I change here?
did you add the 3 seconds comment or was that in polterworx?
the delay wasn't working anyway, i forgot to erase that
Are there examples to create a brand new planet card?
ah it was just to check if that solved it, you can do
func = function()
if G.STATE ~= G.STATES.SELECTING_HAND then
-- win the round code
return true -- have the return true here
end
end
Thank you! I also feel like I'm probably good enough to beat the tutorial seed now!
there's one in the poker hand smods examples
wtf is happening? im softlocked now lol
does anyone know if there is a variable or context that watches for then a joker's sell cost has been altered?
oops forgot that you need to add blocking = false to the event
there's not, other than the sell_cost variable itself
youve got quite the number of events queuing up over there lol
where do I add it?
you can add it in the middle of trigger and after but also that's not what I said at all lol
can you copy the code here
Should I create a whole new script for those, or will they not show up if I do that?
you can create one if you want
oki, just making sure :)
calculate = function(self, card, context)
if G.STATE ~= G.STATES.SELECTING_HAND then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0,
func = function()
G.GAME.chips = G.GAME.blind.chips
G.STATE = G.STATES.HAND_PLAYED
G.STATE_COMPLETE = true
end_round()
return true
end
}))
return true
end
end,
``` is this what you wanted?
calculate = function(self, card, context)
if context.setting_blind and not context.blueprint then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0,
blocking = false,
func = function()
if G.STATE == G.STATES.SELECTING_HAND then --edit
G.GAME.chips = G.GAME.blind.chips
G.STATE = G.STATES.HAND_PLAYED
G.STATE_COMPLETE = true
end_round()
return true
end
end
}))
end
end
im stupid lol
should be G.STATE == G.STATES.SELECTING_HAND
i added an edition, added a shader, but the shader doesnt render
i used an example shader so i could see how it works
but its not. going on the card
thats the shader
and here's the edition
?? whats uo
up**
thank you so much, it works now 😁
may be a newbie question but is in_pool true by default if it isnt listed in the code?
uhhhh, idk myself lol, probably is?
also do you intend for your planet card to be purchased in the shop bc if so then you should probably list a cost
true true
I know there's a page of example jokers somewhere, where it's all the base game jokers rewritten through steammodded (or something like that), but, is there an equivalent of it for the base game editions? I'd love to check how Negative is made
(I mean the effects of the edition, not the shader btw)
slight tangent but balatro also doesn't support entering 0 (the number) in any input and replaces it with o???
Supports if you pass extended_corpus = true
vec4 final_color = vec4(color, clamp(test.x, alpha * (1.0 - pow(radius, 2.0)))); why's it bitching about clamp
idrk what else to say that might help, but make sure you have can_use in there so its usable
are you loading the file
WHY ARE MY EDITIONS NOT LOADIN G IM GONNA GO BONKKERRRSSS
does it need to be a .fs fike
file
yup
it does
FUCK
not the intended effect but alright
Its a brand new file
then you need to load it in your main file
Oh, damn
assert(SMODS.load_file("path to file.lua"))()
Ohhh
???
anyone know how to check if context.other_card is debuffed?
can someone experienced in shader magic explain why this isnt rendering
context.other_card.debuff
.debuff
what the fuuuccckkk
remember kids, always return in your hooks
or else you'll get weird bugs you can't track down
guys i still can't figure out how to get negative mult to show up
i thought it was in scale_number but i guess it's not being called at all??
and when i call scale_number from game.lua it just returns nil no matter what
I submitted a pr for that, but it got closed with the comment that they were going to find a better way than the way I fixed it
I can send you my fix but it's likely to be unnecessary soon
alr ill look at it
does this mean you'll look at my fix or
like do you want me to send it
yea
hook:
-- hook to fix scaling for negative numbers
local scale_number_ref = scale_number
scale_number = function(number, scale, max, e_switch_point)
if type(number) == "number" and number < 0 then
number = math.abs(number) * 10
end
return scale_number_ref(number, scale, max, e_switch_point)
end
patches:
# Makes negative chips work
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = '''if not G.TAROT_INTERRUPT_PULSE then G.FUNCS.text_super_juice(e, math.max(0,math.floor(math.log10(type(G.GAME.current_round.current_hand.chips) == 'number' and G.GAME.current_round.current_hand.chips or 1)))) end'''
position = "at"
overwrite = true
match_indent = true
payload = '''if not G.TAROT_INTERRUPT_PULSE then G.FUNCS.text_super_juice(e, math.max(0,math.floor(math.log10(type(G.GAME.current_round.current_hand.chips) == 'number' and math.abs(G.GAME.current_round.current_hand.chips) or 1)))) end'''
# Makes negative mult work
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = '''if not G.TAROT_INTERRUPT_PULSE then G.FUNCS.text_super_juice(e, math.max(0,math.floor(math.log10(type(G.GAME.current_round.current_hand.mult) == 'number' and G.GAME.current_round.current_hand.mult or 1)))) end'''
position = "at"
overwrite = true
match_indent = true
payload = '''if not G.TAROT_INTERRUPT_PULSE then G.FUNCS.text_super_juice(e, math.max(0,math.floor(math.log10(type(G.GAME.current_round.current_hand.mult) == 'number' and math.abs(G.GAME.current_round.current_hand.mult) or 1)))) end'''
I will once again disclaimer that these fixes were rejected by the SMODS team
(probably cause they're kinda hacky)
but they do, in fact, work
I've never seen that
oh wait
you mean for patches
yes
rip
idk what position = "at" does if you don't include overwrite = true, I've never checked
I've just always seen them together
is there a list of keys of all vanilla jokers/consumables/vouchers and such ?
Does iterating through G.deck start from the top of the deck
Like is G.deck[1] the next card that is going to be drawn
anyone know why this doesnt work
it doesnt add X3 chips when all cards held in hand are hearts or diamonds is what i mean by that
does it display the message?
you have a context check inside of a context check
hey y'all
i'm trying to make a joker that's "two-layered" like the basegame Legendaries, and i have no idea how to code it to grab the right things from the spritesheet. is there anywhere i can find resources for this? i checked the steamodded github wiki but didnt see anything
if anyone can help out feel free to dm me
does if not card.edition.type == "negative" or not card.edition then logic right if I want it to act if the edition is anything besides negative, including nothing?
thanks, ill give it a try
if not (card.edition and card.edition.type == "negative") then
I think is what you want
actually demorgan's law says they're equivalent
so yeah go for it
except use ~=
and also I think the card.edition check needs to come first to nil check
does anyone know if there is support to put stuff like chips and mult on a joker the way hiker puts chips on playing cards?
yes
indeed it does
bump
like for example an effect would set a joker's card.ability.mult = 5 and now whenever the joker is calculated it also gives 5 mult
yeah definitely looks less deranged this way too
whoops I'll remove the first if
lol
the benefits of sharing your code as you work
I know it's in the docs somewhere on some random page but I can never find it
I think I was thinking of editions
sorry
its fine
is it negative or e_negative
in what context
E_ if your trying to do a key
hey gang, so. for this joker i'm working on, the whole deal with it is "for every stone card destroyed, gain []X mult"
im tryin to figure out where i'd find the code that does that, and i am having very little luck
context.card_destroyed?
right
and then check the card being destroyed’s enhancement?
are you looking to do it glass card style where it's cumulative for the whole run, or lucky cat style where the joker needs to be present
this is my first foray into balatro modding so unforch im going to be limping along through this
i'm looking to do it Lucky Cat style
i have zero coding experience so i am doin my best rn
then this is the context you would use
do you know how to write a joker's calculate function? aka do you know how to check a context
i dont know how to do it too well, no 😔
and i would like to learn for myself but i cant seem to find any real definitive guide to it
this is going to make everything 20x harder btw
there isn't a great guide but this I think would be really helpful for you to see how to replicate a bunch of vanilla effects
https://github.com/nh6574/VanillaRemade/blob/main/src/jokers.lua
this page will sorta help you understand contexts but not really
https://github.com/Steamodded/smods/wiki/Calculate-Functions
👁️ thank you
basically if you want your joker's effect to trigger at a specific time, you need to use the right context
the calculate page will kinda help you figure out what those different options are, but funny/not funny enough, the context you want to use isn't even listed
im seeing Canio's code listing "remove_playing_cards" as part of its context?
(when I say "use" a context I just mean have an if statement checking context.something)
i see, okay
yeah seems legit
I haven't written that specific type of effect before so idk
try it and see what's up
also install the DebugPlus mod if you haven't
ill try n mess around with this stuff a bit before bed. also thank you i will grab that
im guessing there isnt a "stone cards" variable like there is a "face_cards", so do you know how i'd check for the enhancement?
SMODS.has_enhancement(removed_card, "m_stone")
oh wait
there
if you're using canio as a guide
would it be okay if i DMed you to continue this so i can try n keep track of this and come back to it later?
sure, or we can make a thread here
either #1371168036740137070 or in DMs works for me, up to you
DMs is fine
its not lettin me DM you so i think youll have to start it up
uhh me either
wait
this function is used all the time in sprite.lua, which is y'know in the engine
but it's defined outside of the engine folder
in misc_functions.lua
is it just me or is that a
moment?
Am I crazy or is the draw_steps routine from the main game literally only ever used on blinda?
and thunk does it manually everywhere else?
Can you tell me in which program it is better to make pixelation of your jokers?
Is there a way to make an enhancement or edition change the back of the card?
how do i check for cards played previously this ante
ah figured it out
nevermind
what did i do wrong here
context.other_card?
that's what i was thinking as well, what's the correct parameter for cards played previously this ante?
(cardpointer).ability.played_this_ante
context.other_card is the currently evaluated card.
context.other_card.ability.played_this_ante
guys how do i texture pack a modded thing (in malverk)
does CardArea count as an object?
trying to learn lua with balatro modding but im now stuck on trying to retrigger discards (pictured: my non-working solution)
keeps crashing here
which is THIS line which has nothing to do with discards
am i doing something wrong
Try looking at some of the examples.
it should be. make sure you're using it so it doesn't get compiled away
to clarify I'm not tryign to make a shader, rather to draw foil to an external convas
it's for the card exporter thing
the code workds fine, it just breaks when i add this send statement
if send and card.edition then shader:send((edition_key or card.edition.type), send) end
it's adapted from the draw_shader function in the game
oh I see what's wrong I think
it must be trying to do this for editions other than foil, but I can't imagaine why
I'll share my whole code (I'm a degnerate and using notepad so it's messy), lol
local output_root = SMODS.load_file("library/_common/output_root.lua")()
local function draw_sprite(card, sprite, shader, canvas)
send = sprite.ARGS.send_to_shader or {}
local _draw_major = sprite.role.draw_major or sprite
prep = sprite.ARGS.prep_shader or {}
prep.cursor_pos = prep.cursor_pos or {}
prep.cursor_pos[1] = _draw_major.tilt_var and _draw_major.tilt_var.mx*G.CANV_SCALE or G.CONTROLLER.cursor_position.x*G.CANV_SCALE
prep.cursor_pos[2] = _draw_major.tilt_var and _draw_major.tilt_var.my*G.CANV_SCALE or G.CONTROLLER.cursor_position.y*G.CANV_SCALE
shader:send('screen_scale', G.TILESCALE*G.TILESIZE*(_draw_major.mouse_damping or 1)*G.CANV_SCALE)
shader:send('hovering',((_shadow_height and not tilt_shadow) or _no_tilt) and 0 or (_draw_major.hover_tilt or 0)*(tilt_shadow or 1))
shader:send("dissolve",math.abs(_draw_major.dissolve or 0))
shader:send("time",123.33412*(_draw_major.ID/1.14212 or 12.5123152)%3000)
shader:send("texture_details",sprite:get_pos_pixel())
shader:send("image_details",sprite:get_image_dims())
shader:send("burn_colour_1",_draw_major.dissolve_colours and _draw_major.dissolve_colours[1] or G.C.CLEAR)
shader:send("burn_colour_2",_draw_major.dissolve_colours and _draw_major.dissolve_colours[2] or G.C.CLEAR)
shader:send("shadow",(not not _shadow_height))
if send and card.edition then shader:send((edition_key or card.edition.type), send) end
love.graphics.setShader(shader)
love.graphics.draw(
sprite.atlas.image,
sprite.sprite,
0,0,0,2,2)
love.graphics.setShader()
return canvas
end
local function output_rendered_image(card)
local file_path = output_root .. "images/" .. card.config.center.key:gsub("?", "_") .. ".png"
local w = 71 * G.SETTINGS.GRAPHICS.texture_scaling
local h = 95 * G.SETTINGS.GRAPHICS.texture_scaling
local canvas = love.graphics.newCanvas(w, h, { type = '2d', readable = true })
love.graphics.push()
local oldCanvas = love.graphics.getCanvas()
love.graphics.setCanvas(canvas)
oldshader = love.graphics.getShader()
local exportsprite = card.children.center
local shader = love.graphics.setShader()
if card.edition and card.edition.type and G.SHADERS[card.edition.type] then
shader = G.SHADERS[card.edition.type]
else
if card.edition then
local edition_key = card.edition.key
if edition_key and SMODS.Centers[edition_key] and G.SHADERS[SMODS.Centers[edition_key].shader] then
shader = G.SHADERS[SMODS.Centers[edition_key].shader]
end
end
end
draw_sprite(card, exportsprite, G.SHADERS.dissolve, canvas)
if shader then
draw_sprite(card, exportsprite, shader, canvas)
end
love.graphics.setCanvas(oldCanvas)
love.graphics.setShader(oldshader)
shader = love.graphics.setShader()
love.graphics.pop()
if love.filesystem.getInfo(file_path) then
love.filesystem.remove(file_path)
end
canvas:newImageData():encode('png', file_path)
end
return output_rendered_image
i so desparately want to rewrite balatro's rendering pipeline to be un-shit but it's not worth it
hi is there any way to mult chips?
or i need to do a new function?
is edition_key supposed to be referencing a global in draw_sprite?
the output_root and file_path business is strmnn's thing. He's the one who's actuallu doing this refactor of the code exporter. I just took fixing the editions on
xchips?
no I didn't change that when I made it 2 seperate functions. it's the edition_key from the thing in the second function. I don't know why it'd exist and be foil if the edition isn't foil though
Which one looks better?
specific suit probably has more versatility despite the lower scaling
flush locking you into 5 card hands makes it worse in most runs
So you're voting the second one?
yeah
wild cards sound like they'd go crazy with that
is it a voucher or a joker?
i see...
tyy
Voucher.
It's inspired by Observatory Voucher.
I want to make a mod but have no experience with lua or coding in general
but I am decent at making joker art and concepts, so if anyone would want to work together on a project let me know
I didn't know anything about coding when starting development of my mod too (I would say I still don't really know what I'm doing, but stuff works)
Can be kinda time-consuming running around in the dark trying to do shit tho lol, try looking at example mods first maybe
I spent like two hours trying to figure out why the one joker I tried to impliment wasn't doing anything 😭
I'm sure it could be worse but it would be nice just to have someone who knows what they're doing
I I figured out the issue. I have the shader object, but it's lost the contnection to its name, which is what gets passed there
From what I understand, with the shader object, the only way to get its key would be to iterate over the G.SHADERS?
more intengentially, I'm just gonna try to pass the draw_sprite funcion a variable for the shader's orginaal name as well
how do i make this code delay when my tarot gives a joker by like 0.3 seconds like how soul does it?
right now it instantly gives it whenever you click use
poll_
2
3
3
seal()
1185774063138914364
gold_seal
tried this but that doesnt work
yea you gotta use the event manager for delays
if (#G.jokers.cards + G.GAME.joker_buffer) < G.jokers.config.card_limit then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
SMODS.add_card(set = 'bananas')
return true
end
}))
end
could anyone tel me why this joker does nothing whatsoever when scored
here's the steamodded documentation on it too https://github.com/Steamodded/smods/wiki/Guide-‐-Event-Manager
for the code snippet i wrote out, note that the delay being 0.4 is pulled from referencing the soul itself, and the function in the event has to return true to indicate that it completed properly
what part should i replace it with? i tried replacing it with if (#G.jokers.cards + G.GAME.joker_buffer) < G.jokers.config.card_limit then SMODS.add_card{set = 'bananas'} end but that didnt work
my code snippet's if statement is the same as the if statement in your original screenshot, the whole event replaces just the single add_card call
like this?
no, you don't need the second copy of the if statement
context.repetition is only true when cards are retriggered
ohh
so like this?
indentation is a little funky but yea that's good
hm?
it won't affect the code running, but for readability purposes there's some indentation that's off (the first and second ends, as well as the })), should technically each be one tab to the right. i'm kinda just nitpicking but readable code is important)
is there a way to just give yourself a joker with dbugplus
^ hover over it in the collection and press 3
depending on your settings you might need to press ctrl-3
thank you!
oh and Q or ctrl-Q to change the edition
alright, lemme see if it works
nope haha
you guys are helping so much
also sorry in advance for the really simple questions I've never really worked with code before
don't worry i know what it's like, i just started modding like a month ago
yeah you're gonna see that a lot
at least it's doing something now
is there a simple fix to this or does that mean something's broken
thank you for including the line numbers in your screenshot
this is an issue with your add_card call and actually i'll take the blame on this one, i glossed over the fact that it was curly braces instead of parentheses in your initial screenshot
i've narrowed it down tho this specific pointer
card is defined as self two lines under
ok back up here
you don't need the innermost curly braces in your config definition, just say config = { extra = 1 },
alright
I don't think that will change anything but it's good to know it's unnecessary lol
honestly kinda wanna make my own edition but i really dont feel like learning a whole new coding language ngl
changing play and repetition to an or statement fixed the joker not scoring
oh wait i see the actual problem now
calculate is supposed to be a function that takes a "card" argument too. i.e. it should be calculate = function(self, card, context)
Is it possible to get SMODS.calculate_effect to run when it should instead of before everything?
last problem, it seems to not be random which joker you get
it always gives blue java, red dacca and then just gros michels
now it's mad about context
on every seed
It's card not self
updated that, crash persists
you also can still delete the whole context.cardarea == G.play or context.repetition like i told you to already, it's completely unnecessary
i dunno how to fix the actual problem at this point but it's like 2:30 in the morning and i need to get some sleep
What object is this?
rest well, thanks for helping :)
dunno this either, i've not played with add_card yet
I'm building this off an example joker from a modding tutorial 😭
Where is the bananas set defined?
idk what's necessary and not
Cavendish doesn't show up because it's not in the pool yet, are you 100% confident that it is not random?
not 100%, but it seems like it, and why isnt cavendish in the pool? i put it in there
You need to have gros michel go extinct.
it's a joker if that's what you mean
oh, is there any way i can make it always spawn from here regardless if gros michel went extinct?
here's how they were all looking yesterday
You could make the object type a table and put the keys in there then get a random element then create a joker from that key?
how do i do that?
local bananakeys = {
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
"j_cavendish",
}
local chosenbanana = pseudorandom_element(bananakeys, pseudoseed('banana'))
SMODS.add_card({key = chosenbanana})
inside the tarot card or the pool?
The tarot.
alright
It should be card not self
is there any way i can make the pool only on 1 place so i dont have to edit each one?
i'm planning on adding multiple that use these
?
Put the table outside the tarot but still keep it local, so it'll be file-wide.
Put self back on the calculate function.
crash persists
like i just put this outside of the tarot?
Try printing context?
Yes, then you can use it file-wide
awesome
sorry this is my first time messing with code 😭
what does that mean
print(context) before anything else.
my message got added to the file, lol, but it's best it sent as a file being so long
can anyone help me figure out why the negative simply isn't negativing? it looks like it's applied wice, but idk how or why that'd be
is what i said
putting it here has the same crash, putting it before calculate has a different crash
Yes, go into the lovely window and scroll to above the crash.
(1) Lua local 'handler' at file 'main.lua:612'
Local variables:
msg = string: "[SMODS _ "src/loader.lua"]:563: [SMODS TackyJokers "TackyJokers.lua"]:120: '}' expected (to close '{' at line 55) near 'calculate'"
(*temporary) = Lua function '?' (defined at line 31 of chunk [SMODS _ "src/logging.lua"])
(*temporary) = string: "Oops! The game crashed\
Try print("Context: ", context) so you can find it.
Then press CTRL F and find it.
...something is not closed - maybe pos or config?
Try installing the lua extension.
If I were to hook SMODS.find_card and find_joker would that be sufficent for my joker to count as every joker?
the thing i'm confused about is that the error implies that this bracket isn't closed (which it is) and I need to add a }
but after adding said } on the line where it's "expected", it instead crashes because there's an unexpected }
-# To be fair, we ain't seeing the full thing either.
😭 I've spent 6 hours trying to add one simple joker
I don't think modding is for me
it is four in the morning though, so I need to sleep
What does the joker do?
I'll probably just look to commission someone to make them
it's literally supposed to just be a hiker variant
Scored 2s, 3s, 4s, and 5s gain a permanent +1 mult
premise being a mix between hiker and hack
steammodded has permanent mult built in now
so itd be something like
I used their page for that, yeah
is there a way to get a random integer between x and y using pseudorandom
pseudorandom('seed', x, y)
Vanilla functions don't get documented in the documentation.
if table.contains(context.scoring_hand, v) and context.other_card:get_id() >= 2 and context.other_card:get_id() <= 5 then
v.ability.perma_mult = v.ability.perma_mult or 0
v.ability.perma_mult = v.ability.perma_mult + card.ability.extra.mult_mod
card_eval_status_text(v, 'extra', nil, nil, nil, {message = localize('k_upgrade_ex'), colour = G.C.MULT, func = function() card:juice_up() end})
end
end```
and no,skipping the first render with the normal shader doesn't help (it does help some others though)
I think "ignore_base_shader" is exposed on editions, i need to add support for that
@weary sentinel i think this shooould work?
Why iterate over the full hand?
would be really helpful to include them for modding purposes though...
true actually i grabbed some code from a joker in cardsauce but you wouldnt need to go over the entire hand just do individual
what's the error for when a card doesnt have loc txt
It doesn't have a description or name.
hm
Sometimes it crashes.
Which side of F's look better?
Edit: 2️⃣ it is! Thanks for voting!
If I had a joker that was every joker's update function at the same time, would that cause issues?
Right looks better but I think left fits the font better
I also don't know why this lags the game so much because I tried this with every common joker from every mod I had installed including vanilla and it didn't lag to such an extent.
Also how does one prevent a joker from being destroyed in all ways?
Which one looks better? (Both of these fonts are from vanilla consumeables texture)
Edit: 1️⃣ it is! Thanks for voting!
Does anyone know what could be causing this crash?
I think it's because both a and b can end up resulting in -1. The sorting must be consistent so a < b should be the opposite of b > a, if you swap them in your function when both return -1 then you end up that a < b and b > a are the same
or something
That seemed to have fixed it.
why am i always getting broken texture?
y should be relative to the py of your atlas.
Same with x
wdym
Show how you define the atlas.
.
The pos should not be how many pixels to get to the image, it should be what row and column it needs to look for.
ohh
Does the second letter look like a Q enough?
yes
bump
and here's my current code, though it doens't seem to behave much different
I've pretty much copied Card:draw, Sprite:draw_shader and Sprite:draw_self exactly, and negativee still isn't negativing
I'm beggining to suspect the default values for things like hover and shadow make it invert from the viewing angle
also don't know if there's a consistent place where the flag to ignore the base shader is stored
for some iof the modded editions that need it
isnt negative 2 shaders at once
I can try applying shine, but I don't think that'll make it suddenly invert
worth a shot if your stumpedd
shiny but no negative. I added
shader = G.SHADERS.negative_shine
shadername = "negative_shine"
draw_sprite(card, exportsprite, shader, canvas, shadername)
end
```
right after the original edition shader draw
hm alrigh
what am i missing here?
this destroys a card but leaves behind some kind of phantom card
don't destroy played cards during scoring manually, use context.destroy_card
so i return the local of the random card right?
i think i tried that
imma give it another shot
wdym
it says it in the docs
heya! first time making a mod, just wanna add some custom jokers. We wanted to keep the jokers in seperate lua files to avoid a mess, but it seems you need to put a main file in the .json for the mod to work in game. We're not sure how to activate all our joker lua files from a single main file, any advice here? or is it just better to compromise and put everything in one lua file
Here an example on how to work out exactly what you just asked.
SMODS.load_file(file) well, loads a given file.
is there any way y'all know to check the disable_base_shader flag for an edition?
In the screenshot:
- main.lua - The file your metadata (.json) file tells SMODS to load by default.
- mod_contents - A table (list) of every file to load in your mod.
- content/... - The files containing the code for various things, where your jokers would be.
- SMODS.load_file - Tells SMODS to load a certain file for your mod. The first (and only in the screenshot) argument tells SMODS where the file is located inside your mod's structure. Not certain if it is relative to the file it is being executed or the root of your mod. In this case, does not matter.
-# no fucking clue sorry
it's the root of the mod
thank you very much, this is exactly what we needed 😭
np
also, very important the assert(e) thing. Otherwise, things might not load in your mod. assert will make so balatro crashes if for any reason can't load your files, which is exactly what you want to happen.
how can know if a pokerhand is alternating betwen two suits?
what function is run when you enter a blind?
...thats not a function, but i guess i can work with that, thanks
wuh
mm?
Hi chat, there's no pinned here which is kinda what I was hoping for. Is there a good starting point?
how do i make a joker that gives a negative gros michel each blind selected?
Apologies, thankyou
if context.setting_blind then
SMODS.add_card({key = "j_gros_michel", edition = "e_negative"})
end
someone beat me to it lmao
i literally just came here to ask that what timing
in the calculate function?
Yes.
alright, how do i make this joker not avaliable in the shop?
in_pool = function(self)
return false
end
In the joker.
❓
Where's smods thread?
do i still need this part or is it unnecesary
What does your joker do?
this is what i want it to do
Then no, you don't.
...oh, that makes sense
oops
joker code?
Anyone know if there is a way to change the effects of the vanilla decks?
Lovely patch, almost certainly.
Either that or hook functions.
elapsed_round doesn't exist.
is there a way to change the size/position of a stake sticker on a joker?
Take ownership?
do i need to put that in the config?
Yes.
well it doesnt make any jokers rn
do i need to set the elapsed_round to something else?
It can't be context.end_of_round and context.setting_blind at the same time.
Yes.
just doing this over and over again lol
Move the context.setting_blind check outside everything except calculate.
hmm... experiementing with manyally specifying shader values.... I don't think that's qyuite right
what am i doing wrong here? why does context.other_card just refuse to exist within an event? how do i make this work 
i don't know how i can pass context.other_card into the event in a way that will make it exist
this?
Where did the event go?
im very new, but how would i trigger a joker when a card is enhanced in any way?
so like this?
No put the add_card inside the event and the if outside the event.
if context.setting_blind then
G.E_MANAGER:add_event(Event({
func = function()
-- add card
return true
end
}))
end
instead of?
trying to add a joker that gives extra mult to wild cards when scored, while it works without the wild card check, we haven't been able to make it work like this. We also tried using SMODS.has_any_suit(card)
so basically if we remove the has_enhancement if statement it activates for every card (as it should)
please?
Your checking if the joker has the wild enhancement.
you need to check context.other_card
ohh that's what that means 😭
speaking of, bump
lots of people here now, anyone know how?
i cant find anything on it
It works fine out of an event?
what do i replace this with?
Everything in calculate.
yes, it does. but i am trying to do it in sequence. that requires an event.
just for enhancements? you would probably have to hook set_ability and check if it's a playing card and if the playing card has a different enhancement before and after
so like this?
No, I said replace everything in calculate with that code, then put in the add card.
it's fixed now thank uu
I feel stupid 😭
all good, we've all been there
huh? i did that didnt i?
Try removing trigger, delay, blocking, blockable?
No?
Remove everything in calculate then put in the new code then put, SMODS.add_card({key = "j_gros_michel", edition = "e_negative"})?
no change. i think it's to do with the way event manager works fundamentally
i wish we could specify a parameter in the event table that gets passed into the function when it gets called
as in, i save the context.other_card to a local and reference that in the event function instead?
okay so this
yes
No?
if context.setting_blind then
G.E_MANAGER:add_event(Event({
func = function()
SMODS.add_card({key = "j_gros_michel", edition = "e_negative"})
return true
end
}))
end
yo I'm trying to make a joker that adds chips for destroying cards, kinda like a shitty canio. only problem is, I can't find canio anywhere in the card.lua to reference, does anyone know canio's calculation function or where I could find it?
It's Caino
so this.
Yes.
looks a-ok
-# meanwhile me and a few others working on a mod with "abberation" cards.
idk what that means but it sounds cool :)
- The nuf part is it is mispelled "aberratioin"
- https://discord.com/channels/1116389027176787968/1333809003829923900
okay now the hard part, how do i detect how many gros michels have been destroyed specifically this ante and create that amount of negative cavendishes
-# also, get the github repo version, not the latest release. It is outdated by like 3 months
You would have to count manually.
Make a variable for that uh... I think there is a context for destroying cards... you can get the destroyed card's key and if it is gross michel then add 1 to the counter...
No, that's for playing cards.
wait so is it even possible or not?
Yes.
patching would be the cleanest solution here
no idea how to do that
Is there a how to patch lovely 101 anywhere?
y'all know how I could define any destroyed card? I'm only seeing reference for specific types of cards like face or glass
It would be very convenient to know when and how to patch stuff.
its in the lovely github i think
Yes, but apparently it is quite old.
also this just doesnt display the message
use SMODS.calculate_effect
the message should be outside the event
you can't do joker return table from inside an event
You can't just do message = "string" out of nowhere in no function.
like this?
No.
calculate = function(self,card,context)
if context.setting_blind then
G.E_MANAGER.(...)
return {message = ""} -- There are more clever and better ways to do it.
end
end
ngl this has "you can't just shoot a hole into the surface of mars" energy 
Don’t use calc effect inside an event
I've never had a problem using it for messages inside events
thank yall for your help, made first joker (mult was changed to capital m after this)
add info queue
well this doesnt work either
Also, {C:attention} for Wild instead of {C:dark_edition}
It’ll dump it at the end of the queue, so would be mistimed
move the return {message = "Created!"} just above the end that closes the if context.setting_blind.
i believe C:enhanced was used but attention may be better
what is info queue
Hover over half of the tarot cards.
The extra info boxes that appear besides the main one, like for editions.
Stickers, etc.
funnily enough, i just have.
was working on what you said, which not only worked out, but i ended up accidentally workshopping a visual sequencing that imo looks really good
ah true, will implement that later, thank you
loc_vars = function(self,card,info_queue)
info_queue[#info_queue+1] = -- whatever
end
-- not 100% certain it is like this
i think i broke it 😭
yeah it depends on the timing you want, vanilla does it a lot
event function shall return true
