#💻・modding-dev
1 messages · Page 583 of 1
oh okay
then theres probably something wrong with the seal key
i imagine
what is _seal currently?
here's what the seal's code looks like:
SMODS.Seal{
key = 'smiley',
atlas = "comedy_seals",
pos = { x = 0, y = 0 },
config = {},
badge_colour = HEX('dc3c92'),
calculate = function(self, card, context)
if context.main_scoring and context.cardarea == G.play then
local curr_mult = mult or 1
local curr_chips = chips or 0
return{
message = "Chaos Shift",
mult = curr_mult + math.random(1, 10),
chips = curr_chips + math.random(1, 10)
}
end
end,
}
well yeah but
what did you put into the joker
or whatever it is
for the key
how to add custom sound to joker
"comedy_smiley_seal"
ohhhh....
SMODS.Sound https://github.com/Steamodded/smods/wiki/SMODS.Sound, then you can use it in play_sound or in the sound return on a joker
with the mod prefix of course
okay new problems
- the extra isn't rotating as if it were attached to the card, but moreso as if it was above it
- it's not scaled
code
@daring fern sorry i need your help again ;u; what have i done wrong this time
(and how can i fix it?)
how would I change money earned from leftover hands in the middle of a run
you can probably just change G.GAME.modifiers.money_per_hand? that's what green deck does at least
just curios how do i make a 50/50 between something good and something bad
just an if else?
do you want it to be affected by oops all 6s and any other modded stuff that affects probabilities?
no just a raw 5050
if pseudorandom('seed') > 0.5 then
-- good thing
else
-- bad thing
end
the seed string can be whatever
I was checking vanillaremade and it was just the config so thank you
will keep that in mind
:3
no problem
Iam trying to make a card that checks if you have two kings ( the 1 in 2 part comes later) and i want it to play an audio on my first king and second king, why is this not working?
(one issue i just fixed is inconsitent capital M's on mult)
Your current method for checking for two Kings, checks the same card twice in a row, and assigns both variables as true.
Realistically, you should instead have a kingCount variable that starts at 0, and has 1 added to it each time the for loop finds a King in the hand.
one systemic issue i just found is that it checks both if statements at once
how do i make it go up seperatly tho?
oh wait
just one if statement that ticks it up
Yeah
Does anyone happen to have experience with adding pages to a mod's config page? I have no clue where to start with implementing that
now how do i make it play two seperate sounds is the real question
what syntax am i missing here
kingCount = kingCount + 1
okay so the mult now works
the sounds dont which is what im trying to wrap my head around
(One second, my PC froze mid-explanation 💀)
lol im not in a hurry
take ur time twin
okay so
currently i have this
and besides the sound
everything works
okay so
i put the sound checks in the if statement
and now they play
during the joker scoring screen
instead of on the king
lol
So, the issue: If context.joker_main is true, context.individual is always false. calculate is a function that is called many times in different contexts, so accounting for this can get complicated.
To start, add a new context.before. This occurs before context.individual, so you can set card.ability.extra.kingCount here, and count the played kings using the same for loop you use currently.
Then, in context.individual, if card.ability.extra.kingCount is 2, you can, say... check if not card.ability.extra.soundCheck then, then play the first sound.else, play the second sound. (This value does NOT need to be set ahead of time, because you're checking if it doesn't exist). Regardless, you can then set card.ability.extra.soundCheck = not card.ability.extra.soundCheck to toggle it between true and false, ensuring that one sound will always play, then the other.
Then, the context.joker_main will exclusively be used to check if card.ability.extra.kingCount is 2, and then return the mults you need. (Which needs to be formatted as a return {} block, which your current code correctly uses elsewhere, but forgets here.
okay wait
not to undermine you but i feel like this can be done less complicated
because with this
everything works
but the sounds dont play during the card triggering phase
but during the joker_maini
Yes, joker_main is always after individual card contexts, so you won't find an easy solution trying to use joker_main for something that applies individual card messages. Also I think if you play a single King with that code, it'd still say "Two" and then do nothing else.
oh yeah true
but cant i just make a seperate if.context.cardarea
Joker Main is only called when context.cardarea is G.jokers
that code has all sorts of issues
calculate = function(self, card, context)
if context.before then
card.config.extra.kingCount = 0
for i = 1, #context.scoring_hand do
if context.scoring_hand[i]:get_id() == 13 then
card.config.extra.kingCount = card.config.extra.kingCount + 1
end
end
elseif context.individual and context.cardarea == G.play and card.config.extra.kingCount == 2 then
card.config.extra.soundCheck = not card.config.extra.soundCheck
if card.config.extra.soundCheck then
return {
sound = 'YA_spring_call',
message = 'Two!'
}
else
return {
sound = 'YA_speed_call',
message = 'Kings!'
}
end
elseif context.joker_main and card.config.extra.kingCount == 2 then
SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
if SMODS.pseudorandom_probability(card, 'two_kings_seed', 1, 2) then
SMODS.calculate_effect({message = 'Safe', colour = G.C.GREEN}, card)
return {
Xmult = card.ability.extra.Xmult,
mult = card.ability.extra.mult
}
else
SMODS.calculate_effect({message = 'LIAR', colour = G.C.MULT}, card)
end
end
end,
@vale grove Try this.
this also won't work
you only ever need to check the cardarea within the repetition and individual contexts
Fixed. Blame SMODS's own wiki for that one.
if only the guy who wrote it was around for you make a complaint to him about it
im here im here

i was just doing something
and by something im collecting the sound bytes i need for this joker
I bet he'd love to hear those complaints
lol
LOL
when the @.everyone ping dont work
<@&1133519078540185692>
yeah it never works lol
it requires perms
even if it looks like it works
which happens regardless of perms
And it's not like the spambot cares either way.
okay wait so what was the issue with this?
it blanket copied a context check
vscode flags exposed functions with yellow, is it just a oversight on the lsp?
The SMODS "Calculate Functions" wiki page tells you to use if context.before and context.cardarea == G.play then, which is just incorrect, because the actual expected default cardarea is G.jokers instead.
I've edited the issue out of the code I posted.
it's not "incorrect" to do that, it's just not the check you would use for a joker
it also doesn't tell you to use anything, it provides an example of how you could check for that context
this is what i get from that
(also i moved everything down one for readablility so 429 is now 430)
calculate = function(self, card, context)
if context.before then
card.ability.extra.kingCount = 0
for i = 1, #context.scoring_hand do
if context.scoring_hand[i]:get_id() == 13 then
card.ability.extra.kingCount = card.ability.extra.kingCount + 1
end
end
elseif context.individual and context.cardarea == G.play and card.ability.extra.kingCount == 2 then
card.ability.extra.soundCheck = not card.ability.extra.soundCheck
if card.ability.extra.soundCheck then
return {
sound = 'YA_spring_call',
message = 'Two!'
}
else
return {
sound = 'YA_speed_call',
message = 'Kings!'
}
end
elseif context.joker_main and card.ability.extra.kingCount == 2 then
SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
if SMODS.pseudorandom_probability(card, 'two_kings_seed', 1, 2) then
SMODS.calculate_effect({message = 'Safe', colour = G.C.GREEN}, card)
return {
Xmult = card.ability.extra.Xmult,
mult = card.ability.extra.mult
}
else
SMODS.calculate_effect({message = 'LIAR', colour = G.C.MULT}, card)
end
end
end,
Oops, typo'd 'center' instead of 'ability' for the kingCount variable, try this.
does anyone know what I'm missing from my code here? I'm actually lost 😭
Your issue isn't in the code segment you posted. Somewhere else in your code, some { is missing the } needed to close it.
okay so this works when two kings are presents, how do i make it still play the Two! even if theres only one king
--Bloodied - Gains x0.5 mult per card destroyed this ante, resets after Boss Blind
SMODS.Enhancement {
key = 'bloodied',
atlas = 'TBOJ_enhancements',
pos = {x = 0, y = 0},
config = {extra = {xmult = 1}},
loc_vars = function(self, info_queue, card)
return {vars = {card.ability.extra.xmult} }
end,
loc_txt = {
name = 'Bloodied Card',
text = {
[1] = 'Gains {X:mult,C:white}X0.5{} Mult per card',
[2] = '{C:attention}destroyed{} this ante, resets',
[3] = 'when {C:attention}Boss Blind{} is defeated',
[4] = '{C:inactive}(Currently {X:mult,C:white}X#1#{} {C:inactive}Mult)'
}
},
--currently only adds xmult if the card is held in hand
calculate = function(self, card, context)
if context.remove_playing_cards and not context.selling_card then
local destroyed_count = 0
for i, destroyed_card in ipairs(context.removed) do
if (destroyed_card.ability.set ~= "Joker") then
destroyed_count = destroyed_count + 1
end
end
--tried specifying G.deck, doesn't seem to work like that
--if context.cardarea == G.deck or context.cardarea == G.hand then
card.ability.extra.xmult = card.ability.extra.xmult + (0.5 * destroyed_count)
--end
end
if context.main_scoring and context.cardarea == G.play then
return {xmult = card.ability.extra.xmult}
end
end,
}```
The way I want this enhancement to work is to upgrade every single bloodied card in the deck every time a card is destroyed, but I also want them to only start upgrading *after* they've been added to the deck, so not just a global count of destroyed cards
Would the only way to do this be hooking the remove_playing_cards context to loop through the entire deck and upgrade all bloodied cards individually? I'm sure there's an easier way I don't recognize
Oh, that is what you wanted? At least it makes things simpler, but that is weird.
i shouldve specificied mb
ah alright, sorry, I still don't know where that would be tho everything seems to be in order (I am blind tho)
not like actually
calculate = function(self, card, context)
if context.before then
card.ability.extra.kingCount = 0
elseif context.individual and context.cardarea == G.play then
if context.other_card:get_id() == 13 then
card.ability.extra.kingCount = card.ability.extra.kingCount + 1
end
if card.ability.extra.kingCount == 1 then
return {
sound = 'YA_spring_call',
message = 'Two!'
}
elseif card.ability.extra.kingCount == 2 then
return {
sound = 'YA_speed_call',
message = 'Kings!'
}
end
elseif context.joker_main and card.ability.extra.kingCount == 2 then
SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
SMODS.calculate_effect({message = '.', colour = G.C.FILTER}, card)
if SMODS.pseudorandom_probability(card, 'two_kings_seed', 1, 2) then
SMODS.calculate_effect({message = 'Safe', colour = G.C.GREEN}, card)
return {
Xmult = card.ability.extra.Xmult,
mult = card.ability.extra.mult
}
else
SMODS.calculate_effect({message = 'LIAR', colour = G.C.MULT}, card)
end
end
end,
Here you go. (joker_main remains unchanged)
if you turn on the discard and deck optional areas it will loop over all your cards for you
that doesnt work sadly
This code segment still looks good (syntax-wise). Just to be sure, what are lines 156 to 181, is it part of or all of this segment? And, have you made sure to save the file before trying it?
i was busy collecting all the visual effects like sprite for the joker so it took a little but im done now
on two kigns it does on one it doesnt
156 to 181 are SMODS.joker to the second if statement and yes it was saved
how do I do that? i know what you're talking about but not how to do it (sorry i'm still relatively new)
and yes I know my code sucks I'm learning 💀
you have an extra end in your for loop that you shouldn't have
i may not be smart, why is my log getting spammed with repetition checks (works fine otherwise i believe)
okay one more try at this
the scaling isn't working
i'm at my wit's end with this one feature 😭
here's how this looks
are you accounting for the card wobble
i have no idea how to make them wobble together ;u;
thanks!
hold up 515 posted a patch that makes it look almost right
let me find it
oooo??
this one
yay thanks :D
I tested the code myself and it worked. What exactly are you expecting to happen when only one King is played?
is it because im calling SMODS blueprint effect basically any time?
Only the Two! sound effect gets played
and visual
wait
lemme see if its something on my end then
oh no it does
i just had an error somewhere
sorry twin
elseif context.individual and context.cardarea == G.play then
if context.other_card:get_id() == 13 then
card.ability.extra.kingCount = card.ability.extra.kingCount + 1
if card.ability.extra.kingCount == 1 then
return {
sound = 'YA_spring_call',
message = 'Two!'
}
elseif card.ability.extra.kingCount == 2 then
return {
sound = 'YA_speed_call',
message = 'Kings!'
}
end
end
That's fine. Anyways, I will correct myself one last time here. Originally I had the Two and Kings sound checks immediately after id id == 13 check, but they should be nested inside it. That way, either sound won't get repeated if, say, you play a two-pair with two Kings followed by two other cards.
oh thanks i didnt even test that
what causes the extra to be skewed, the further left or right it is on the screen?
is there a way to match this skew with that of the center?
is there a way to modify the chip requirement of a future blind this ante? So if you're about to start the small blind, increase the requirement of the boss blind?
Everything I see seems to point towards changing the chips of the blind you're on
When setting the blind, check if it's the small blind, then add a flag.
And when its' the boss blind, check for that flag, remove it and apply requirement increase.
hmmm, I see what you mean - I was hoping to have the blind requirement text update in advance
that's the only thing
how would one add a dummy center? I wish to do that purely because I wanna add hover tooltips to my decks without linking them to proper centers
how do I make a joker allow you to take more cards from a booster pack? (this is for a legendary)
G.GAME.pack_choices
hi i'm back ^u^ here's another round of "why is this so broken oh my god!"
i present:
the stretched out sprite here is Normal Face, position 0, 0 on the atlas
code
would this work:
calculate = function(self, card, context)
if context.open_booster then
local oldChoices = G.GAME.pack_choices
G.GAME.pack_choices = oldChoices + 2
end
end
i wis i was more knowledgeable, i hope you can get it resolved soon 
vertical_offset seems to have worked
cheers ^u^
calculate = function(self, card, context)
if context.open_booster then
G.GAME.pack_choices = G.GAME.pack_choices + 2
end
end
should work just fine but dont quote m eon that because it's midnight and i need to get some sleep
so...
the game crashed the second I tried to check if I even implemented it right in-game
what's the crash
yeag i was gonna say this looks like a localization issue
and now to actually see if it works
IT WORKS!!!
bump before I go
having trouble with copying cards help
it's making ghost consumables and i don't get it
oooOOOOOOOOOoooooooo :3 
this same code was working on my other joker and I copied it over with an extra condition and now it's broken
What's your current code?
-# i should probably check if the other one still works
G.E_MANAGER:add_event(Event({
func = function()
local card_to_copy
if card.ability.extra.sticker >= 2 then
card_to_copy = G.consumeables.cards[1]
else
card_to_copy, _ = pseudorandom_element(G.consumeables.cards, 'ez')
end
local copied_card = copy_card(card_to_copy)
copied_card:set_edition("e_negative", true)
copied_card:add_to_deck()
G.consumeables:emplace(copied_card)
return true
end
}))
it's mostly the perkeo code from vanillaremade
Probably not the cause of the ghosting, but first issue I see is that you automatically copy consumable [1] if there are >= 2 cards, and choose randomly if there's only one.
no
that's a check tied to the joker
it unlocks additional effects when the sticker value is higher (sticker value is tied to the joker's stake completion sticker)
Oh I see
hence this one makes it always copy the leftmost consumable
instead of copying a random one
well it's supposed to
it's not exactly doing the copying right
btw I made the number of extra cards you can take an internal variable in the joker, so if there's something that doubles the values of a joker, it will double the number of extra cards you can take, which in turn means......
this is what happens when I mess around
I find out
high speed robbery
i fixed it
What was the issue?
i was changing the code of the wrong joker
and the correct joker's issue was that the copied card was using a variable called card
which was causing issues with calculate(self,card,context)
Ah
can someone give me a hand with making a booster pack for my mod
what do you want it to do
jokers in my mod
thats done
okay so in the booster's create_card section create a joker from the pool
that's the only difficult part of it
https://github.com/Steamodded/smods/wiki/SMODS.Booster also read this
also obligatory #1418332561771593809 plug
this seems like a good place to promote it because it makes packs with jokers from any 1 mod selected randomly (there's a more expensive pack that lets you choose a specific mod)
you won't need its systems for anything I just think you might like it
Like G.P_CENTER_POOLS['x']? How do you add your Jokers specifically to it?
how do i give blinds variables
well there's two ways
if you own the jokers, you can use the pools argument inside a joker to do it
if you don't own the cards, you can inject them into a pool manually
also this is more like SMODS.ObjectTypes which i would recommend using over G.P_CENTER_POOLS for custom pools
i know i can add config extra to a joker
super helpful, ty
I was using a more convoluted way so that's better
but how do i do so for a blind
got a hook into level_up_hand, how do i make some code only run if the hand is being levelled up by a planet card, and not by something like space joker
"attempt to index field 'jewelry_rank_card' (a nil value)" what is meant by this?
Can I use this with SMODS.create_card() so that it creates a random Joker from that pool? Altho I don't see a "pool" option in the docs
the set argument should be the key of your SMODS.ObjectType declaration key
then it will make a random card from the pool
awesome 💪🏽
thats for adding a joker I own to a pool no? I found that when you told me about it
yeah
all good then
if you wanna add someone else's joker to a pool you need to inject it with :inject() and :inject_card()
or you can add it to the declaration of the object type manually
but then it could cause crashes if that mod isn't loaded so it depends what you need it for
"field" means it's a variable within a table, in this case the variable being referred to is jewelry_rank_card. It does not exist, but is being treated as its own table, which causes the crash.
You need to ensure that G.GAME.current_round.jewelry_rank_card exists before you can set its rank or id.
no no the jokers are mine, my question was about create_card for generating a random Joker from my mod and I didn't know it went into set, so thank you :)
Oh alright, so does that mean I'll have to set it to some value before using it?
Specifically to {}, which represents an empty table.
Got it! I might as well ask, is there anything special about the tables starting with G.GAME? Do I have to inject code into somewhere if I use this prefix as well?
The only thing special about G.GAME is that all of the contents inside of it are saved, so if you exit the game and reload it, the values within will still be there. Otherwise, it's just like any other table.
what If it gets to 1e308
then what'll happen
you'll choose the card in the collection instead?
Aight, thank you for explaining so much! I'll work on it
i believe you want to check for card.config.center.set == "Planet"
is it possible to make abstract classes in balatro modding?
like if i have multiple jokers that has a lot of similarities, is it possible to make a abstract_joker and have a bunch of them extend off of it
or can lua not do that
How can i get a card's area when card.area is nil?
Effectively yes, but you wouldn't call it that. Everything is a function call, so you'd just make a function call that gives you a table with all your pre-set values. Then, the rest of your jokers call the function to get their own copy of the table, fill it with their specific values, then hand that off to the SMODS.Joker function.
gotcha
coding an actual slot machine as a joker is going to be hell
but it will be soooooo worth it
is it animated
Why does this softlock the game?
G.GAME.paused = true
you never unpaused it did you
I forgot that it seems... But why are all the other things still working?
because they're being run before you pause it
you put the G.GAME.paused inside an event
so it's happening after the context checks
something like that
tbch i'm spouting bullshit guesstimation
also I need to study this code
putting pictures and videos in UI boxes is funny
Why?
Still softlocked by the way
obligatory jokebox plug
i make things for the funny because they are funny
pictures and videos going in ui boxes is a new toy to put jokes in
where can i find the code for SMOD.Joker btw, wanted to use that as a reference
you don't need that
you can use the extend thingy
to make a version of SMODS.Joker which already has some preset variables
want to show it upgrading all three hands instead of only showing it upgrading 3oak
like the cryptid/entropy multi-hand planets, for example
what
SMODS.Joker2nd= SMODS.Joker:extend({
--- put SMODS.Joker values in here
})
but as this is being called inside of level_up_hand, using SMODS.smart_level_up_hand or something would just infinite loop and crash the game, as the function would call itself forever and ever
i did NOT know what was a thing
great
that will make it so when you run SMODS.Joker2nd it uses all the values you put in there and you can add more values
it's nice for custom consumable types or anything where you have the same value repeated a bunch
oh and also probably juice the joker
well that part is card:juice_up()
idk about the rest
wouldn't that juice up the planet and not the joker?
depends where you run the code
code's being ran in a hook into level_up_hand
¯_(ツ)_/¯
i guess you could find every instance of the joker to juice them up but that's not exactly
worth doing imo
just a hypothetical, but in theory, is it possible to make a boss blind simulate having high ping?
lag?
i mean you could add a bunch of nothing events
that just make things take longer to happen
yeah you could just actually lag the game
true
or you could just make Game.draw have like a 1 in 2 chance to not do anything during that boss
that's funny
this is an evil boss blind by the way what the fuck why
i don't ask questions
yes
Any other idea why this happens?
making a boss blind based off the bear with high ping
it will fuck up a bunch of the UI, break or delay inputs, and make buttons not work sometimes
it can also put you in purgatory
probably not a good idea
but a fun one
oh my god
yeah it breaks a bunch of shit I have a joker based around it
obligatory jokebox plug
One thing I don't understand, is it the Joker who needs a list of ObjectTypes in pools or is it the ObjectType that needs a list of Jokers in cards? Or both?
it can be either
don't do both for the same joker
your object type should always have 1 card in it at base though
make that the default card
it'll prevent crashes when it can't spawn any other cards
j_joker is a safe one but the cool kids use j_splash as their default nowadays
the "Cool Kids"
i would join the cool kids club however i don't think splash being the default for a set of kitty jokers makes a lot of sense
Every played card counts in scoring
theyre known to not like water
you could make them shake violently when adjacent to splash
and make sounds
and then you can put them in the pack and it's funny
bump
sodium joker
maybe a dumb question but how do you get the name of a consumable type via localize()
Finally managed to generalize my dual state jokers
now the code just looks like ur average unassuming joker
(whoops accidental reply)
calculate = function (self, card, context)
if context.joker_main then
-- this is where the hell begins
local m1 = math.random(0, 4)
local m2 = math.random(0, 4)
local m3 = math.random(0, 4)
local outputs = { "Diamond", "Heart", "Spade", "Club", "7" }
local output1 = outputs[m1]
local output2 = outputs[m2]
local output3 = outputs[m3]
if m1 == m2 and m2 == m3 then
if m1 == 0 then
-- three diamonds
elseif m1 == 1 then
-- three hearts
elseif m1 == 2 then
-- three spades
elseif m1 == 3 then
-- three clubs
elseif m1 == 4 then
-- three 7s
end
else
-- no matches
end
end
end
now to figure out what to do for each payout
do not use math.random
use pseudorandom instead
math.random ignores the game seed meaning it'll be different on the same seed
you can use math.random if you want
but you should keep these things in mind
considering it's literally a slot machine it's not a crime to use math.random
im mainly using math.random so that the outcome is different every time
you can if you want but i think its just a little silly that u are able to savescum a joker
pseudorandom's output is also different every time
it's just different, consistently with the seed
true
i dont think you can savescum on latest smods
usually i would recommend only using math.random for visual things
(has anyone else been having the issue where exiting the run or game makes you lose your saved run??)
no 😭
what the fuck
it's been like this for AGES now
I thought everyone was dealing with it
how do I even begin to troubleshoot my fucking save clearing when I exit the run
i think if you couldnt save your runs there would be more uproar
ii mean I guess
complain to someone else and then go to sleep
complain to someone else and then close discord
Which mods are you using?
i don't close discord very often
how would I use pseudorandom in this situation then?
pseudorandom("unique_seed_here", min, max)
the unique seed is so that it doesnt interfere with other pseudorandom rolls for other things like card draw order
usually a fine idea to just use the joker's name/key
complain to someone else and then go out for a meal
alright changed it so it uses a pseudorandom instead
wonderful
22 is insane 🥀
oh dear, that's a lot
i dont know at this point then
i really don't feel like testing if runs save with or without selections of mods right now
Mod 22 is about 49% done
well it's more like 24% done
now how do I have an event display a message?
G.E_MANAGER:add_event(Event({func = function()
play_sound("slotOutput1")
return true end }))
(as I'm trying to have it show each part of the output, delay for a moment, and then showcase the payout)
wait i figured it out
does anyone know the function called when a card is destroyed
me when i forget to make my function return true
so, can someone give me the base of tarot cards and have 26 of them?
what do i make this guy do?
hey man did you ever figure this out
ok i'm having a problem with one of my jokers and i'm wondering how you pull a table from a mod
also maybe how you make a table to begin with
i know what a table is but i'm not sure how to do it
for context i'm modifying the version of marble joker in vanillaremade to make a modded enhancement
DIE!!
wha
so... I got the gambling to work. How can I get the messages relating to what each individual part got to play before the payout?
1% chance to insta kill blind due to super coolness
Increase % by 1 per trigger
^
do you hate THE sword or Sword himself
oh in that way
this hexes me
hacks you
i dont wanna sound stupid since i have zero coding experience and i just used this an example to learn the very basics- but enough excuses, is it normal for the unexpected character section to be completely empty? Or does it mean something else?
once again asking how i can get it to visually show the animation of all three hands levelling up instead of only just the one
what do i add
it's not lol, how does your json file look like
i probably shouldve been more attentive with it, but the line 1 col 1 kinda confused me
Sorry if its a stupid question
Yes.
spill it.
hmm no idea, that's the entire thing right?
yeah
then again i might have went to fast and missed something in the lua
i dont think that'd affect the json though
this looks like a problem with the json according to the log
it was copied from smods examplejokers reference
which is like,, 8 months old
not the json the lua
what is G.GAME.round.resets.blind_choices?
Are you manually increasing the level?
how do you set the blind mid blind without breaking everything
function level_up_hand(card, hand, instant, amount, ...)
if next(SMODS.find_card("j_vtude_planetarytravel")) and (card.config.center.set == "Planet" or card.config.center.set == "Star")then
local last=nil
local next=nil
local find=false
for _,k in pairs(G.handlist) do
local v=G.GAME.hands[k]
if find==true and v.visible == true then
next=k;break
end
if k==hand then
find=true
end
if find==false and v.visible == true then
last=k
end
end
if last~=nil then
update_hand_text({sound = 'button', volume = 0.7, pitch = 0.18, delay = 0.1}, {handname=localize(hand, 'poker_hands'),chips = G.GAME.hands[hand].chips, mult = G.GAME.hands[hand].mult, level=G.GAME.hands[hand].level})
ref(card, last, true, amount)
end
if next~=nil then
update_hand_text({sound = 'button', volume = 0.7, pitch = 0.18, delay = 0.1}, {handname=localize(hand, 'poker_hands'),chips = G.GAME.hands[hand].chips, mult = G.GAME.hands[hand].mult, level=G.GAME.hands[hand].level})
ref(card, next, true, amount)
end
end
local val = ref(card,hand,instant,amount, ...)
return val
end```
can someone pls help me?
why are you hooking level up hand for this
no i mean what's the effect supposed to be
planet cards also level up the hands next to them in the run info menu (but worded better than that)
so venus also levels up two pair and straight
yeah i would patch the usage code for the planets instead
and then use level up hand for each hand
how would i make it not apply to modded planets like these then
only planets that straightforwardly level up a single hand
if you patch the regular code for the planets (should be in use_consumeable iirc) any planet not using the standard config won't be affected
you came up with two of the same ideas as me by sheer coincidence FUCK 😭
can you elaborate
no i mean i literally wrote these ideas down before for my project im starting up and youve done both of them
ok
Original video : https://youtu.be/uB6FH59RiB8
#snoopdogg
#snoopdoggmeme
#snoopdoggragequit
#gamer
#game
#ragequit
#ragequitgamer
#ytp
#youtubepoop
#snoopdoggytp
#funny
#gaming
#madden
#maddenonline
#sports
#americanfootball
should i send a debug log or the code?
both for help
so is shuffle a joker thing only
i mean elaborate on what you're trying to do and what you mean by "pulling a table"
oh
basically, as far as i understand, the joker i'm making needs to get an enhancement from a table
the problem is i don't know how to get it to select a table for my mod's enhancements and/or how to make a table with them
what's the effect of the joker?
it creates a junk card when blind is selected
junk cards are a enhancement in my mod
they're basically useless stone cards which some cards make not useless
I don't understand why you need a table for any of this
the code would be something like
-- in calculate
if context.setting_blind then
SMODS.add_card{ set = "Base", enhancement = 'm_<your mod's prefix>_<enhancement key>' }
end
.....OHHHHHHHHH BASE IS JUST SUITS AND NUMBERS
also i did not know the m_ part needed to be there
many thanks my man!
the vanillaremade wiki has info on this btw
yes!
uh nh is the shuffle method only for jokers and if so is there a way to make it like work for cards like i don't mind re-implanting the function for cards
is that an optional feature as i haven't heard of that
well G.play.cards:shuffle('aajk') didn't work did i reference it wrong?
it resulted in this crash
you got to be kidding me sorry let me test this out
ngl i kinda dig it just shuffling without flipping it over
photochad users better watch out
progress
Hello friends! I've got another joker I want some help with
I'm continuing the development of the Necrozma jokers, and I want to implement the other ability for Dusk Mane and Dawn Wings Necrozma
They create a negative consumable when the round starts, that being The Sun for Dusk Mane and The Moon for Dawn Wings
And I know the code would be very similar to Cartomancer, but what would I have to edit in the code to make it work as intended?
just make it so that the generated card's edition is negative
actually Cartomancer is more accurate. Perkeo does create a negative consumable but it's only a consumable you have currently, and it's after the shop
fair nuf
with SMODS.add_card() in the table that ur passing in
set key = "c_moon" and edition = "e_negative" or something
and key = "c_sun" for the other
at least i think those are the right keys off the top of my head
is key and key_append the same thing
no
what does key_append do in the cartomancer code
key_append just labels the source of the creation
doesnt really do anything except for randomization
Can I have help with something simple? I used Jokerforge to make the basic of a consumable, and I wanted to make it so it did something when selecting a specific joker (in this case, the "Joker" joker). This is what it currently looks like. You currently select any single Joker, you use the consumable, it destroys the selected Joker and creates a Perkeo. I want it to only do that when selecting "Joker".
I haven't really done anything in lua before, so please excuse my inability to do it on my own 😅
...
if #G.jokers.highlighted == 1 and G.jokers.highlighted[1].config.center.key == 'j_joker' then
...
^
Line 25 I assume?
Such should also be duplicated in the can_use function just in case, but yes.
also you'll probably want to use SMODS.destroy_cards(self_card) in place of line 31
and yes you want to add the if condition to the can_use function as well, so you don't use it on another joker (or none at all) and try to destroy a card that doesn't exist
So it'll look like this? How do I add the if to the can_use?
is it replacing the function(self,card)?
return #G.jokers.highlighted == 1 and G.jokers.highlighted[1].config.center.key == 'j_joker'
^ that replaces line 53
...though, for that, should do
return G.jokers and G.jokers.highlighted and G.jokers.highlighted[1] and G.jokers.highlighted[1].config.center.key == 'j_joker' and #G.jokers.highlighted == 1
to prevent potential crashes of attempt to index nil value.
if you put the #G.jokers.highlighted == 1 before the check if the highlighted card is joker, then you shouldn't need to check if G.jokers.highlighted[1] exists
so question about the can_use part. I intended on having the consumable do something different for each joker it's used on. Do I need to have a can_use for each of them?
Like if I wanted it to spawn a different joker for Lusty, for example?
you're going to need to reorganize some code
that's fine by me
and probably think about setting up a default joker it can spawn if you want it to work with other modded jokers
I think it needs to be fixed anyway because the atlas crashes now
true (or I can
if I wanted to be funny)
yea as long as you have some sort of default behavior, it'll make your can_use function much simpler (you can revert it to how you had it in the original screenshot)
coo coo
anyway what's the intended behavior exactly? does every single joker spawn a different joker, or are there big groups of jokers that all spawn one specific joker?
quick question before totally fixing the code? what file is causing this crash?
and uh, chaos. (the consumable part isn't necessary if it's too hard to add, jokers are fun enough)
hey uh how do you set a blind mid blind
oh wait this is going to be much easier than i thought, because you don't have to hardcode anything (i don't think at least)
oh really? I assumed it'd have to be hard coded lmao
Basically I want Joker to go to Perkeo, and everything else is back 1 space (so Wee goes to blueprint, for example)
there should be a table of each card type in collection order somewhere, how else would it be ordered in the collection in the first place lol
anyway i'll need to go check some cryptid code for how to do that, ace aequilibrium iterates through that sort of table for jokers specifically
If it does all jokers that's cool, although just vanilla is 100% ok as well
fixed this btw
use = function(self, card, area, copier)
-- you don't need to check if you're highlighting exactly one
-- joker, the can_use function is guaranteeing that already
local self_card = G.jokers.highlighted[1]
local key = self_card.config.center.key
-- this chunk of code gets the index of the joker to
-- create
local index = 1
for i, v in ipairs(G.P_CENTER_POOLS.Joker) do
if v.key == key then
index = i - 1
break
end
end
-- this bit handles the edge case for if you're using
-- the consumable on default Joker
if index < 1 then index = #G.P_CENTER_POOLS.Joker end
-- creating the new card, mostly unedited (but tweaked a bit)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
play_sound('timpani')
card:juice_up(0.3, 0.5)
return true
end
}))
SMODS.destroy_cards(self_card)
delay(0.6)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
play_sound('timpani')
if #G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit then
G.GAME.joker_buffer = G.GAME.joker_buffer + 1
local new_joker = SMODS.add_card({ set = 'Joker', key = G.P_CENTER_POOLS.Joker[index].key })
G.GAME.joker_buffer = G.GAME.joker_buffer - 1
end
card:juice_up(0.3, 0.5)
return true
end
}))
delay(0.6)
end
:3 this replaces the whole use function
:O
time to test :D
Question, does it loop around? So Joker loops to the back of the collection?
ok so i was initially going to come back here because i couldn't fix a syntax error but i ended up fixing it anyways
but yeah almost all of necrozma's forms are functional
yes
I mean, isn't Dawn Wings like a bad Uber?
i meant in my mod
oh since you seem to be knowledgable about pokemon you may be able to help me with my mod
shoot, what's up?
well my mod is based around legendary pokemon
and there are a few that I still don't have ideas for
like mewtwo
is it still within vanilla? like your not adding extra enhancements/editions?
there is a single edition that I added, that being Cell cards for Zygarde's gimmick
Maybe some form of Tarot/Planet manipulation?
well Solgaleo, Lunala and Necrozma's abilities are tarot/consumable centric
so mewtwo is big smart. So you'd want something that makes player feel big smart.
well the big thing with mewtwo is that it's a man-made killing machine made from Mew's DNA
true...
Actually
and since there's DNA in Balatro i was thinking Mew could be some sort of upgraded version of it
Glass cards
Mew makes sense
Mewtwo broke from containment, and glass cards are score killers
So I'm not sure if it's a failsafe and doesn't properly loop around, but Joker became Scholar. Unless it's an actual ID order
blurgh
dangit
is it working for all the other jokers at least?
as far as I have tested, yes. Perfectly
ok good
It also does not bypass eternal, but it doesn't make anything new. That's fine, closer to vanilla that way
ok now I gotta make the art cause this rules
thanks y'all! I appreciate it
oh wait dragonite do you want to know what Zygarde's gimmick is
Like in game?
yeah in my mod
I ultra cooked with this one
ok so Zygarde always starts at 10% form
and 10% creates a Cell consumable when you play a Full House
and the cell consumable turns up to 2 cards into Cell cards (which give 71 chips and 8 mult)
and when you get 10 cell edition cards in your whole deck, it transforms into 50% form
50% converts the first hand of the round into Cell cards, and retriggers the highest ranked cell card twice
Does it convert to 100%
yes i was about to get into that
my b continue
when you have 50 cell edition cards in your full deck, it transforms into Complete form
and complete gives 2x mult for every cell card played and held in hand
I just felt so smart for coming up with the transforming gimmick as you get more cell cards in your deck
That's real cool. And it's a build around
And quite honestly, it's very strong when you complete it.
oh necrozma's stuff is cool too
base necrozma doesn't do anything yet because i have no ideas for it
but Solgaleo gives 1.5x mult for every Sun consumable held
and Lunala gives 1.5x mult for every Moon consumable held
and when either of them are next to Necrozma when you exit the shop, it transforms
dusk mane creates a negative Sun when the blind is selected, and all Sun consumables give 2x mult
and dawn wings does the same but for Moon consumables
and when Dawn Wings is next to Solgaleo, or if Dusk Mane is next to Lunala at the end of the shop, it creates Ultra Necrozma
and Ultra Necrozma gives 3x mult for ALL CONSUMABLES
and mind you legendary pokemon are hard to come by
which tbf i might need to add a more reliable way to obtain them if anyone wants to use them in a legit run
still havent found a solution
if context.individual
and context.cardarea == G.hand
and not context.end_of_round
and SMODS.has_enhancement(context.other_card, "m_steel") then
local msg1 = finn_quotes[ math.random(#finn_quotes) ]
if #SMODS.find_card('j_inf_huntress') > 0 then
return {
x_chips = card.ability.extra.huntress ^ 2,
message = msg1
}
else
return {
x_chips = card.ability.extra.huntress,
message = msg1
}
end
end
``` how do i make the message text appear below the joker instead of above the playing cards?
message_card = card
where would i add that?
In the return.
thank you!
if you care, just finished the art for it
very cool
i'm going crazy this was just working I go and update the art, and now it suddenly crashes
put a comma after the end on the line right before the can_use function starts
jimbo to perkeo speedrun
htgrfhgddhtghtg.,.,,
this is awesome actually
I like that it's 1 behind in the collection too
most mods put their legendaries near the end of the collection so it doesn't really give you immediate legendary access unless two mods line up such that going back 1 turns it into a legendary
h
fun fact, the code is slightly different. Jimbo changes to a random joker. :3
Even if I didn't change it, my mod adds jokers, so you'd just hit the end of my jokers
if context.joker_main then
return{
card = card,
Xchip_mod = card.ability.extra.Xchips,
message = 'X' .. card.ability.extra.Xchips .. " Chips",
colour = G.C.CHIPS,
sound = "xmpl_MultiplicativeChips"
}
end
why is the sound not working it crashes my game instead
play_sound('prefix_sound')
x chips sound exists in base smods Im pretty sure
So you don't need to do that
nope it just does the normal +chips sound
return {xchips = card.ability.extra.Xchips}
damn I didn't even know xchips is built in
wait so why wasn't it playing with xchip_mod
@daring fern got the fake cards working, tysm again!
but i do have a question, how could i tweak this so that if i merge two cards their initial states are saved? like if i had a square joker with 8 chips saved how would i transfer that
oh hold up mightve found it
Code?
bruh too long for discord one moment
if card.ability.extra.maxboism_multi_boxes then
for i, v in ipairs(card.ability.extra.maxboism_multi_boxes) do
local key = v
G.maxboism_savedjokercards = G.maxboism_savedjokercards or {}
G.maxboism_savedjokercards[card.sort_id] = G.maxboism_savedjokercards[card.sort_id] or {}
if not G.maxboism_savedjokercards[card.sort_id][key] then
local old_ability = copy_table(card.ability)
local old_center = card.config.center
local old_center_key = card.config.center_key
card:set_ability(key, nil, 'quantum')
card:update(0.016)
G.maxboism_savedjokercards[card.sort_id][key] = SMODS.shallow_copy(card)
G.maxboism_savedjokercards[card.sort_id][key].ability = copy_table(G.maxboism_savedjokercards
[card.sort_id][key].ability)
for i, v in ipairs({ "T", "VT", "CT" }) do
G.maxboism_savedjokercards[card.sort_id][key][v] = copy_table(G.maxboism_savedjokercards
[card.sort_id][key][v])
end
G.maxboism_savedjokercards[card.sort_id][key].config = SMODS.shallow_copy(G
.maxboism_savedjokercards
[card.sort_id][key].config)
```
card.ability = old_ability
card.config.center = old_center
card.config.center_key = old_center_key
for i, v in ipairs({ 'juice_up', 'start_dissolve', 'remove', 'flip' }) do
G.maxboism_savedjokercards[card.sort_id][key][v] = function(_, ...)
return card[v](card, ...)
end
end
end
local partreturn = G.maxboism_savedjokercards[card.sort_id][key]:calculate_joker(context)
if type(partreturn) == 'table' then
totalreturn = SMODS.merge_effects({ totalreturn, partreturn })
end
end
if next(totalreturn) ~= nil then
return totalreturn
else
return false
end
end```
i assume i pass the values after set ability/update?
Where are you setting card.ability.extra.maxboism_multi_boxes?
currently setting it with my merge function
this is my only real question, i believe ill be able to do the rest myself
if not ill ask in a bit :clueless:
No, because the values don't exist, you need to do it in the merge function.
i meant more like if i store the ability.config table with the merge function, i would slot it in after card:update() with card.ability.config = [mytable] or something equivalent yes?
or am i misunderstanding something
No, it's card.ability
Also you would want each value in card.ability.extra.maxboism_multi_boxes to be a table.
Which stores the key and card.ability
ah thats what i was looking for, thank you
guys i'm so beyond lost as to why 8ball and rebate are just giving cards mult like that, help would be appreciated
What is the goal?
Are you trying to do quantum ranks?
i'm just trying to have it so that when i have parrot in the joker roster, any card will work for jokers that require a 2, 4, 6 or 8 (e.g. 8 ball now being able to give tarots on any scored card, wee joker upgrading on any scored card, etc)
So you want cards to be considered all ranks but only for jokers and if the rank being checked is 2, 4, 6 or 8?
yeah i want it to work for jokers but i don't want it to suddenly make every hand a 5oak, flush five or something like that, i don't know if 'all ranks' would be exactly right because i don't for instance want fibonacci to trigger 5 times over because it's checking for 5 ranks
No, that's not how quantum ranks work, jokers that check for multiple ranks would only trigger once.
But also that's not possible normally, currently and with mod compatibility.
Unless you use the ids_op method.
Which can break sometimes.
i'm fine with it not being compatible with other modded jokers for what i'm making, just wondering where the +5 mult and +4 mult are coming from
You're brackets are not correctly placed on Even Steven
Also you should be taking ownership.
knew it was something silly like that lmao ty
i'm pretty new to this, what does that mean and what difference does it make?
alright, i'll try and figure the rest out from here so i can learn it properly, thanks so much for the help :)
taking ownership of a vanilla object replaces its vanilla behavior
No, it doesn't.
It justs replaces that values on the center if it is there.
it replaces certain aspects of its vanilla behavior, not the entire behavior
which of course happens by overwriting values and functions
but I'm pretty sure that's what huy meant anyway
I was about to evaluate my statement further
some irl errand came
e.g. modifying a vanilla joker's
calculatenullifies its previous behavior defined inCard:calculate_joker
That's still incorrect.
wha
It will still run if nothing is returned on the context being called.
oh I get it
💀 takes a bit brainpower tho
for modded jokers we don't usually have to strictly return something because they're not originally defined in Card:calculate_joker
that part is a bit intransparent tbh
I have this enhancement here and I want to make it scale faster when I have a specific joker. For some reason, no matter if I have the specific joker or not, the enhancement always uses the faster scaling
I remember someone telling me a long time ago that SMODS.find_card would be the thing that worked but I might've done something wrong
next(SMODS.find_card(...))
SMODS.find_card returns a table of cards with the specified key, it will be empty but still exist if no cards are found.
hm ok
so is there a better option for if I'm trying to see if I have a specific joker bought?
do the thing eremel just mentioned
next(table) returns nil if table is empty
oh ok yay it works now
glorp
you can just create any center with in_pool = function() return false end, (never appears in-game) and no_collection = true (hidden from collection)
really an Other localization entry should be supported there, but as of now it isn't
i thought that would be bad practice tbh
thank you
oh it totally is
yep
there just is no better way as of yet
hoping to see something like this in the future
i may have wanted to address that before and just forgot
no worries
not a big thing for sure, would just need to have galdur and CardSleeves also adopt it
ive done this without needing to create centers by patching where the game creates hovered tooltips :p
is there a chance that you could show how you did this 
that's even worse practice lmao
just need to have two mods do it differently and boom
interesting
i was able to make it display two tooltips at once too, like this
true...
https://github.com/Steamodded/smods/issues/986 made an issue for now
I wonder if for non-center values we should utilise the same method we use for colours and ahve the loc_vars table provide the localize call?
no
I wanna add my own joker to the main menu like where the ace of spades is normally. I've tried looking to see how other mods did it but I couldnt find anything
Hook Game:main_menu and put a card on G.title_top
sorry but how do I do that 😭
hey how do I change rarity weights
here
You can also copy some other mod 
thats what I tried at first but I couldnt find how they did it
this didn't work
how can i change the position of a joker in the jokers card area
if context.joker_main then
return{
G.GAME.common_mod = 0,
G.GAME.uncommon_mod = 0,
G.GAME.rare_mod = 1
}
end
currently just a test
yeah because its in a return
thats why it doesnt work
you cant run code in a return without putting a function in it
just make it not a return
minor hotpot leak
local my_pos
for k, v in pairs(G.jokers.cards) do
if v == card then
my_pos = k
break
end
end
if my_pos then
table.remove(G.jokers.cards, my_pos)
table.insert(G.jokers.cards, new_pos, card)
end
ty
calculate = function(self, card, context)
if context.pre_discard and G.GAME.current_round.hands_played == 0 then
local discard_list = {}
for _, v in ipairs(G.discard) do
discard_list[#discard_list+1] = v
end
local discard_to_redraw, _ = pseudorandom_element(discard_list, 'discard_retrieve')
if G.GAME.current_round.discards_used == 0 then
G.E_MANAGER:add_event(Event({
func = function()
print("test")
G.hand:emplace(discard_to_redraw)
return true
end
}))
end
end
Is it possible to redraw cards from the discard pile back into my hand?
I'm not sure if what I did was correct (and the game crashed when I executed this code)
G.FUNCS.draw_from_discard_to_deck()
Also update SMODS
it works but there is 2 side effects the effect doesn't go away after selling the joker and for some reason joker descriptions no longer appears
well yeah
because thats not how passive joker effects work
also if descriptions arent appearing then you broke something else
i'm very nearly almost done with Doug Dimmadome's hat :D it's scaled and positioned correctly now
the only problem is the shearing not matching the base card
it appears to be pivoting about its own centre, and not the centre of the card
You mean that it's acting if it were where it was if you didn't offset it?
so iirc to make a passive joker I need to put what I want in a function and make the effect happen when the check for the joker is true right?
ohhhhh thanks
so it’s already in the api
(I didn’t even see any of that in the docs lol)
That's unfixable to my knowledge, but there is a patch you can do to fix some of it.
i've already applied the patch u suggested a while back
Then no you can't fix it.
calculate function, maybe adding a non blocking event if its too complex
that depends on the type of effect, but here you just apply/revert the effect in add/remove from deck
thats
not a passive effect
i'll try that, and if that doesn't work, i'll just leave it as is
I remember the newer version of smod wasn’t very compatible with some mods, so I just installed the older one
not sure if that’s still an issue now
well if the effect affects a certain context then ya
It's not, unless the mods don't get updated anymore.
if you dont check the context then it just does it whenever the joker is calculated at all
like drawing more cards for booster packs is a passive but you can implement it by checking for blind set context
not passively
oh yea i meant checking context too
also i wouldnt consider anything that happens in calculate to be passive personally
How would I go about making only Tarot cards appear in the shop?
I found that I can set G.GAME.planet_rate to 0, but what about jokers and booster packs? (Arcana only)
theres a game modifier to disable jokers in shop
just ban all non-arcana packs by looping over G.P_CENTER_POOLS.Booster and checking their kind
and for jokers yeah just use the jokerless modifier
Oh right I forgot about that challenge, thank you!
kind?
how can i check when a boss blind is defeated in contexts
How can I add the jokerless modifier to a deck? I saw that it's no_shop_jokers when added to a challenge, but decks don't have a rules field as far as I'm concerned
context.end_of_round and context.beat_boss
kkty
G.GAME.joker_rate = 0
Thank you!
function rarity_thing()
if next(SMODS.find_card("j_xmpl_corrupt_joker")) then
for i = 1, #G.jokers.cards do
local joker_key = G.jokers.cards[i].config.key
if G.P_CENTERS[joker_key].rarity == 1 then
G.common_mod = G.common_mod + 0.05
G.uncommon_mod = G.uncommon_mod - 0.05
G.rare_mod = G.rare_mod - 0.05
end
if G.P_CENTERS[joker_key].rarity == 2 then
G.common_mod = G.common_mod - 0.05
G.uncommon_mod = G.uncommon_mod + 0.05
G.rare_mod = G.rare_mod - 0.05
end
if G.P_CENTERS[joker_key].rarity == 3 then
G.common_mod = G.common_mod - 0.05
G.uncommon_mod = G.uncommon_mod - 0.05
G.rare_mod = G.rare_mod + 0.05
end
if G.P_CENTERS[joker_key].rarity == 4 then
G.common_mod = G.common_mod - 0.05
G.uncommon_mod = G.uncommon_mod - 0.05
G.rare_mod = G.rare_mod - 0.05
G.legendary_mod = G.legendary_mod + 0.05
end
return true
end
end
return false
end
this no work
are you calling the function
how to do that
what do you mean how to do that
just like any othjer function???
also legendary_mod does nothing because legendary weight is 0 and multiplying that doesnt change that
so like I just called it and it will update automatically?
no
if you want to set the rarities on buy youd want to call it in the setup function
also usually things will multiply these values which will just break it
and currently it also only increases weights and never reverts the changes
oh tht too
what are the defaults
wdym
0.7 common
0.25 uncommon
0.05 rare
also you telling me those are multipliers?
I thought this was like raw + 5%
-# bump :P
Do you know how to hook?
I don't
heyo! if i send the card's center's VT as an argument to my custom shader, then apply it to the extra sprite, would that work?
Tried this solution (I don't plan for mod compatibility so I don't want to overkill with hooking), but the other type of packs are still appearing
G.E_MANAGER:add_event(Event({
func = function()
G.GAME.joker_rate = 0
G.GAME.planet_rate = 0
for key, pack in pairs(G.P_CENTER_POOLS.Booster) do
if (pack.kind ~= 'Arcana') then
G.GAME.banned_keys[key] = true
end
end
return true
end
}))
end```
what type would this variable be?
G.P_CENTER_POOLS.Booster is an array, not a dictionary. the "key" variable just ends up being a number
in the loop you can just do pack.key to get the key
oh ok
Thank you, that seems to have worked!
whats the area that contains held tags?
tried following what was shown there but I think I did it wrong
yeah youre overriding the function entirely
you need to call the original function in there still
would the original function be just Game:main_menu() ?
menu_joker doesn't exist.
No, it would be game_main_menu_ref(self)
oh ok
how can i make the loc vars able to set the selected hand as a blind proprety
look at how the base game does it ig
is it possible to have the joker's sprite get updated based on certain values?
(this is me trying to make the slot machine have nicer visuals that update based on what values are in each slot [i'll handle the actual spriting of it later])
where
vanillaremade
no like
in what part
i dont see loc vars in the blinds
and when they do
they dont add propreties
card.children.center:set_sprite_pos({x = number, y = number})
? how does ox do it them
its literally just a proprety in G.GAME
the game does not have current_round.least_played_poker_hand though
but does it show the least played one?
yeah no I have 0 clue what im doing 😭
i know i've asked this before but i still cannot figure it out
how do i make it so that your run ends if you have a joker from my mod
why are you calling the original function twice
you call menu_joker
No, because that doesn't exist.
i personally use a seperate function to calculate whatever the moving element is and use it for both loc var and calculatoe
actually it might be a card area
so would I call this function before the local ret = game_main_menu_ref('j_marshii_marshii') part
No, you remove that.
oh ok
Have you tried putting it in an event?
you know what ill just hook it to Game:update
how do I do that?
https://github.com/nh6574/VanillaRemade/wiki somewhere in here probly
i have tried it
SMODS.add_card{ key = "j_pfx_jokerkey", area = G.title_top }
ok yay it finally works!
yay
is there a way to fix custom scoring parameters displaying "?" when playing a hand that contains flipped cards
Hook/Patch CardArea:parse_highlighted()
this is for before the hand is played, no?
Yes.
im reffering to something else
What do you mean then?
im sending a video for reference
the new operator is created via SMODS.Scoring_Parameter and SMODS.Scoring_Calculation
That's probably a SMODS issue then.
bummer
hey, anyone know if there's contexts for destroying jokers or consumables? or if it's possible to have stuff trigger off that at all
i think every destruction effect uses destroy_card
I checked here and there isnt any listed https://github.com/Steamodded/smods/wiki/Calculate-Functions
and you check the contexts area to see which type was destroyed
or maybe
hm
youre prolly right I think I misread that one since I haven't used it
well idk this doesn't seem like what I need
idk
this is just super confusing to me tbh
maybe I'll just try stuff and see what happens
context.joker_type_destroyed
what
that's for jokers? there doesnt happen to be one for comsumables does there?
I have a handful of jokers that do that
No, that's for non-playing cards
non-playing cards in what context sorry
Cards that are not playing cards.
I'm a little new still so might need more description
does anyone know where in the code is h_popup rendered?
sorry I mean like, in what context do I check if the card isn't a playing card, and uh, how
for ui specifically
or does it just work in both
No, it's just context.joker_type_destroyed
ohhhh
so just to double check, context.joker_type_destroyed will trigger for both jokers and consumables
Yes.
deal, ty
how do i make madness not trigger if it has no joker to destroy
i'm making a joker like it that, instead of gaining xmult, makes a clone
loop through the jokers, make a new list with every eligible joker, check the length of that list?
i mean that would work but how do i check each joker?
i am very new to modding balatro
i mean just check if its eternal or not i think?
also if youre new bookmark these https://github.com/nh6574/VanillaRemade/wiki https://github.com/Steamodded/smods/wiki/Calculate-Functions
k
You can look at how VanillaRemade's Madness does it. https://github.com/nh6574/VanillaRemade/blob/main/src/jokers.lua#L1717
k
wait
is there a way for me to just check if the length of the destructable joker list is 0?
The direct way would be #destructable_jokers > 0, but VanillaRemade does it indirectly by first getting a random element from it, then checking if it actually got anything. If the list is empty, joker_to_destroy won't exist.
oh you can call pseudorandom_element with an empty list?
Yeah it'll just return nil
i was worried it would error out if i tried
for some reason #destructable_jokers > 0 isn't working
i guess it's the formatting?
i probably need to put brackets around it
What does the code look like?
the rest is basically just madness but without the scaling
You haven’t shown the important bit where you create destructible jokers 😭
ohhhh
i thought that wouldn't matter since it's basically madness but ok
the cut off text is just a then and the end of abominationnation
game crashes when i actually have a joker from my mod, dunno what to fix here
(this is for a blind)
Remove the not 'crynosure... part. That always reads as false
G.jokers.cards[i] ~= card already ensures the card won't destroy itself.
ah
well here's the thing
i need to make sure the card won't destroy any copies of itself too
Then you can replace this with G.jokers.cards[i].config.center.key ~= "whatever your jokers key is"
Then you need to check the key of the card
how can i get the transformation applied to a card from hover and juice and etc.?
[this is for a shader]
ok
ok now they're destroying themselves
im gonna see if just having both lines works
Jokers keys start with j_
