#đ»ă»modding-dev
1 messages · Page 437 of 1
wheres all the uhhh stuff to return that gives xmult stored?
like, xmult, x_mult, Xmult, allat
SMODS.calculation_keys?

How would I check when other Jokers give Chips or Mult?
any mod made before 1.0.0 smods
context.post_trigger and (context.other_ret.chips or context.other_ret.mult)?
-# You may need to account for all these types of Chips and Mult giving.
...and you'll need to enable the optional feature of post_trigger, too.
Oh awesome, I never knew this was a thing
looks much better now
trying to create my first deck but i ended up in a overflowing sea of ben, It keeps repeatedly drawing the joker over and over everytime i run it
thx
what do you call the area with the jokers in it
G.jokers
no like, outside of programming, what is that area called
becaise hand is your playing cards
played hand is your played cards
and "joker area" sounds boring
...why not reference them as Jokers held?
ture
but for example
if i wanted to reference them as
say a certain type of joker
needs to have is quanity specificied in the joker area
in decription
what would i say
like
right now i have
+mult for each other <joker> equipped
which i think works fine but it seems odd to use the word equipped
<type> Joker held
true
why is Joker not highlighted here lol
can someone please tell me why does this trigger twice at end of round
ÂŻ_(ă)_/ÂŻ
is this with calculate
context.end_of_round and context.main_eval and context.cardarea == G.hand?
here whole code
why not use calc_dollar_bonus
its happening at the end of a round right?
just use calc_dollar_bonus
OK, I just can wait 5 years
didnt work
stoped giving money
Why canât you use lovely and smods?
đŽââ ïž
if context.end_of_round and not (context.individual or context.repetition) and context.cardarea == G.hand?
try if context.end_of_round and context.cardarea == G.jokers then
is there some easy way to prevent a modded tag from being duplicated by double tag?
nope
Remove the cardarea then?
?? joker area?? why??
idk
Like I said before, itâs because the check you are doing is the same as the first one, itâll never reach the second block
no
so i need to change it
oh yeah i just realized its 2 of the same check
just run the first check at the top
the one at the bottom
then put your bottom code as an elswe
and put the rest in an if statmenet
for the other stuff
just without the first check
anyways yall know how to change a jokers sprite
Move the number of consumables check inside the first statement, then have the dollars there too, I can type it up if youâre still struggling in about thirty minutes
will try
basically my solution but the other way around
No because putting an else will mess it all up
thats true
anyways
like inside a calc
i dont sadly 
card.children.center:set_sprite_pos({x = 0, y = 0})
yall both have the same solution but for different problems
this works fine, i think idk i havent tried yet im compiling sprites into a sheet
that doesnt seem like what you would want to use in calculate đ€
this is not different problem
this is in update because it's more effective than taking ownership in calculate
otherwise set_sprite_pos is fine
like this??
context.cardarea == G.hand and context.other_card = card will never trigger?
i figured that out after it stoped working lol
drop the context.cardarea
here is the original code before modifing it lua SMODS.Seal { key = 'GoldBlue', pos = { x = 0, y = 0 }, atlas = "Seals15_atlas", badge_colour = G.C.BLUE, config = { extra = { h_money = 2 } }, calculate = function(self, card, context) if context.end_of_round and context.cardarea == G.hand and context.other_card == card and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1 G.E_MANAGER:add_event(Event({ trigger = 'before', delay = 0.0, func = function() if G.GAME.last_hand_played then local _planet = nil for k, v in pairs(G.P_CENTER_POOLS.Planet) do if v.config.hand_type == G.GAME.last_hand_played then _planet = v.key end end if _planet then SMODS.add_card({ key = _planet }) end G.GAME.consumeable_buffer = 0 end return true end, })) return { message = localize('k_plus_planet'), colour = G.C.SECONDARY_SET.Planet } end if context.end_of_round and not (context.individual or context.repetition) then return{ dollars = card.ability.seal.extra.h_money } end end }
it works correctly for most part except money triggers twice at the end
this was suggested so im trying to figure out how to do it
why?
the joker keeps crashing the game when loading, it specifies line 92, so i assume it goes for lines 97, 102, and 107
basically I'd like to start asking what you think it does
oh this is a seal
why the joker look weird
like the right half is cut off and theres a weird line on the left
i don't think seals count in card area
checks in which area the card is?
Check the sprite sheet, it seems to be 3 pixel off to the side
my code is basically copy paste blue seal code
So this will give the planet, Iâd change that return to SMODS.calculate_effect({table}, card) and then add the dollars return after it
the thing is, i tried running it with that code "the one in the pic" , it didnt work
it even stoped giving planets
Move the buffer update to after the card limit check
ok one sec
like this?
how can i enter the shop? somthing like G.GAME.shop:enterShop() ?
That looks better, the bit youâve cropped off though is important too đ
still multiple returns
i will delete it after u tell me where to put the money
the return true is fine
WHYS THIS JOKER BEING WEIRD
your asset texture is wrong
IT MEASURES AT THE CORRECT SIZE???
yes but it's clearly not aligned
check atlas
move it so it aligns with the atlas specified
So the return for the planet here needs changing to calc effect, then put the dollars return directly underneath it
SAME SIZE
this thing SMODS.calculate_effect({table}, card)
wdym
your atlas like:SMODS.Atlas{
key = 'minty',
path = 'tarot.png',
px = 71,
py = 95,
}
it's misaligned to the grid
this is not the issue
what does that mean!!
like this...?
how about pos?
it means ya gotta move it... just move your whole card art a few pixels left
actually you probably have to move it up too
This one
oh
bump
actually wait it scores and doesnt crash now but the stuff isnt scaling
pseudorandom('seed', 1, 4)
is this it?
The word table should be whatever was in the return before
yeah
ok wait it works now but it crashes like this
this is at the end of round btw (i feel context may have been important)
u mean the return True?
and here is the code for the joker
drop the context.card_area in the first if
also please use elseif
like this?
you should pseudorandom these bits too
no need for ends in elseif
if then elseif then elseif then end
so the planet part is working, money part is not working again
No the message stuff
by the way the multiple colour = in your first return does nothing
just remove all of that
the normal texture looks fine
AND NOW THE NEW TEXTURE IS FINE??
WHAT???
IT JSUT FIXED ISTELF??
did you just forget to close and reopen the game after making changes
i reloaded atlases using debugplus
cool
i guess that was the issue
my brain 
i've made the changes; it now crashes on startup
your endofround elseif block needs one end
your joker main one must be removed
...

