#💻・modding-dev
1 messages · Page 414 of 1
how does the optional features table look
hmm let me try it out myself
yeah i was wrong, it's context.other_ret.jokers.chips etc
you would probably also need to check if other_ret.jokers exists
how would i theoretically synchronise the message with the destruction here https://cdn.discordapp.com/attachments/704415405812482077/1380301086266753104/safe_calculate.gif?ex=6843610f&is=68420f8f&hm=aadb93b3ad44c1b85ecd56fcee18b5d99837b0f82bd87b1d940ccc95141338b4&
i tried moving the removal part to the calculate effect but got no difference
put the start_dissolve in an event?
Does anyone know if you can make multiple pages for a mod config tab?
works now, two small issues though
- it counts itself
- the message shows up on the joker that was triggered
I forgot events existed
I stopped working on the project for like 3 days and forget everything
Thank you
I don't think so but you can add other tabs that are not part of the config but have the same functionality with SMODS.current_mod.extra_tabs
Ohhhh ok
message_card = card?
- check for
context.other_card ~= card - in the return add
message_card = card
Also just to make sure this is still a decent idea, it's gonna do this if there's an error and have a pop-up either before or after saying there's been an error with it and a button to copy the full error log thing
Like is that a good way of handling things
works as intended now, thank you
Asking cos I'm gonna have to learn a lot more stuff for this so I really don't want to waste time and I trust the judgement of people here
.extra_tabs
im not the intended audience for this so i cant really give you my opinion haha
if context.before and context.cardarea == G.play and not context.blueprint then
local flag = true
for _, v in ipairs(context.full_hand) do
if not SMODS.has_enhancement(v, "m_stone") then
flag = false
end
end
if flag then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_mod
return {
message = localize('k_upgrade_ex'),
colour = G.C.MULT
}
end
end
why is my mult not increasing here? im trying to increase it if all played cards are stone cards
Especially during early playtesting
well as a dev, I want the game to crash when something goes wrong
and as a player I play with one mod at a time so I don't get many crashes
is this a joker?
With a copy button
yes
remove the cardarea check
bet ty
And even as a player, there might be some conflicts or random problems I haven't thought of
If that's the case, I want the game to still be fully playable, no disruption
well, people are more likely to not report problems if the game doesn't crash and personally I don't want people to play with side effects due to the game continuing when it shouldn't
but I don't think the idea is bad, I'm just not the audience for it
Out of interest, what side effects could occur from smth like this happening
I'm guessing it breaking at being removed like that could mess with the remove from deck stuff
for example yeah
does anyone know where i can find some docs about adding custom starting decks. I've been trying to reuse ones from other peoples mods but I cant get it to work
i also recommend this: https://github.com/nh6574/VanillaRemade/blob/main/src/backs.lua
Alright I'll look into that ty
is it possible to start with a specific modded joker in your deck
howmst if I may ask
Is this for a deck?
yeah
Put jokers = {"j_modprefix_key"} in the config.
How would I go about making a challenge start with one random card? I can't figure this stuff out.
If you figure this out, please let Axy know too. Stuck on the same problem.
what's the proper loop argument for the scoring hand? (as in like for k, v in ipairs/pairs(etc) do)
Instead of etc use context.scoring_hand, in contexts where it exists like context.before or similar
i used context.scoring_hand but both ipairs and pairs seems to return nil for it
pairs checks the cards in no particular order, while ipairs goes through it in order. The former is faster than the latter.
What context are you checking it in?
I did this but it crashed my game
its a loop
whats the code
it works differently, see: https://github.com/nh6574/JoyousSpring/blob/4513d7a50361889f843ac1dc9796e1b5b8b5883c/src/mod_info.lua#L100
What if statement is the for loop in?
Zoom out, we need to see the entire calculate function or whatever you're storing this code in
Oh i see
that shouldnt be important for local iirc
I did figure it out. Your object.states.collide.can needs to be true
It needs to collide with the controller object? Omgggg
Yep lol
the problem is that you need another context check, do you have one earlier?
heres the other version of the card
i have had cards with 0 context check for local to work
and local still worked in those
which brings me back to the earlier question #💻・modding-dev message
that's a different question tho
is there an answer to it?
yes, what Axy said
a more correct answer would have been that it depends on the timing you want
there's nothing like G.scoring.cards?
no
yeah i meant how do i make a custom key_append? should have clarified
why is there G.play.cards but not G.scoring.cards
key_append is for the random seed, you just pass a string to it
what are you trying to do?
because 1) G.play is an area cards go in, 2) the scoring hand is obtained with a function on those cards (which you definitely don't need)
so i just have to shove my entire loop into an if statement?
yes, like if context.before
generate a spectral card, how do i format the string? I looked at how they were generated in the base games code (Specifically for sixth sense) and it passed in 'sixth' for the key_append slot, but i'd like to make it different from that joker. I'm not sure how seed formatting works so how would i format it?
SMODS.add_card{set = "Spectral"}
also it's better to check this https://github.com/nh6574/VanillaRemade/blob/0930fcef73e437ee4192ebb1ee12431399654129/src/jokers.lua#L1401
I'm currently trying to play a sound but as soon as I use "play_sound" it crashes with this message. Is there anyone who knows why?
do you have "assets/sounds/Rawr.ogg"?
im trying to make an ante boss where if the player wins the ante with or less than 2 hands they gain 50$ otherwise they get their money set to $0 but not sure how i can start?
now this kind of works but it doesnt iterate higher than 1 at a time
my folder looks looks like this. I have also tried moving the sounds folder into the assets folder to see if that helped
because you're returning in the for loop
that ends the function
so move it between the ends?
it needs to be in assets
should i do it in caluclate? if so , how can i get the number of played hands?
well the problem there is that it will always say upgrade, you need a flag of some sorts
G.GAME.current_round.hands_played
thats what the if is for
oh yeah i didnt see that it only upgraded when there was at least one
It just shows the the same error message. Ive tried also making a "resources" folder
idk
Is there a way that I could call a calculate function from another joker that isn't in the joker slot area?
I'm trying to make a joker learn different joker abilities
works now thx
what's your sound definition
Im sorry im not so strong within coding. What is a sound definition?
like the SMODS.Sound stuff
looking through the docs and doesnt seem like SMODS.Blinds have an calculate func
I've written
"function on_load()
SMODS.Sound:new("Rawr", "sounds/Rawr.ogg")
end"
oh ok that seems to be old syntax
try
SMODS.Sound{ key = "Rawr", path = "Rawr.ogg" }
and put it in assets/sounds
Still "on load"?
no
i tried this but it doesnt seem to work at all ngl
just got my deck to work properly. I've never used Lua before and I've kind of been freestyling everything so thanks for the help
it still crashes. it keeps complaining about missing file in resources/sounds/rawr.ogg
can i see the file structure
What of the modprefix? Are you supplying that as part of string?
that might be a little too much ngl
yeah, too many hands
like this?
try not context.individual and not context.repetition
hmm idk then maybe it's what Ali said
What's your modprefix?
what is a modprefix?
It is added to "items" as part of a string to reference them by.
that worked thank you
Vanilla would have j_joker, but a mod would have j_mod1_joker.
where can i see that?
If you do not have one defined in your .json or header, 4 first symbols of your mod ID are used instead.
Show us your main "file" where you define the name of mod and what not.
xmpl is set as the prefix, which is not ideal. Change it to any 4 letter/number string, and that's your mod prefix.
also did you try the original path i gave you or did you change it before testing
Like jkas, then the sound string would become "jkas_Rawr"... and you can pass sound = "jkas_Rawr" in your return table too.
Wait so i change the prefix to this?
Yeah, that will work.
And do i then change anything else? Like changing the file/directory/path?
anybody know why this triggers twice at the end of the round?
add and context.main_eval
is there a specific way you are supposed to implement localization files? i have a localization/default.lua file, with everything in it named correctly, and from everything i have seen, that should be enough, but none of the text is showing up
Are you accounting for the modprefix in the full key too?
(the reason is that individual and repetition also trigger at that timing)
yes
everything is named j_[modprefix]_[jokerkey]
it doesnt trigger at all now
what is this? a joker?
oh also please use pseudorandom("any string", -10, 10) instead to account for the seed
a seal, i should have specified
oh then try this instead #💻・modding-dev message
anyone know what uibox function is used for the chips/mult ui?
some jokers in action
fixed it, prefix was in a different case in the json file
how do you start with multiple jokers in a custom deck
using the config = { jokers =
goes twice again now
uhh can you try printing context ?
it's defined in function create_UIBox_HUD()
ty
I did a minor spelling mistake
but thanks
oh yeah i forgot about playing_card_end_of_round lol
yall how do i make an image appear with love.graphics.draw and then remove it after 2 seconds or so?
First time modding, unsure how to get past my first of many road blocks, this error message. My script is trying to make just a joker without functionality.
Still get the same error message, but thank you for the help.
ok uh
are you sure you have a png called "BurnDownTheHouse" in your assets folder
and do you have a 1x and a 2x folder
and you also forgot to add atlas = Jokers in SMODS.Joker
why 96
sorry i have a bad memory i forgot
I think I installed Yahimod wrong.
Can anyone help me with making a challenge start with one random card? I've never made a challenge before.
im pretty sure thats for #⚙・modding-general
the ominous and everpowerful chips
Just got told in there that it'd go here 😭
damn
and then someone else told me it goes to just base modding chat 😭
yeah no all good
you're not coding anything
Somewhat confusing channels tbh
bump
Could i somehow make a seal that just made a card do literally nothing
i think that's what a debuff does
look at the debuff code
What if it was a super debuff
super duper debuff
Remove it from the card area and just have it hover menacingly above the playing cards
Always debuffed too
Then it does extra nothing, not even go in and out of decks or be able to be sold, or be interacted with
anyone know if there's a way to refresh the ui? setting G.HUD.definition again doesnt seem to change anything
(i am trying to remove mult ui under certain circumstances)
Dunno if there's a recalculate function for that
Vaguely remember one for UI, dunno if it applies here
oh lmao
Ty for the amazing memory
im here everyday so i see a lot of code ive never used :3
I'm trying to make a joker who gain 10 chips each time a stone card is scored. I can't figure out why, but it gain chips on EACH card scored, whatever the enhancement.. Does someone know why/Have an idea ?
dumb question but how do you convert a bignum back to a normal number
i accidentally disabled moving up antes because of something i do in bignum which needs to be a normal number
i think that's a bad idea
it will reasonably never go beyond e9
bump
oh antes? i mean you can just remove the to_big() right
to_number(value)
unless the player scores a number too large for 10000-ation
ty
N' best balatro coder in the equator
aww
proven fact
You have a return statement in both your for loop and in joker main. Instead, increment a counter in your card.ability.extra table in the for loop, do calculations with it in joker main, then reset the counter in context after. It's a bit cleaner that way.
use context.individual for effects that activate when you score individual cards
something like that ?
So I should use something else ?
the function does exist, but it doesn't seem to accurately change the ui to what it should be, any idea why?
Does other_card exist in that context?
this is literally all im doing, and it was working fine when i had it rely on if true then instead of if G.GAME.nomult then to do the ui changes
Could use that instead of a for loop then
im not sure sorry, i would check a mod that does that like grim or paya's
alright
i'm having trouble with this joker i'm making. It makes the highest rank scoring card lucky and the lowest rank scoring card get the rank of the highest one. However, it won't do the last part when all the variables work nicely
it takes names of the rank
makes sense, let me try
This took a surprising amount of effort due to weirdness with sprite sizing
bigass sword
Did some testing :
- if no stone card are in hand, doesn't scale
- if a stone card is in hand, scale once per scored card (repetitions included), whatever enhancement is on it
after a bit of code adjusting, it works as intended. Thanks!
I have 2 questions, how do I specify full house flush house included, and just full house. Also how do I destroy played cards?
that looks so cool
Anywhere the vanilla game uses the wording "contains [hand]", you use next(context.poker_hands[hand key])
for the destroying part use context.destroy_card
thank you guys!
puts a sweet potato on the sword
Whoa now let's negotiate
puts a yam on my saber
That sounds like an innuendo somehow
i wish but i don't actually own a saber
wink .
anywya
are yams even sweet potatoes
Hm... Wondering if the sword could be a separate sprite object, connect it to the parent object with a minor role, then have it float behind the card as it moves
Or do other things like do a spin if the delta between the VT and T table is large
The issue with that is the vertex shader all cards have by default
There are a number of possible solutions to it, but by default, the greater the distance an object is from the origin relative to the parent, the more distorted it becomes
Mmh, multiplying by the normal of the vector should standardize it, no?
Dunno what math functions love has
I will admit I don't know enough about vertex math to do it off the top of my head, and the documentation for the vertex position function sucks
I just added a modifier to the scale value that it results in based on the relative size of the floating layer, which is 237px
My results isnt exact (it appears just a tad higher and to the right??? Maybe???) and it probably has to do with the transformation matrix, but again, shitty at math
Seems like there's a vector graphics library for Love, but never used it so dunno if it's good
Is there a way to change the automatically generated message that is made by returning mult?
mult_message = "whatever"
I'll try that
So I guess my function SMODS.has_enhancement has a problem ? If someone know which one, would be nice ;;
didn't work, the square was blank and become yellow for some reason
can i see the code
k
also what smods version
you don't need to loop through the hand in context.individual, it already does that
1.0.0-0509c
yes, check context.other_card instead of v
uhh can you try updating
if that doesn't work try remove_default_message = true and add a message
The version is pretty new, I installed it less than a month ago
But i'll try removing default message
smods changes and fixes stuff practically every day
ah
it worked tysm ;;
The description and stuff also doesn't show up for some reason
not because of removing default message
What does your code look like now? Just wanna make sure, so it's efficient and all that
it was just like that
loc_txt
I did that
nope read it again
innactive
Mmh, that looks great! 
yeah it's a common mistake
thanks to your help ✨ (and of N')
Optimisation is.. not my strength ;;
Axy has no talents either, is okay 
dont say that it's not true
looks at you in ranked 332 out of ~350 students back in high school
Axy participated in a math competition once, and managed to get a negative score and brought down the team 
damn
remember, you aren't doing it wrong if no one knows what you're doing
im impressed somehow
As in, the top 10 students from each grade would have recruiters from across the nation show up during class to try and get them to join the university, or hire them after they graduated
The opposite of applying to colleges
They all went to Ivy League schools eventually tho, pretty sure everyone in the top 30 did
goddamn
but honestly, ranking in school doesnt determine much (doesnt mean studying doesnt matter btw)
i used to rank very low in my class once :3
shrugs Hard work can catch up to talent, but both certainly helps
So what N does is good, showing up daily and reading what everyone does
Talent isn't necessary to make cool things
thats true
I graduated salutatorian of my high school class, got a 4.0 GPA in college, and now it feels like I get dumber by the day. Ymmv
N maybe does good, that doesn't mean you're doing bad
FINALLY
i think it wouldnt be wise to compare yourself with people like eremel or N', compare urself with your past self instead to see your improvements :p
are you trying to say i dont make cool things
you should try JoyousSpring
play joyousspring btw
Anyways time for food 
(isn't wise to compare with anybody in reality)
i love chips
got a new problem (more aesthetic this time)
When I score a stone card, I would like a message on my joker like "Upgraded !", and rn this message is on the stone card itself ;; (I tried put self too)
message_card
I was so close ;;
Thanks !
N' my savior (again) ✨
x)
Anyway, It's 3 am in my home, I should go to sleep maybe
How goes in the "fixing the entire video game" mines N'
how does one force mult to always be 1
i tried just hooking game:update and putting it in there but mult still applies
have a good day/night everyone
nobody gave me ideas for PRs so i ran out
me after forgetting context.joker_main:
plus fifty mult
nvm i think i got it
yea i got it
mult is now gone !!
why do we both have animal themed decks
because they are cute
Why can't I access split_suit and split_rank in my challenge deck?
local function set_start_card()
split_suit = pseudorandom_element({"S", "H", "C", "D"}, pseudoseed(("willatro_split")))
local _rank = math.random(2, 14)
if _rank < 10 then
split_rank = _rank
elseif _rank == 10 then
split_rank = 'T'
elseif _rank == 11 then
split_rank = 'J'
elseif _rank == 12 then
split_rank = 'Q'
elseif _rank == 13 then
split_rank = 'K'
elseif _rank == 14 then
split_rank = 'A'
end
end
I made the deck before I realised SMOD existed, so I just editied the source code
Make a pr that lets people type in console and then it'll automatically generate whatever buttons they desire which then create a new cardarea which then imports all of joyousspring
i should secretly just pr the entirety of joyousspring to smods yes
Thats what I'm saying bestie
god i always forget gifs are banned
I dont remember are quantum editions working
I think like a month ago they weren't
enhancements? yes
i dont think quantum editions exist
Mmh, mmh. Axy knows they're improving with every pull request to the mod they're part of, because each time Axy has learned new things that they didn't before, from other modders and their code, as well as the docs and the source code itself. Axy also knows that they don't know a lot of things, so looking at more senior modders keeps Axy humble. Is a good balance!
Bepis is a horrible example because bepis is as awesome as N
They are both smarty pants
Nah, Axy was saying that your hard work and dedication to this place shines through in the cool stuff you make, and that it's not about talent or being "good" at things from the start.
Compare yourself with me and you'll be a genius
Will do so eventually! Currently trying to mod the game, so adding a bunch of cards from JoyousSpring would slow down load times for now. Will give it a try after the mod is in a decent state though!
Balatro uses lua?
is there documentation over joker retriggers? I can't find it on the wiki
yes
bump
no
try looking at cryptid
Iirc if its just a new consumable entirely (ie new category) you need a new ConsumableType
Otherwise you'll need either loc text or some form of localization to add your desc
damn that sucks, I'm using cryptid as a reference and i'm doing something wrong but not sure
talisman is only for breaking naneinf right
it adds exponential mult and animation skips too
smiles
I can understand some of this code cuz i use roblox studio
no like
how do i name my consumable type
please tell me taking this give you like
an upside or somethjing
its supercursed
the entire point is the downside
youre lucky i gave the player time to prepare
can you sell it?
The noble delete button gives me all the prep I need
it makes itself eternal upon obtaining - if you have a way to remove eternal, yes
finally a good use of xchips
I would need clarification by what you mean, cause new consumabletype is here https://github.com/Steamodded/smods/wiki/SMODS.ObjectType#api-documentation-smodsconsumabletype
Unless you just meant how does your consumable which is already in tarot or in spectral or planet appear as that and have a desc
bump
how do i make this say something except [error] that’s what im asking
bump also cause i feel bad
lol
i mean challenges need patches or hooks to do stuff
https://github.com/Steamodded/smods/wiki/SMODS.Consumable
Set and loc_txt iirc
so idk what you would do for that
Yeah, idk what to hook.
probably whatever function uses deck.cards when the challenge starts
Damn, guess I gotta go digging for that then?
I forgot about this, I think I need to have retriggers enabled somewhere, where do I do that?
because when setting up I thought I wouldn't need it lol
I think you have to check context.repetition if that's what you mean.
my joker that retriggers other jokers works when cryptid is installed, but not by itself
retrigger_joker = true
}``
`
Idk if you need cardarea too or nit
Not
where do I put this
Id imagine whenever your main file is
ok tyty
@manic rune i saw you typing bestie
i wasnt typing sob
I saw it
i was merely observing
-# currently in class rn
How goes class
english
class at night?
oh yeah
timezones
sob
it's 27 am here
Im in Ns bed rn, can confirm
do you like outside the boundries of time by any chance
no
He might not like it yea
i have to be awake for a whole 10 hours more
Is there a way to make a specific joker be more common?
What if I subtracted your 10 hours of awake today and add it to tomorrow
make a new rarity
if you mean dynamically then no(t yet)
double it and give it to the next person
gimme
Unfortunately invoking this means I do give it to bepis but only after ive take 73 dollars from your bank account
i wont give you any money just because you decided to take 73 instead of 74 which is my favorite number
Im going to explode
double it and give it to the previous person
Damn, you're gonna explode twice I'm sorry
double it and give it back to me
Damn now I'm exploding 4 times
can it just be one explosion with 4 times the strength
Depends on if you got the 5 big booms package
(Initial boom x4)
whats the key for the eternal sticker
I keep getting a crash at line 1747 to check for cards with an edition, is there an easier way to do this?
You should be able to check for eternal with card.ability.eternal iirc
i want something to apply the eternal sticker as a test
if playing_card.edition should work
it automatically returns true or false on whether the card has an edition?
I think you can do :set_eternal(true)
it doesn't return a boolean but it returns a table when it has an edition and nil when it doesn't so it's practically the same
ohh gotcha
thanks!!
like just that?
im using a consumable to do this
you are never wrong dilly
I adore everything about you
?
like that?
Give it a test and see if it works
trying to see if it works/does anything
i want to make a custom sticker that replicates the effect of eternal but for playing cards but i have no clue how to go about that
it's a bit difficult because destruction effects check for eternal directly
so other mods won't respect it even if you patch the game to
is there a way to just have the sticker be considered as eternal
probably but even then most (or all) effects don't check for eternal on playing cards
I did make eternal work for playing cards, making it work for glass was annoying though
Its a joker instead of a consumable
I made tarot cards to remove perishable and rental from playing cards so that could always be a workaround as well
Are there even any global variables accessible in a challenge? Or do I have to make custom rules?
custom rules are the global variables
Custom rules are too much for my little brain though.
Tbh its mostly throwing shit at a wall and seeing what sticks
I have one that has a shit ton of restrictions, and some that have very few
at least i got my sticker that gives xchips to work
they just add stuff to G.GAME.modifiers.key
Like this is one of mine
Nvm was irrelevant :(
Forgive my lack of formatting im on mobile and too lazy
I've got a function that may or may not be working, but I have no way to access those values in the challenge code.
does pseudorandom_element() require a seed as the second arg or can you just call it with only the table arg
Anyone have examples of custom rules for modifying the challenge deck?
Somehow the odds variable leads to a crash because it's a nil value from the error message
how do i fix this?
I downloaded brainstorm and balatro crashed I'm playing on mobile
Im doing decent?
Solid day overall, made a little bit of mod progress, hanging out with some friends
What can I use to make a custom rule that edits the base deck of a challenge?
rule 4
I didn't share personal info...?
Ohhhh
Mb
can someone help me?
bumping
heres my joker files because the code for that specific joker is too long to fit in a message
its the guess who joker thats causing problems i just dont know WHHHYHHY
try starting a new run
please
bump again
please
please
its elevern at fucjng nuight and u font hasv rhtis joker done
iv bene toriyng this fro threed ay
s
L
thanks for the help
You're welcome
*yuro'e
i give up modding
when do you define G.GAME.current_round.yip_guesswho_card?
outside of the function which isn't called anywhere
i used vanilla remade’s the idol code
that doesn't answer my question
so I'm just starting out modding, I'm trying to make a mod to change the reroll_shop button whenever a specific joker is in hand. I've worked out how to change the reroll button, and I'm starting to work out how to detect if the joker is in hand, but I'm having some problems.
Right now I just have a keybind set up to check for the joker and print in console if it was found or not. It worked the first time, but now it constantly says found even after the joker was sold. Am I missing something?
Here is code
SMODS.Keybind {
key_pressed = "g",
action = function()
if next(SMODS.find_card("j_poke_dunsparce")) then
print("Not found!")
else
print("Found!")
end
end
}
Is there some variable that's not getting cleared?
btw get debugplus
that was the 2nd thing I did haha
just to get the joker in my inventory though, should I be using it for anything else?
when this joker is in the collection, it has the numbers in the first image, but when it is owned, it has the numbers in the second image. how can i make it so it always has the numbers in the first image?
...what if the actual center is referenced instead of the "copy" you have?
okay well
this is the full code of the joker
and this is the localization
["j_crp_cryptposting_cross-mod"] = {
name = "Cryptposting Cross-Mod",
text = {
"{C:chips}+#1#{} Chip#<s>1#",
"{C:mult}+#2#{} Mult",
"{C:white,X:chips}X#3#{} Chip#<s>3#",
"{C:white,X:mult}X#4#{} Mult",
"{C:white,X:dark_edition}^#5#{} Mult",
},
}
is there anything glaringly wrong here?
@hollow sphinx you're not interrupting at all; that's kinda the whole point of this channel
try replacing
G.E_MANAGER:add_event(Event({
func = function()
if G.jokers then
local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_norm_fuko")
card:add_to_deck()
G.jokers:emplace(card)
return true
end
end,
}))
with
G.E_MANAGER:add_event(Event({
func = function()
if G.jokers then
local newcard = SMODS.add_card{key="j_norm_fuko"}
end
return true
end,
}))
Thanks, going to sleep now so I'll try it tomorrow
Why isn't this triggering?
can you post the full joker code here? this should work
makes sense
I don't know how I am going to do both functions because once you return it breaks out of the if statement
this should work
if context.joker_main then
if next(SMODS.find_card("j_gros_michel")) then
return {
m
}
else
return {
mult = card.ability.extra.mult
}
end
end
assuming you replace the placeholder stuff
oh wait one more thing
?
this code currently makes it so that if you have gros michel, it triggers the extra mult effect thing instead of the other thing
is that what you wanted, or do you want both to trigger
both trigger
okay one sec
this'll probably work
if context.joker_main then
return {
m
}
if next(SMODS.find_card("j_gros_michel")) then
return {
mult = card.ability.extra.mult
}
end
end
maybe
How would I go about removing the editions, enhancements, and seals from a card
I kinda thought that once you use return it breaks out of the if statement
i don't believe so
might be dumb though
yea
put return at the end
is there someone who can help me make sense of how to make this work
well it breaks out of the entire function to return the value
right
Like this original code doesn't work because it returns in the first joker_main and then subsequently stops running the function so it never makes it to the second one
yeah
yeah, that's kinda what i was getting at with this
#💻・modding-dev message
well having two if joker_main things doesn't really matter there
It's the return
tbf usually when there's a context.joker_main there's a return in it
returning automatically terminates the function
yeah
anyway, you might be able to steal from cryptid's vacuum's code
sigh i hate not having nitro for the longer text 😭
maybe i can trigger another function?
lack of indents :<
you wouldn't really need to
yeah that's the issue with uploading as a file
i think if you download it, it'll be indented though
I just want it to always do one, but do the other if gros michel exists
do this but put the return in if context.joker_main at the bottom
so
if context.joker_main then
if next(SMODS.find_card("j_gros_michel")) then
return {
mult = card.ability.extra.mult
}
end
return {
m
}
end
?
ah yeah
I didn't see the extra end
yea
testing time
i have a bit of an interesting conundrum when it comes to stickers on playing cards and how it interacts with Death
Death will copy a sticker if a playing card has it but will not lose the sticker when copying a non-stickered card
im honestly kinda fine with it since its not the end of the world and someone deck fixing wouldnt often try it, its just something ive noticed
gros michel average lifespan: Lasts all game or dies immediately
homelatro could technically be considered the largest gros michel mod that doesnt actually contain gros michel
give this man a true...
true
...why are two +'s being added when blueprint copies a card that gives extra chips?

i have so many cards that use the code from vanillaremade gros michel its honestly hilarious i havent run into any issues with that part of the code yet
it didn't work right immediately, the bonus for gros michel happened but not the default bonus, so I put the default bonus as an extra in the gros michel return and now it works properly
gotcha
oh no i think i might know how to code my doom sticker now...
worked it out, I just had the text backwards.. lol
it said not found when it was found and vice versa
the cardarea for the unscoring part of the played hand is just 'unscoring' right?
yes
Aiko in chat rn
Anyone know what i'd need to have in a patch for a deck that makes 'the fool' x3 more common in the shop/tarot packs?
tried it the same way folx make certain jokers more common but it made the fool appear in every cardarea in the shop(vouchers, planet packs etc)
what is folx
time to see if my next sticker works as intended
wait can i return a message for a playing card?
ill try and see if it works
is there a way to guaranteed get a random edition
for some reason poll_edition keeps returning nil for me
you'd think setting _guaranteed to true would fix that but no
what parameters does :start_dissolve() need?
No parameters needed for that.
I don't know of what parameters it accepts, but it doesn't need any to work.
yeah, but i want it to take longer to dissolve
update, don't think so
wondering if context.destroy_card is only a thing for jokers and it's something else for playing cards
edited it to be more like glass and will check if that works
yeah still not working
is there a list of cardareas anywhere ingame
are you using debugplus
yeah b ut i intend to use this in an actual file
i just want to know if theres a list of cardareas so i dont have to manually apply my janky cursed effect to each one
yeah i was just checking real quick if debugplus had an eval for context.cardarea
(it didnt)
whats the effect
stack them all on top of each other in the center of the screen to annoy the player
you might want to enable the optional feature of cardarea deck then
if you do that you can do cardarea == G.deck or cardarea ~= G.deck
i think
dont quote me on it in any case
Isn't that just a tautology
wdym
Like it's always a true statement
they're doing UI stuff not calculate stuff (i think)
would you rather get this joker or pouring boiling water on your skin
i found the solution to this btw
it was just looping through everything in G and checking if it was a cardarea object lmao
I mean i dont see how that changes it tho
If the first one is false then the second one is true by definition
false or true = true
Hey guys i have no idea what im doing, does anyone know how i change the color of the text? Just the regular white text. I was hoping it'd be as simple as changing a variable but im not really sure what im looking at, sorry for interuppting i just cant find this anywhere else
where do you want the text changed
alr cool
Not the card text, just the regular UI text like on the main menu n stuff
This just seemed to be for card text im looking for something simpler
this is more complicated than you think
Im not adding text is what i mean
Crap.. I figured it'd be just as easy as changing the shadow text
youre asking abt making changes to text of base game UI which isnt very simple unless (speculation ahead since i havent done it myself) ||you know how to do lovely patches||
ok so i made this code for spectral seal, but i want to add 1/3 chance to trigger
and 1/6 chance for destroy
how do i do that?
Elaborate, i want to try and learn whatever i can
does anyone know how to make a joker disable itself
you wanna start with making config variables for odds_1 and odds_2 (where the 3 is odds_1 and the 6 is odds_2). G.GAME.probabilities.normal is the numerator (1) in those cases
i dont know how to change the code of the base game, you'd have to ask someone who's done that before
do u have an example code so i can see?
like the config code?
yep
config = { extra = { odds_1 = 3, odds_2 = 6 } },
Bump
im new to lua, so still need to figure out coding lines
Dang
add before calculate?
yeah
after that, i need to check if it hit 1/3 odd to trigger
else if it hits 1/3 destroy card
else do nothing?
@daring fern You got something you wanna say? lol
this is typical behavior from him just ignore it
Ahh digital sign language i see
idk how the actual code for that would go but i do know what goes in the if
and what goes in the if?
for the initial one it's if pseudorandom('string') < G.GAME.probabilities.normal / card.ability.extra.odds_1 then
whatever you want can go in the string, i use the full key of the item but you can use whatever
One more thing, does anyone know why the custom music sometimes loops at the wrong points? The only reason why i started modding the code was because i was trying to find out how to fix this.. Originally i just replaced the .oggs but it kept cutting the song off after a few seconds. Assuming it has to do with the .ogg itself but i wasnt sure. Again I couldn't find anything online about this. Ive been looking for a month.
Not using steammodded or anything like that either
string can be anything like anything, or does it need to contain key?
like i said it can be anything you want, i just use the key of the item because thats my preference
if statements go inside calculate functions
ok
how do i permanently change base reroll cost?
like with a deck? joker? voucher?
wanna check something, in lua, when using else function
does it only trigger if the previous if fails or it works either way?
you might wanna look at the voucher code then
https://github.com/nh6574/VanillaRemade/blob/41ea3b428633da0b6de9306310f89858ac38c62e/src/vouchers.lua#L154
Contribute to nh6574/VanillaRemade development by creating an account on GitHub.
the else clause only runs if the if clause didn't
Hook card:set_cost
ooh alright thanks
Is this the main menu background or the splash splashscreen with the cards loading in
Alrighty thank you!
so id i wanna check 2 functions for a card at the same time but each is separate condition
what do i use?
like so
if condition1 then
--some code here
elseif condition2 then
--only runs if the initial clause didn't, AND if condition2 evaluated to a truthy value
else
--runs if neither the if nor the elseif clause ran
end
like i have this to check 1/3 chance to trigger
and 1/6 chance to destroy it self
but dont wanna if else
(you don't need that last else i just included it to demonstrate how you could if you want)
i wanna activate the 2nd condition either the first one failed or not
it looks like you've got the right idea but you're not checking the contexts properly, you're only checking it in the body of the first if statement when you should be checking it before the if statement
i know
but thats not main issue here
is there a reason this message doesn't show up?
do i do a seperate if for the second condition?
will that work without worring about the 1st?
Do end_of_round and main_eval conflict?
Hm
if you want the second event to only happen if the first one didn't, you have it right
What’s that true at the end of the return table?
im having trouble understanding though
doesnt do anything without the true either
i want it to trigger even if the first one triggered or not
in that case use a separate if
ok
Idk if this would change it at all but maybe massage_card instead of card?
hello everyone! so i started to make my mod yesterday trying to make a joker to start off simple, but i can't make it appear in game. I have the sprites and the code but i can't understand what's the problem
the games loads normally, but the joker does not apppear
Code?
Do you have a metadata file?
nothing
Worth a shot 
messages are so weird
this is the code i made:
@oblique aurora
you mean the code?
i dont have it in my directory folder of the mod
It should be in there if you do have one
And if you do not have one, then https://github.com/Steamodded/smods/wiki/Mod-Metadata
what do i add after it?
You don’t have a then

this is how it is
Yeah you need to read this page and make one of the files it describes
okk
A missing metadata is a classic newbie blunder
so like i give the name "metadata.json"?
i still use a header 😭
i dont see any reason to switch
Yucky
is there a good reason to switch?
game opens normally but when i apply seal it crashes
It’s usually standard to call the file mod_name.json
Tho not sure it matters too much
i think its cause of lua card.ability.extra.odds_
im trying to increase shop prices additively
what do i do with extra??
what should i put here?
Priority you don’t really have to touch, dependencies only if your mod requires another mod to function, badge_colour and badge_text_colour should be hex codes, and version is your mod’s version number
use its color code
Hook card:set_cost
Like 1.0.3 or somthing like that
In card.lua
what do i do with this?
anyone?
Is the mod loading?
do you not have smods installed
i have balatro mod manager
Gruh
That significantly hurts our ability to help you lol
why?
its my first time sorry if i make mistakes
😭
BMM just changes a lot of things to where we cannot account for everything it does
@oblique aurora d oyou have lovely
oh
yes i do
it was much easier than that
you question mark react but this works perfectly lmao
bcuz no mods section
Do you want it to happen before or after clearance sale?
wdym
The adding to the cost?
try renaming balatro to Balatro and mods to Mods
it's already like that
Why can't I get the game to recognize the 2nd localization?
return {
misc={
dictionary={
k_reroll="Reroll",
k_ave_reroll=": Reroll?"
}
}
}
its just a flat addition to the cost, i'm not sure what you mean
it's not related to clearance sale
in your screenshot its lowercase
Do you want clearance sale to discount the extra cost you are giving it?
i don't think it matters much
i just copied your message with the directory
but the directory its still the same
are the files in it the same
This is why BMM isn’t worth dealing with imo, especially if you’re aspiring to dev
Just too many things that can go wrong
what should i do then?
yes
I have no clue how to uninstall it lol
let me do some researcg
does lovely console say anything @oblique aurora
like it puts out debug info in there
when i load up the game?
yes
wait
try removing multiplayer mod ig
Gg
what should i do now?
Make sure lovely is still installed and then give it whirl. Shouldn’t have to do anything with your mods folder
yep everything is still there
the mods and everything else
debugplus works so smods techncially work?
i think you could run eval print(SMODS:find_mod("Cryptid"))
How do I configure a Booster Pack to have certain Jokers?
find_mod*
No, it would be print(next(SMODS.find_mod("Cryptid")))
Am I not able to add new definitions like this?
I'm trying to swap between the two texts
❓ what's confusing? I can try to explain
Probably create a new pool and add the keys of the jokers you want into it
tried not to use BMM and now it gives this error
going off of SMODS Wiki's Booster tab, should this work?
I think so
update your talisman
I know Yahimod does mod-specific joker boosters so maybe try checking that for reference?
okk
Yeah, if Yahimod didn't throw files everywhere like 52-Card Pickup.
still
I can't seem to get cards_to_hand to work. Everything else works fine but that one feature doesn't function. Anybody have any ideas?
now it works, but my mod doesn't show up
your mod needs an smods header file
i think i already have it
why?
i'll send the code rq
this is the main code
where is the line 74
if pseudorandom('string') < G.GAME.probabilities.normal / card.ability.extra.odds_1 then
What about the JSON?
that is rancid, this is the json file you need to have
for the joker file?
(you NEED to have main_file, id, name, prefix, maybe priority)
it should be in your mod folder and it should have .json file type
if pseudorandom('string') < G.GAME.probabilities.normal / card.ability.extra.odds_1 then
main_file will be run
alr hold on let me check
this is what i have
do you have main.lua file
yes, i send it before the whole code i have
use self.config
self.config.extra.odds_1
Thanks, SMODS wiki. Very cool.
(Code attached for ref)
it doesnt crash when applied any more
but crashes after card used
You are missing a =
Thanks, it launched and properly rendered
not necessary
i dont think smods.destroy_cards exists
bump
what do i change it to?
alright this seems to work even though its a tad messier
It does.
oh
Only on new SMODS versions though.
i think the optimal choice would be to use "context.destroying_card and context.cardarea == G.play and context.destroy_card == card" then return { remove = true } ?
you can add an event inbetween the code
You wouldn’t need an area check with the rest of this statement
How do I tell if a new consumable is acquired
context.card_added and context.card.ability.consumeable?
"context.destroying_card and context.cardarea == G.play and context.destroy_card == card" then return { remove = true}
like this?
thanks
Yay, more issues!
-# Why can't this work...
my god this joker has some ugly code
no,
if context.destroying_card and context.cardarea == G.play and context.destroy_card == card then return { remove = true } end
you can add code inbetween the "then" and return statement
like an event to give you something idk
but i dont want guarenteed destroy
want it 1/6 chance to destroy
alright, how would i go about creating a set number of random jokers (ignoring joker slots)
thats why it like this
if context.destroying_card and context.destroying_card == card then
if pseudorandom('string') < G.GAME.probabilities.normal/6 then
return {
remove = true
}
end
end```
idk ask riff raff
true
just replace create_card with SMODS.add_card and profit or smth 🔥🔥🔥🔥
for i = 1, 4 do...
i consulted vanillaremade
for some reason play hand and discard are not working
after i did this
riffraff is very forgettable
what do you mean?
restarted the game a few times and tried
its just they are so slow
like take too long to calculate or something
got a crash due to "attempt to compare table with number" on a card.states.visible = false line, is it from a known mod, and is there a fix?
can you screenshot your entire calc function?
Are you sure that is the right line?
except if they're on an older version, probably
(got the crash report from a tester, saw circa 80 mods)
Did you ask them what that line is on their side?
i haven't, will now
i think i understand the issue here