have been coding for hours now and my brain cant handle thinking at this point
Because I don't use steam version of Balatro
calculate_effect({message = 'coolbeans'} , card)
SMODS.calculate_effect*
didnt eat lunch wanna finish this one cause if i go eat im not getting back 
it is now saying that there is an issue i believe specifically here
this,,,
Which platform are you playing on
I play without platform
Balatro IRL
Yeah, I think it could actually do with being under add card, but this looks fine
Can you show the full code again?
oh and all cards with the seal show +1 planet message even if they dont have space to add planets
how can i make a calculate return send 2 messages
They should 100% give money if the message pops up
like 1 message saying "Fixed!" then another saying "+10 Mult"
Try creating a new card with the seal
is there a function that emulates a message i can call in a func
Add extra = {stuff here}
that, doesnt really help, im taking about the squares next to the cards with text
i want 2 to happen, one after the other
Are you running debug plus?
yep
Thatâs exactly how you would do this?
Can you run this for me when hovering over a card eval dp.hovered.ability.seal
i have fixed one of the bugs, i have no clue here (i think it'd happen with any it tried to increase)
where do i add that line...
or u mean in debug plas
Yeah in the console
ok
Then screenshot what it prints out
And that doesnât work?
for some reason its not giving money
I have no idea then
oh right need to add this
oh ok
oh
actually aren't ya supposed to use ease_dollars() or something
explain
No
Youâre not
Let me get on my pc and see if I can figure it why it wonât work for you, can you paste the entire code?
ok
oh
-- Gold Blue Seal
SMODS.Atlas {
key = "Seals15_atlas",
path = "B_Gold.png",
px = 71,
py = 95,
}
SMODS.Seal {
key = 'GoldBlue',
pos = { x = 0, y = 0 },
atlas = "Seals15_atlas",
badge_colour = G.C.BLUE,
config = { extra = { h_money = 2 } },
calculate = function(self, card, context)
if context.end_of_round and context.cardarea == G.hand and context.other_card == card then
G.E_MANAGER:add_event(Event({
trigger = 'before',
delay = 0.0,
func = function()
if G.GAME.last_hand_played and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
local _planet = nil
for k, v in pairs(G.P_CENTER_POOLS.Planet) do
if v.config.hand_type == G.GAME.last_hand_played then
_planet = v.key
end
end
if _planet then
SMODS.add_card({ key = _planet })
end
G.GAME.consumeable_buffer = 0
end
return true
end,
}))
SMODS.calculate_effect({message = localize('k_plus_planet'), colour = G.C.SECONDARY_SET.Planet}, card)
return{ dollars = card.ability.seal.extra.h_money }
end
end
}```
@fierce frost you're straight up changing c.a.e.chips all the time
?
don't do pseudorandom in the config
change the _mod in the calculate
explain
do card.ability.extra.chip_mod = pseudorandom(...) in the calculate
probably before c.a.e.chips = c.a.e.chips + c.a.e.chip_mod
so set chips_mod to zero in the config then actually change it in the calculate part
yeah
now quick question, is it possible to make it choose from these six? (0.05, 0.1, 0.15, 0.2, 0.25, 0.3)
this is for the xmult and xchips parts
what is the maximum number of jokers you can get with mods? What am I losing?..
i'd like you to think for a moment
pseudorandom('anyseedhere', 1, 6) * 0.05
i uhh may be not very smart
also does pseudorandom need a seed?
yes
ah
you should use the joker name
i may be not very smart
i'm not exactly sure how you think pseudorandom would function without a seed
but you go mate
i just forgot to put one in and was wondering
@fierce frost you can also do pseudorandom_element({0.05, 0.1, 0.15, 0.2, 0.25, 0.3},pseudoseed("seed"))
this is like saying you can also construct a house with tweezers and a jackhammer
is there any way to emulate message inside a function
SMODS.calculate_effect({message = 'hi'}, card)
where there's a will there's a way
pseudorandom_element basically just uses pseudorandom anyway
i mean whoa who knew right
especially since your list of numbers is the easiest thing to make you should not be doing pseudorandom_element shenaniganary
anyways i'm trying to fix the description of this to reflect the current amount
You need loc_vars
oh like down at the bottom
#1# refers to the index of the returned var in loc_vars function
one sec
aw yeah it's time to invoke the rite of passage
whats the wait function in this?
sleep()?
wait()?
await()?
like in here
a tragic play
yeah, just add more
For example, here #1# would be card.ability.extra.chips
vars = {1, 2, 3, 4}
#2# would be nil cuz you return only one variable
there is none, to timing you need to do shenanigans
bascially events
alr well if its not easy ill just not add it then, i was gonna add a delay between my messages but its ight
i almost did that very wrong
my dumbass deadass almost tried this
wow! don't worry you're still wrong
Do SMODS.calculate_effect({message = "message", delay = number}, card)
wait wait the c.a.e.chips is a placeholder
return { card.ability.extra.chips, card.ability.extra.xchips, card.ability.extra.mult, card.ability.extra.xmult }
cuz im just copy/pasting it dw (i say as i have done that before and forgotten to replace it)
what is delay, is it seconds?
No.
how can i make the xmult and xchips have the funny boxes (like in the images shown)
read docs
v cool. ty
did someone say shenanigans
is balanced calculated by adding the chips and mult together then dividing by 2, then ^2 the result?
and to add
does if balance == true then actually check if balance is enabled?
No.
balance doesn't exist.
oh right
you return "balance = true"
and that's not necessarily a variable
that can be used in functions at least
it just tells the score to be balanced
ah right
but how would I check if the score is balanced?
if hand_chips == mult?
personally i'd just do if hand_chips == mult
ok so
context.final_scoring_step does the balance part
what effect are you trying to create?
joker that destroys itself when a single hand scores over a certain threshold
and why does that need to see if the score is balanced?
so it is increasing the stats multiple times (also not displaying a message when it upgrades but thats a later issue)
add and context.main_eval to the end of round check
last time i brought it up i heard that it would happen before balance occurs
is that the case?
is it because it's technically the end of the round for a while
you need to use context.after if you want to check after all the scoring is done
it ends of the round for every card in hand
yeah end_of_round has a few different contexts within it
ah right
thanks
and also all the jokers
ah
would it still keep the values of hand_chips and mult in this context?
bump
i don't see why not
yes it shbould do
as long as you do it in add_to_deck and remove_from_deck i don't see an issue
anyways how can i make the scaling message
the main problem im thinking about is the order of operations, for instance, I want to do a flat increase, rather than a multiplication, if its just in add to deck and remove from deck, the alterations will depend on which jokers you get first, and then removing the bonus isnt commutative
return {message = "message"}
like if i add +1 to all probabilities, then double, if I lose the +1 I cant just -1 from probabilities.normal to counteract it.
Message_card=card,
(Optional )
Thereâs currently a feature being worked on to make this a lot more accessible but I need some feedback from other people on it, you can see it in the smods pull requests if youâre interested
â
will check it out!
sometimes i wonder if you are just asking yourself or you are genuinely asking if others know the answer đ
ok so i've got it written, and it's crashing even though it's local
Firstly, you need to return the message.
...not how locals work
so i should not make the two local
locals, are local. they only act within whatever "tier of code" you have them in
you need to declare the actual local above the if statement you define them in
local upgrade, plusincrease, xincrease = pseudorandom('snap!', 1, 4), pseudorandom('snap!', 15, 30), pseudorandom('snap!', 1, 6) * 0.05
if upgrade == 1 then
card.ability.extra.chips = card.ability.extra.chips + plusincrease
elseif ...
so uh where can i see the documentation for how to format this text?
,,, you need to return a message with a colour
return {message = 'a', colour = G.C.MULT}
so i.e. here
You can't format messages.
damn
return a colour
so how can i make it say the variable
return { message = '+'..xincrease..' Xmult' }
what causes this
that's
well
the scouter does destroy itself when you score over 9000
the issue is that context.after does it too quickly for my liking
perhaps i need to put something in the event queue
Yes.
this is like showing me a collapsed bridge and asking "what caused this"
how did this happen
what did you do
i dont know đ
disabling my modded tag worked and the game started so ill take that
it was a test tag anyway
why does this look funny
đ„
i think my humor is broken
show code
it does function as intended
it's just event queue stuff
use SMODS.destroy_cards(card) instead
bump
Are you asking, how do I use github, or are you meaning, whats good practise for laying out a repo/release of a mod on github?
both?
Github have a helpful guide for you to get used to how repos work, im assuming from the way you answered you havent used git before.
https://docs.github.com/en/get-started/start-your-journey/hello-world
the above is actually probably a little overkill for now but its good to learn proper version control.
as for setting up the page itself I dont know if theres a standard, but I saw the Prism mod's page the other day and it looks like a great example to follow on from
are there any files that would be important to create inside the mod itself (or should i just look at other mods for that)
I'm not quite sure what you're asking - though looking at how other people have structured their projects is a great way to learn :D
like .gitignore - do i have to make that separately?
ah okay! a .gitignore is a special file that git uses to see what it should and shouldnt track
so if you needed a file while you're working but it won't be used in the proper release, or it's something temporary you don't want to track changes to, you include that file in the .gitignore and your git won't track changes
not super particularly beyond what youve done for your mod in general, you can sepaate things for readability
its recommended if you dont to ahve a localization file
otherwise alot of people tend to do a format akin to this
where modules will have jokers.lua, consumables.lua, etc
or in the folder you can have a joker or etc folder with indiv files like kino does
i use github desktop and push everything that way, otherwise some stuff works as drakath is saying
+1 on github desktop, it's pretty user friendly
can make it a bit easier starting out rather than learning the CLI or general command structure
is SMODS.Mods[mod].so_and_so immutable
yeah i split up my files into what object type they are in a src folder
how do I add/change something in a vanilla joker?
toml patches
I would guess
due to loading order i had to split up my consumables into 3 separate .lua files
take what im saying with a pinch of salt since I dont have direct experience, but its basically cut and paste into the code the game is running
its how steamodded was built, bc you know, we have all these lovely apis to make programming easier, but somewhere along the lines it has to actually, get into the game
go look at the lovely github page for the documentation, it seems pretty straightforward if you know regex
and if not that's a great programming skill to learn!
you don't need to know regex at all
really? is it it's own thing?
I'm still slowly working my way through the codebase to try and understand how you wizards did it, apologies if i'm spreading misinformation by accident!
how do you open the debugplus menu?
hold tab is the default iirc
Can someone help me with my faullty code?
how can i destroy a joker?
simply put in 5.2 smile
hi! just to make sure
how exactly does one calculate the soul_pos coordinates?
if considering single non-atlas sprite
ok gimme a sec
Can you tell me what do you want it to do aswell
The joker is suppost to give 1$ for each current joker
like abstract + golden
(at the end of the round)
Okay iâm sadly not on my pc can you send me a screenshot of the code
ok i didnt know you werent on pc
Is that the real Mr.Tenna
Coming straight from your house, Coming straight from YOUR house. He's the one, THE KING OF ONLY! He's GROOVY and NEVER glooby! You cant get this from an EGG! The sensation of your screen, the show that makes you scream. Say it with him, folks! Mr. (Ant)Tenna's TV TIME!!!
use the metadata files not steamodded headers
I fear (That doesnât help them )đ
yeah but itâs good practice
(Translation: Iâm taking psychic damage as we speak)
I think everyone should take a look at the wiki and understand stuff but the wiki doesnât tell you everything lol
Like how to add cards / jokers
I think this is the crash
Does Tax Collector.png actually exist?
old header check the smod api page
( I canât see the code ) is he using an old header ?
yeah
That summarizes it
you make a new .json file for it
and thats the code
why is xmpl bad?
are you coding in notepad
used by a lot of example mods
No in visual studio
Get a lua extension
Whyâs it light lol
I have a lua extention
I think the path of your image is incorrect tho
Its easier to show in notepad because i can zoom out
use this for reference https://github.com/Steamodded/smods/wiki/Your-First-Mod
Also youâs missing a variable in loc_vars
And you didnât include the variables in loc_text by #1# and #2#
@thick needle
This is a good resource for reference
Look for abstract joker and edit the variables , add atlas , loc_txt and youâll be fine
And change context
From context.joker_main to end of round i think
Golden joker has the context you need
anyone knows why the jokers dont have the eternal sticker?
How would I create tags based on their position in the collection?
hell yeah finally posted
it's giving a nil value error and i'm not quite sure why
this is easily fixed by uninstalling talisman
but i need talisman for a different joker
đ€·ââïž
so like this>
how do you debuff cards before scoring? (not perma)
debuff them in your joker's calculate, and hook to end_round() to debuff them probably
where do i post my mod?
to everyone i mean, not just here
oh most people use github
@thorn furnace still having the same problem even with the new update script
though i think this time it's exclusive to my mod
you might wanna add a check for if the mod directory isn't empty
the script doesn't work if a native library is loaded
for now I'll just unrequire the lib in a hook to the restart game method
even that doesn't work đ
Your shit be royally fucked 
anyways, time to make a Future Funk joker
PEAK
time to play a 4m 12s hard demon just to get a cool screenshot đ„
đ
luckily I'm good at gd so it'll only take me like 3 attempts lol
That confuses me quite a bit 
I even put in the code to rename the folder to the correct folder if it didn't work right
nah it's not your fault this time, it's because native libraries don't get unloaded until everything using it is unloaded to avoid corruption and stuff
ye but yk how Windows sometimes doesn't let you delete certain things because they're still in use by a process or whatever?
Yea
that's why it's not working for my mod, since my mod uses a native library instead of Lua for some stuff
Yea that'll do it
Lua/json/toml just ends up in the cache so it can be deleted while you're in-game
exactly, so I'll just have to stick with a non-automatic update script lol
For extra tabs beyond the config one, it's this, ye?
return {
{ label = '1', tab_definition_function = dummy1() },
{ label = '2', tab_definition_function = dummy2() },
}
Should be
In the future I'll add a compatibility check
i mean you could probably just recursively check for any dll/so/dylib files in the destination path before trying to download the update zip
Yea
tenna plays balatro???
...uh, oops.
finished my future funk recording, now to just convert the mp4 to a spritesheet
done
what do i return here so i can only use the consumeable if im playing the blind?
G.GAME.blind.in_blind iirc?
okk
...I need to put a function into the function? Weird.
do mods with lower priority load earlier or later than mods with higher priority
just to be sure
Lower earlier, high later.
i see
So, I'm trying to work around my joker's set_ability function using the base atlas when it comes to using the abilities of, well, basegame jokers. Patching into card.lua doesn't seem to work, so now the method is hooking into DrawStep. Does anyone know enough about DrawStep to tell me why this doesn't replace the atlas my Joker uses with the actual atlas it should be using? (Note this is a sort of fodder joker designed to act as a costume for a
different joker. If you've been around my questions long enough, you know what this is about.)
-# (also yes i have the edition and debuff versions)
having an issue where my tags don't work with a localization file
did you format ur file right
Youâre trying to make it disguised as a different joker right?
yes, but i have another atlas that makes the fact that it's fake a little more obvious. otherwise itd be impossible to tell, which is... not fun for anybody
yeah
it's working with literally everything else
except for tags
Mod prefix missing
modpref- yeah
ohhhhh
My chameleon joker adds the sprite itâs copying as the front of the card, maybe that would help?
isnt front for playing cards though?
or do you mean the general usage of the word "front" and im overthinking
I mean technically every card object has a front
Just not every card uses it
why when I use Card() and I put {playing_card = any number} it crashes?
is it possible to add this to all the Yggdrasil.Material centers?
dont you need a :get_id() here or no
actually no what are you trying to do
infoqueue doesn't work
if i remove playing_card it doesn't crash
Front is just a layer in front of the base of the card
You can use it for anything
so it doesnt matter that front isnt in here, id still use it?
what's this for
collection ui
You donât need a drawstep I donât think
Just create the front sprite in your set ability
ok uh
will that still work in this case or
Set should be âTagâ
does this crash cause application cant handle
I have no idea what youâre showing me here đ
it did not work
The key should also be the full key
IGNORE THE EXCEPTIONS BIT (those are separate jokers that have their own effects other than "activate it like normal")
the two ijiraq variables are like sendouts to check whether or not the card is a costume/ a faker
and then it just uses set ability to pick a joker based off a key "jkey"
but yeah how would i "front" in this case if possible
why?
Cuz the tag set was a red herring lol
In reality you can switch the table for G.P_CENTERS[âp_prefix_megamintconditionpackâ]
so this function is just choosing a random joker for any of these cards to pretend to be?
it's just this one joker pretending to be any of the others, but yes
and it's supposed to change every round?
no, same costume just for the whole run rn, eventually need to set it to every ante
once i remember/figure out how to do that
isn't reset_game_globals called at the end of each round?
oh god is it
anyway, you want it to always be the same when it appears in the shop, right?
or different per ante eventually
this one
including if you already have it so you can watch it change to no avail
just checking you typed that correctly
references to base game items just use a . followed by the reference
okay well lets start with it being the same for the entire run for now
does the run_start not
do that
i asked this, forgetting the variable's name literally includes the words current_round solely so i dont forget this
nvm
what you said worked perfectly
in your reset_game_globals function you'd probably want something like
if run_start or G.GAME.round_resets.blind_states.Boss == 'Defeated' then
-- set your key for the sprite here
end```
that should only udpate at the end of each ante
Hell yeah
For future reference, the . and the [ââ] work essentially the same
alright that's in there now thanks
was this by using set_sprites because that uh
that doesn't work (hence trying to find the workarounds)
okay so now in set_ability you want something like this card.children.front = Sprite(self.T.x, self.T.y, self.T.w, self.T.h, G.ASSET_ATLAS[G.P_CENTERS[KEYREFERENCEHEREPLS].atlas], G.P_CENTERS[KEYREFERENCEHEREPLS].pos)
and then this too
card.children.front.states.hover = card.states.hover
card.children.front.states.click = card.states.click
card.children.front.states.drag = card.states.drag
card.children.front.states.collide.can = false
card.children.front:set_role({major = card, role_type = 'Glued', draw_major = card})```
I think that'll work

it won't switch at the end of each ante yet but we can do that later
real
just see if this works first
should these be before or after anything
in the [function](#đ»ă»modding-dev message) i mean
â
how can i apply a gold seal to the first card scored? im trying everything, but nothing works...
What does context.check do for the debuff_hand context?
something like context.scoring_hand[1]:set_seal("Gold", nil, true)
pretty sure Lua indexes starting at 1
yeah, it works perfect
thanks :D
np
Good afternoon Good People of modding dev! I was curious if it'd be possible to make this idea I had
I came up with this joker called "Drawn Joker", it's effect is that it would scale +2 chips when a card is drawn from the deck. That would include not only during a Blind, but also when you open Arcana or Spectral packs
I donj't think it matters
oh ok let me do it rq then
Yes.
how come?
Hello this might be an advanced question and I'm having some issues with the unlocked sprites for my custom cards
It used to work a few months ago with the current code but after updating smods, these cards show the normal sprites even if they are locked
Is someone able to point me to the right direction? Ty
How would you achieve that? Would I need to check every time the action to draw a card is made? How can I check that?
is this right
the part in the centers is wrong
you need it to reference that value in G.GAME you created
ohhhh ok
oh maybe all those selfs in it should be card too
got it
the current round one right?
yeah
fixing
A cheaty way you could do it during blinds in have it scale like this:
card.ability.chips = card.ability.chips + math.max(0, #G.hand.cards - num)
you've use the variable num to count how many cards were played in the previous hand
as for Arcane/Spectral packs, the only way I could think of is checking whenever G.hand exists and scaling the joker depending on how many cards were in it
the code is probably wrong but that's the vibe of it lol
whats the part of a joker's code that causes the money increase to pop up where the joker is? similar to to-do list
yeah give it a go
alright here we go đ
what context should I use to find when another Joker is removed? I know context.card_added is used for adding, is it just context.card_removed for removing?
so i uh
cant spawn it now
pretty sure you're gonna have to hook into Card:remove
run an eval G.GAME.current_round.fodder_card.jkey
I am planning on adding a joker destruction context
Well I would need to account for Jokers sold as well for my purposes
My idea is the Joker gives +1 Hand for every uncommon Joker, similarly to Baseball card. I can use context.card_added when you get an Uncommon Joker, but I need to be able to tell when you lose them as well to remove excess hands
it's smiley face rn
thank youuuuuu I can finally replace mine
but what does it actually say
j_smiley
waittt can I copy your homework
lmfao
after the .atlas put or 'Joker'
If you want but if eremel's gonna put in an official one you might want to wait
I guess, yeah, I just don't like waiting lol. Been waiting months for Blue Stake to get changed already
function Card:start_dissolve(dissolve_colours, silent, dissolve_time_fac, no_juice)
local ret = ref_card_dissolve(self, dissolve_colours, silent, dissolve_time_fac, no_juice)
if self.area and self.ability.set == 'Joker' then
SMODS.calculate_context({joker_removed = self})
end
return ret
end```
it spawns, but that is
basegame sprite
đ€
is there a context for Joker scaling? Or is that something I'll need to implement myself
As someone who has done multiple things with joker scaling: absolutely not
What do you need to do with joker scaling?
I want to make a Joker that gets +2 chips when another Joker scales, or something along those lines
Would I just have to search for this Joker in the calculate of Jokers that scale to activate it manually?
anything i could be missing?
how do i check with a seal/enhancement whether a playing card is about to be destroyed
it works for me đ€
wait
I think I have misunderstood
you have a different atlas right?
yes
iiiit
hm
let me look
it should be
considering i just
went over the vanilla atlas
You'd have to do some interesting hacks with metatables as I had to
yewah that'll be fine then
I.E. your joker creates proxies of various tables on all your other jokers, and sets/unsets them as needed to maintain decent functionality
so that place we added or 'Joker' just change the entirety of that bit to whatever your atlas key is
it ends at castle right
(making sure i didnt crop it or something)
yes
ok cool we're finw
so or atlaskey?
nah the whole thing
oh ok
Can it do other cards too
oh so what i had before then lmao
yeah but with the modprefix
I suppose it can be used on consumables yeah
so it can change into the exceptions
cause otherwise itll change into the non-exception version of the joker yeah
ok testing
oh my god
naming my kid eremel
Hi, I want to make/contribute to a balatro mod. I can code and have looked at steammodedd and that stuff. However, I was unable to find resources explaining how to add fancy/custom joker behavior like every consumable being replayed or a card being destroyed/modified. Can yall help?
I couldn't find any base game jokers with a similar effect so I'm not sure where to search đ
to be clear, I looked at code of a mod and was unable to comprehend what is going on in that darn jokers.lua file
How do you make the card below not look shadowed? Do I create another card above it or what?
Also, should I ask this in #âă»modding-general instead?
why does this seal never activate and copy itself?
uh oh (this one hasnt been changed yet i dont know what's happening here)
Where even is the red seal in that code snippet?
copy_card:add_to_deck()?
you're actually changing the card to be the other joker, right?
is rank not meant to be a string?
like, it's not your custom joker with a pretend skin on, it's actually the other joker
red seal? this is a custom seal
yesish
it's taking the ability of the og joker
and then disguising itself using the special atlas
I have made this ridiculously complex for no reason đ€Ł
MAN đ
ok but it's
sort of working?
it's just that if the card uh
doesnt conform to regular shape im guessing?
try using this instead
card.children.center.sprite_pos = G.P_CENTERS[G.GAME.current_round.fodder_card.jkey].pos
card.children.center.atlas.name = 'hpfx_IjiraqJokers'
card.children.center:reset()
yeah
got it
to destroy a card u can check for context.destroy_card
I think this should respect the size too
and return the card u need to destroy
does context.main_eval just not work on seals
all good?
Yes.
As I have said previously it only works on cards in joker areas.
I thought the set on the cards wasnt working but even just checking if they're undiscovered doesn't work ... :( is it handled somewhere else?
well with main_eval this seal does nothing and without it the game crashes
Log?
probably in the draw steps
Can someone help me add a page in Galdur?
ok i might just be stupid but how do i get a seal to do somthing when the card it's on scores
hell yeah
now ive just gotta shop test
how can i do a joker actives like bloodstone(the probability part)?
how can I detect if a blind is beaten in one hand?
if context.end_of_round and G.GAME.blind.boss and G.GAME.current_round.hands_played == 1 then
srry, copypaste :P
if I want it to happen to all blinds, I'd just need to remove G.GAME.blind.boss, right?
oh it needs to update each ante too right?
yea
i though it was only in boss blind, more balanced
eeeyep
it should be as simple as looping over the jokers, finding the disguised ones, and calling the set_ability again
The joker I want to do gives X0.25 mult once when blind is beaten in one hand, but with this code it adds X0.25 multiple times, instead of just once
ok but where would i do that
how can i do a joker actives like bloodstone(the probability part)?
try context.blind_defeated instead of end_of_round
oh ok
now it just doesn't work
can someone help with faulty code?
if doesn't work, you can attach it with glue. Make an extra variable called "applied = true", and set it to false in the end_of_round
I did that with a previous joker and it worked, but when I tried to do it this time it wasn't working.
I'll try again tho
then make it true again with an if context.setting_blind then
cant seem to make it work again
do you remember if you changed anything about undiscovered sprites recently
i dont like this, but it is what it is :P
would I put the extra variable in the config?
yeah
like this
extra = {
applied = false
}
},````
bruh, discord text styling is so bad lol
is there a way I can text if other Jokers give chips? rn I have this:
if context.other_joker and context.other_joker.calculate ~= nil then
local ret = context.other_joker:calculate(self, context.other_joker, context)
if ret[chips] ~= nil or ret[x_chips] ~= nil then
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_mod
return {
message = localize("k_upgrade_ex"),
colour = G.C.BLUE
}
end
end
but it no work
I can't think of anything
how can check if the current blind is the boss blind inside use?
đ
use 3 ` instead of 1, before and after the code
I just remember this used to work
like this
if i wanted to add mult and chips in the same joker how would i do that? this just crashes
is this right?
its 3
Lol I put 4 đż
oh
Mobile dc I suppose lol
bump
if G.GAME.blind.boss?
ok
does G.GAME.bl-- what he said
â
it would need to be G.P_CENTERS.j_hpfx_jokerkey:set_ability(card) I think
would something like this work?
for _, card in ipairs(G.jokers.cards) do
if card.config.center.key == 'j_hpfx_costume' then
G.P_CENTERS.j_hpfx_jokerkey:set_ability(card)
end
end
like this? (funnily enough i was about to ask how i could just call the entire function)
oh the check is wrong too
because the cards have been changed
so the center.key would be j_smiley for example
Yeah, that should work
oh rightttt
Try it and tell me
so what if i just
not
It triggered before?
no, you set a flag on them before right? in the initial set_ability
oh yeah duh i can jsut use that
before I added the bool values, it triggered adding the xmult multiple times. Now with the bool value it just doesn't trigger
Are you using debugplus? If you win a blind without playing any hand it doesn't trigger
If so, play a hand and win the blind
I've been testing it by playing a hand and winning the blind
I haven't been using debugplus to win without playing a hand
Idk what is causing the error
You can erase code to see if that is cuasing the error
Lol, I repeated myself
isIjiraq goes off of the jkey, so i should check that right?
or no, actually, since visibly gets set to true when it's added to the deck i should check that
card.isIjiraq = (exceptions[G.GAME.current_round.fodder_card.jkey] == nil)
card.visiblyIjiraq = false
so check if card.isIjiraq
and then there's this ofc
thought so
so I fixed it by just copying my code from a previous joker I made, and idk what I did differently
thought i broke something but no i actually got banner three times in a row
I think you should place the flag before all of the rest, right after the if
â
forgot to change "jokerkey" to the actual key im an idot
here's the code that worked
Yeah, what I thought. Before the card_eval
i can
i can add an animation to this right đ
like i can still use an event here
if you don't want end_of_round to trigger multiple times you also need to check context.main_eval
I mean it's working just fine now
if i wanted to pick a random card and do something to it in full deck whats the process for that
i know how to affect things held in hand but the thing im trying to do requires being in the shop so that doesnt really work
it's just a very convoluted way to do the same thing
is there a way to check what mod a joker is from?
it works, but not if it's one of the exceptions
how can i make it so it's like
"if the variable (card.isIjiraq) is true OR if the joker's key is in the table of exceptions?"
It seems like using bool values doesn't work, but using numbers does, for some reason
Lua being lua
no it's id
lua is great 
although isnt it other_joker or is this for the joker checking itself
joker as in the variable that holds the joker they want to check
ahhh
actually yeah way easier idea how can i check if a card's key is in a preexisting table? (something like if table contains 'key' then)
does the table have to be global for that to work actually
how do i check a joker's key?
cause like i HAVE a table but it's local
like in code or in debug
in code
which editor is this?
i notice it has a balatro theme
card.config.center.key or card.config.center_key
card.conf-im gonna get you
vscode
you can make vscode look like that? woah
i'm a masochist
if table[key] then
i use vscode for latex because it is the least bad option 
does this work even though the table's local to the joker
yes
oh massive win
so this is fine? (this is in the override file, which is why i was asking about locals)
trying to figure out how to destroy a random card on rerolling the shop, any experienced people know if im on the right track?
as long as exceptions exists in the local scope
G.playing_cards
ohhh my god is that what it is đ
also make that a local variable
are they both in the same function
this is the function being called if the conditional is fulfilled yes
i cant wait to make "add dollar to card"
then they're not in the same scope, you need to make exceptions a global or copypaste it
so take it out of the joker and put it in the main file instead (as a global)
ok testing but also bumping related question
otherwise it just
happens which is
jarring
how do i check cards held in hand?
how do I detect when a second passes in-game?
i think this is something i feel like im getting close
what does it do now
WAIT i removed context and it worked
what it did prior was crash đ„ but it says the rank that it removed
what does pseudoseed do? i havent seen it before
from my understanding its just lik,e a general randomness thing?
like it picks a random card and sets my variable to that card, and then destroys it
i think the pseudoseed in particular
waitttt i gotta test something
it processes the seed string, you used to need it for psudorandom_element until literally this last smods update
YIPPEE it works with two of them
WHAT IS HAPPENING
play a hand
what happened to the misprint
gone
how do i check a card's base suit?
oh it fixed when i restarted
â
card.base.suit
i didnt even know we could do quantum seals
I love finding extremely niche bugs in SMODS and fixing them myself because my mod depends on them
real
Well... this one is technically a vanilla bug that only becomes relevant when extended by SMODS
I just copied what quantum enhancements did.
d-does it work
Yes, but only on playing cards.
i mean yeah theyre seals
had the exact same experience with formatting in joker names
I can guarantee that they would work on jokers if I knew where to patch it in.
well card.lua has stuff about gold seals
actually yeah i think all the seal stuff is here
seems like only gold uses self.playing_card though
but that's probably cause it's for an unlock
why does this do nothing
oops
Is this a joker?
why is joker flat
yes
context.cardarea == G.hand will never happen in context.before if it's a joker.
how would i check for cards in hand then?
how do i unhook something so that when i stop playing on a deck the effect goes away?
You add a condition?
what condition would i use to check what deck you're on
G.hand.cards
if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect.center.key == 'b_modprefix_key'
anyone have reference booster pack code
this also does not work
oh wait nvm
i need more context
SMODS.Booster{
key = 'creditpack',
config = {extra = 1, choose = 1},
atlas = 'Boosters',
pos = { x = 2, y = 0 },
create_card = function(self, card)
return SMODS.create_card({area = G.pack_cards, no_edition = true, key = 'j_credit_card'})
end,
weight = 1,
cost = 1,
group_key = 'groupcreditpack'
}
the size isnt resetting
you can use mine ig
yeah that's not what I meant
G.hand.cards is a list of cards held in hand
what does the extra = mean
extra is how many cards are in the pack
o
in my case its one
yes
G.P_CENTERS.j_hpfx_costume:set_ability(card)
so this code will call the function in the image right?
delete that
ah ok
afaik yes
would it be possible for a joker to do a probability check every second while you have it?
how do I check in a hook if you're playing on a certain deck?
what are you planning
Yes.
ok but the thing with that is
if the card is something like half joker, switching to a full size card just makes it
every second while you have this joker, there's a small chance it displays an image on screen
jumpscare?
yes
i think thats a bug with set_ability
oh didnt see the message lol
idk :3

how would I do it then?




