#💻・modding-dev
1 messages · Page 404 of 1
How possible is this without patches
hook set ability then multiply ability table values recursively
i really need to just learn how to concretely hook/patch things
I keep bumping into it
Hello, so i've tried to my joker only add a wheel of fortune but it can create them even if there's no space left in consumables, i tried to use something like G.consumable isn't something that exist apparently, G.consumables either as i tried, any idea maybe ?
if context.joker_main then
if math.random(1, 5) == 1 and #G.consumable.cards < G.consumables.config.card_limit then
SMODS.add_card{
set = 'Tarot',
key = 'c_wheel_of_fortune',
skip_materialize = false,
}
end```
https://github.com/nh6574/VanillaRemade/blob/main/src/jokers.lua#L4564 you can look at Cartomancer for reference since that creates a tarot card every time a Blind is selected
Thanks !
is there a variable that stores the current mult value of the scoring hand?
This is the second time now that I've made a new type of thing and the name's just refused to cooperate ;-;
It worked with my rarity by putting it inside of the globalization misc->dictionary and misc->labels but it didn't work here
it's just called mult
ah ok
it's supposed to be doing nothing!!
i was trying to compare the hand mult to if it was a square number
which would activate a joker
how do i get if a card has a certain enhancement?
nvm i got it
SMODS.has_enhancement(card, "m_modprefix_key")
oh, some mod hooked onto the eternal sticker??
how to make a joker unsellable?
Look at how Eternal works.
where?
It seems to not show that part or if it does it's not in stickers.lua
How I can use the pseudorandom func?
pseudorandom("seed", min, max)
arg1 is a seed, make it something like "prefix_name"
arg2 is min
arg3 is max
needed to make seeds' randoms be the same
for example:
pseudorandom("aply_seal_chance", 0, 4)
I want to get a 1/4 chance of aply a seal
that's right?
min should be 1 then
not 0
i would do "[yourModPrefix]_ApplySealChance" as the seed tho
something
why shouldnt the min be 1
literally why
If it is 1, isn't at least one seal always applied?
No, it would be if pseudorandom("modprefix_apply_seal_chance") < G.GAME.probabilities.normal / 4
what is G.playing_cards
Is all cards in the deck
I want to declare the applye_seal_chance in config.extra in the Joker, is that ok?
I got a error trying to read from there
Log?
bump
config = {
extra = {
mult = 0,
mult_per_card = 7,
seal_apply_chance = 0.25,
color ='Red',
odds = 4,
}
},
What is that line?
if pseudorandom("modprefix_apply_seal_chance") < G.GAME.probabilities.normal / card.ability.extra.odds
What object is this?
The joker calculate, inside the calculate func
just realized that e_negative displays as "+1 Joker slot", not "+1 consumable slot"
other mods have this issue, so i wouldnt bother fixing it
something
do you know how infoqueues work
yeah
im talking to something
Yes, and you can get the "+1 consumable slot" version of negative.
is e_negative that?
No, it's { key = "e_negative_consumable", set = "Edition", config = { extra = 1 } }
then why are you ? ing the fact that e_negative is +1 Joker slot
that is what it shows
I didn't understand what they were referring to.
then use words
? means several things as a react
which is why you really cant just react people to talk
agreed, too ambiguous
yea
mom dad please stop fighting
anyways
i have this nice function i use for my mod
im like 90% sure smods already has it
but i already have it in place in too many situations for me to feel like changing it
yea its just find_card
but i like my version better
what does your version do
is it possible to make a consumable card retain after use? (it'll be destroyed after the hand is played)
would in_pool consider a table of size 0 to be false?
no
How would I make a voucher allow wof to give negative edition?
You would either patch/take ownership of wheel of fortune or hook poll_edition
Is there some good examples of taking ownership out there?
Or would hooking or patching be easier?
The easiest would probably be hooking poll_edition
I don't even know how I'd begin to do that.
It would be something like: ```lua
local oldpolledition = poll_edition
function poll_edition(_key, _mod, _no_neg, _guaranteed, _options)
if _key == 'wheel_of_fortune' then _no_neg = false end
end
Just add the check for if the voucher is redeemed as well.
if G.GAME.used_vouchers['v_modprefix_theaxolotl'] == true
Thanks!
is there a way for a joker to tell when a card is flipped face-down?
Is there an easy way to test vouchers with debugplus?
go to shop, press 3 on a voucher in collection
card.facing == "back"
if you mean at the moment it is flipped then no without hooking
would i need to run a loop to check the main hand for it if i wanted to have jokers that worked "when a card is flipped"?
Wouldn't it be better to hook Card:flip() for that effect?
in my mod i just hook card:flip and create a context
how do i hook smth
In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...
and how would i create a context with it
SMODS.calculate_context({context_name = true})
Why would you want a version of a function with less functionality?
I don't feel like changing it in my code
That doesn’t answer the question, you said you like yours better
I’m just interested why
does vanilla game not have xchips?
it does not but i think smods adds it
i get the feeling i misunderstood smth but there wasnt much i feel like there was to understand
actually its prolly just context.end_of_round
inside the calc func my config.extra variables are nil
and context.individual and context.cardarea == G.play ???
G.play doesn't exist at end of round
should be card.ability.extra.var_name
whats the goal here
like SMODS.calculate_context is to create a context no?
Actually is referenced as you say and still don't working
show the full code
this is what i do
like this then?
no
look at what the other guy sent above
read it all and learn what each part does, hooking is very useful
this is the more simplified version but it can get fucked up by animations and stuff
ok, i'm trying to use xchips, but it's dividing them???
show the code
SMODS.Joker {
key = 'bonustime',
rarity = "crb_effect",
--atlas = 'commons',
--pos = { x = 0, y = 0 },
--soul_pos = { x = 1, y = 0 },
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
config = {
unlocked = true,
discovered = true,
extra = {
xchips = 0.03,
xmult = 0.02,
}
},
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = { set = "Other", key = "effect_info" }
return { vars = { card.ability.extra.xchips, card.ability.extra.xmult}}
end,
calculate = function(self, card, context)
-- X0.03 chips, X0.02 mult
if context.joker_main then
return {
xchips = card.ability.extra.xchips,
xmult = card.ability.extra.xmult
}
end
-- destroys itself at end of round
if context.end_of_round and context.cardarea == G.jokers then
return {
message = localize("effect_down"),
card:start_dissolve()
}
end
end
}```
you're giving X0.03 chips
Well you're multiplying by 0.03
you mightve meant to do 1.03
Also unlocked and discovered go outside of config
did you get a new instance of the joker or restarted a run before testing?
I started a new run then spawn the joker
so all jokers that have a decimal xmult is valued 1.x, not 0.x?
what line is the error at
yeah, if you want to increase
What sort of jokers are you referencing by this?
like this?
yeah
xmult and xchips will just multiply the amount of mult and chips by the number you passed
how would i call for the context in a calculate function?
^^^
if its below 1 it makes the value smaller
like to get context.flipped?
Same as usual, if context.flipped then
you might want to put the mod prefix in your context flag to ensure it's unique
so for this, i'll have to make it x1.3 mult?
context.flipped
yes
like within the calculate contex or within the overall local?
in the calculate_context call, just do smt like prefix_flipped = self
you can flip a card at any time doing other_card:flip()
You'd just have to check if it's facing down before doing that
Which idk if there's an easy way
also if you want your joker to counteract blinds you can just use the smods context.stay_flipped im pretty sure
i mean the context ahould do that right?
help . what context
end_of_round and something presumedly but gr ... it doesn't have G.play
the point of the one im working on rn is to have a 1 in 2 chance of flipping a card back over when it's turned face down
that or i just rework this joker
surely end of round has the scoring hand in the context too
i have another one that gains mult/xmult each time a card is flipped but that's easier i think
no, it's not in scoring
nope
Rip
ye so that's hwy i'm asking
Mark the first scoring card with a flag in context.before
Then find it in G.playing_cards or smt
thats what i would do yeah
You'd have to remove the flag of every other card each time to ensure only the latest hand played has it
:despair:
okay that's not actually that bad but smh someone update smods
to do what lol
modding too hard
to include scoring hand in end of round maybe
But the hand has gone by that time
This would be a standard destruction timing check
how would i make the joker message appear when the card is destroyed? currently, it appears after it's destroyed
yeah I'm not saying do that, just interpreting what they said
Yeah I’m just saying what they should instead 🤣
anyone knows how to fix this?
show code
key = 'bonustime',
rarity = "crb_effect",
--atlas = 'commons',
--pos = { x = 0, y = 0 },
--soul_pos = { x = 1, y = 0 },
blueprint_compat = false,
eternal_compat = false,
perishable_compat = false,
unlocked = true,
discovered = true,
config = {
extra = {
xchips = 1.5,
xmult = 1.2,
}
},
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = { set = "Other", key = "effect_info" }
return { vars = { card.ability.extra.xchips - 1, card.ability.extra.xmult - 1}}
end,
calculate = function(self, card, context)
-- X1.03 chips, X1.02 mult
if context.joker_main then
return {
xchips = card.ability.extra.xchips,
xmult = card.ability.extra.xmult
}
end
-- destroys itself at end of round
if context.end_of_round and context.cardarea == G.jokers then
return {
message = localize("effect_down"),
card:start_dissolve()
}
end
end
}```
Put card:start_dissolve() out of the return.
Use SMODS.destroy_cards(card) instead
could we have an argument to make destroy_cards not use an event
i started using it but it messed up my timings
actually i just realised this joker kinda sucks
i don't need to do this check . i just need to buff the joker
make the event optional or use a callback function that happens when the card is actually destroyed would prob be better
I’d be interested to see how it did that, but I don’t see why it can’t
yeah
(I haven't used it at all)
i need an event to happen after the start_dissolve event happens for my summoning shenanigans
but if it's an event inside an event it ruins it
Can’t you just chain the events?
wdym
Put the event for the summoning stuff directly after the destroy cards call
yes thats what i do
And that doesn’t work?
rn I'm queuing start_dissolve > my event
if i do destroy_cards > my event it queues start_dissolve after my event
But thats not how events work 🤔
im making a custom suit called critters it looks so goofy
it's crashing
im pretty sure it is how they work
well what is the crash and the code
no, let me guess, you don't have the SMODS version with destroy_cards
Are you putting the destroy cards call in an event?
no, destroy_cards calls start_dissolve in an event
happy little guy
Well, are some error like :
My joker don't show my seal description
The pseudorandom function don't
and stuff like that
The error logs make my think that is some error in the reference vars inside the config.extra
Yeah but queuing an event after calling the function shouldn’t be able to happen before the start dissolve event
code is exactly the same as i shared above, but replacing card:start_dissolve() withSMODS.destroy_cards(card)
#💻・modding-dev message
yeah you need to update SMODS
but start_dissolve also calls an event, that's what I mean
You should always build on the latest release
Oh right
new version already?
can you show the full error
im honestly not sure tbh sorry
Put the destroy_cards call before the return, change the cardarea check for and context.main_eval
what's line 112 of your main.lua file
The error must be the card.ability.extra.adds
if you have the odds defined in your config then spawn a new copy of your joker
now it doesn't destroy the joker
that's cus your context.main_eval == G.jokers is always false, remove the == G.jokers part
how do i move this up to be in the correct spot?
Hello! Would someone be able to explain/point me in the direction to understanding how pseudorandom works?
Put it at the top of the sprite
How I refer the seal that I defined in my mod? With the key?
modprefix_sealkey
yep, that did it... thx!
Mods/lovely/dump/functions/misc_functions.lua is the file where that function is defined
Sweet thank you!
How I refer my joker's config variables in the calculate func? card.ability.variable?
what does the config look like
card.ability corresponds to the config in your joker
config = {
extra = {
mult = 0,
mult_per_card = 7,
seal ='Succu_Pink',
odds = 4,
}
},
then
calculate = function(x,x,x)
...
card.ability.extra.seal
...
end
Right?
yeah, any calls for variables in config extra is card.ability.extra.variable
so long as the variable is a valid value, it should work
in terms of jokers anyway
how can i reference the round number?
key = "bi",
loc_txt = {
name = "Bi",
label = "Bi",
text = {
"{C:chips}+#1#{} chips",
"{C:mult}+#2#{} mult"
}
},
shader = "ljc_bi",
discovered = true,
unlocked = true,
config = { chips = 25, mult = 5 },
in_shop = true,
weight = 6,
extra_cost = 6,
apply_to_float = true,
badge_colour = HEX('FFC0CB'),
loc_vars = function(self)
return { vars = { self.config.chips, self.config.mult } }
end
})```
I can't figure out why, but nothing i put this edition on will have the edition activate. I feel like it'll be something really obvious once pointed out, but i can't find the problem
i just custom made the chips and mult for my enhancement
i think its just bugged
something
i had the same issue
so i custom made the calc for it
I want to reduce the card's chips value without change the card's skin, some like the strength taro but decrese the abse chips
i think you can look at perma buffs doc for that
does anyone know the reference for this
G.GAME.round?
it works
how I refer card.chips? not a joker, just a normal card chips
how to check the poker hand currently being played?
if next(context.poker_hands['Hand']) to check for a specific one
like if next(context.poker_hands['Straight']) then...
self.base.nominal will get the chip score of the card
like
for k, v in pairs(context.scoring_hand) do
v.base.nominal
where v.base.nominal is the score of the card being iterated over
something's wrong
you need a context check
like
if context.cardarea == G.jokers then
if context.before then
if next(context.poker_hands['Pair']) then
needs to be in the before context, as in before it scores
lemme try now
how does context.repetition work? I'm a bit confused on it
calculate = function(self, card, context)
if context.cardarea == G.jokers then
if context.before then
if next(context.poker_hands['Straight']) then
card.ability.a_mult = card.ability.extra.mult_mod
elseif not (context.before or context.after) then
if card.ability.a_mult > 0 then
return {
message = localize {type = 'variable', key = 'a_mult', vars = {card.ability.a_mult}},
mult_mod = card.ability.a_mult,
colour = G.C.MULT
}
end
You do return {repetitions = number}
this assumes that your config vars are
config = {
a_mult = #number,
extra = {
mult_mod = #number
},
},
loc_vars = function(self, info_queue, card)
return {
vars = {card.ability.a_mult, card.ability.extra.mult_mod}
}
end
this isn't retriggering the cards. (I want it to retrigger twos)
if context.repetition then
if card.ability.extra.retriggers > 0 then
return {
message = localize('k_again_ex'),
repetitions = card.ability.extra.retriggers,
card = card
}
end
end
thats what i use on mine and it works, not sure why yours isnt
huh
Is card.ability.extra.cardRetriggers more than 0?
i basically snatched it from vanillaremades hack
ya
seems like it might be the > operator, because card.ability.a_mult is nil
so um then
yeah
where 0 and 1 are whatever you want it to start as and whatever you want it to change by
It's repetitions not repetitons
dang, thank you
try removing the if card.ability.a_mult > 0 then ... end check
keep the elseif not (context.before or context.after and the return statement
if card.ability.a_mult is nil it will probably crash anyway
also
okk
how might one index G.P_CARDS
i tried what it seems vanilla does with
G.P_CARDS['H'..'9'] and G.P_CARDS['H'..'_'..'9'] and G.P_CARDS[_suit..'_'.._rank]
where _suit = 'H' and _rank = '9'
oh and G.P_CARDS['H_9']
crashed every single time
H_9 should work
oh its because im stupid
forgot to take it out of the front = pseudorandom_element(G.P_CARDS['H'..'9'], pseudoseed('cert_fr')), i copied it from
im like "oh ill index it to make it not random" 🤦♂️
Is there any way to make it so all players see same shop in multiplayer
not same shop list in ante
same shop every blind
how do i set the sell value of a joker?
self:set_cost()
something like
card.ability.extra_value = self.ability.extra_value + self.ability.extra.value_mod
card:set_cost()
return {
message = localize('k_val_up'),
colour = G.C.MONEY
}
Anyone available who knows a little bit about love2d vertex shader stuff?
im trying to do a thing like Devious or Clever Joker but with Royal Flush
royal flush is not a real poker hand iirc it's still a straight flush
ah
maybe context.scoring_name == "Royal Flush" works but I'm not sure
when I remove the next it does NOTHING
i mean that makes sense because it's nil
how do i set a joker negative as soon as it appears?
edition = "e_negative"
Checking for the scoring name should work
card:set_edition("e_negative")?
What does this mean?
I think it means your atlas is looking for a file that doesn't exist.
doesnt work
I gave some instructions on how to place the files and stuff
how do i add an extra slot to a joker?
You mean how to add an extra joker slot?
yeah
G.jokers.config.card_limit = G.jokers.config.card_limit + 1?
(sample to set number to 5. You can work out the math yourself, right?
)
how do you check if the played hand is only a specified hand as opposed to contains the specified hand
Check context.scoring_name
under what context do i put that?
When do you want to get that extra joker slot?
when it's obtained
basically, i don't want it to take a slot when it's obtained
add_to_deck = function (self, card, from_debuff)
-- card gets added
end,
remove_from_deck = function (self, card, from_debuff)
-- card gets deleted
end,
does it go inside or outside calculate?
Outside.
Outside. They are like calculate but run only when well, the card gets added or removed.
hey does anyone know why this doesnt work with talisman still?
Ive been kinda struggling with this one specific joker and i dont know why
G.GAME.dollars is a table with talisman
ah
so if I had to guess that's where your issue is
thanks
that does not seem to be it
everything to G.GAME.dollars = card.ability.extra.ogmult works correctly
somehow its either of these lines
crash that says attempt to call 'ceil,' a nil value ceil(pseudorandom(pseudoseed('count')) * 4)
ceil is not a variable, its a standard lua function??
Math.ceil
i'm not sure then
I've seen a ton of people have problems returning any value based on current dollars with talisman installed
Oh yeah cus you're setting your card's ability to a talisman table
Maybe?
I don't like talisman
I think it's the return
yeah they're returning a big num table thing
but idk all of that should work according to people but I didn't see it working
I don't like talisman
modifying the return and adding to_big's to convert them into tables still does like
nothing
I'll try and check out some other mod's codes to see if any mod i have has pulled this off before and hopefully that'll give me some insight as to what's going wrong
Try to_number(to_big())?
okay i just
no no
i just did the strangest thing ever
and somehow that worked
this fixed it
i hate talisman
how would i change the enhancements of all cards in my deck at once?
it looks like you're not even returning a table anymore
yeah i
i dont know
it just works
for k, v in pairs(G.playing_cards) do
v:set_ability(G.P_CENTERS["m_modprefix_key"])
end
```?
it gains xmult as intended
thank you
fed it 4 then 5 dollars and it has x18 after taking all my money
i
dont know how
Code?
How could someone rename that so there is no errors with the atlas?
looks more like "greedy goblin"
Is Blade.png in 1x and 2x?
yeah i need to change the localization he is indeed a very greedy goblin
Yup
assets/1x and assets/2x
Like that
im making a deck that makes all the playing cards have the glass card enhancement but how can i replace the normal playing cards with the glass cards?
theres a deck that does that
cryptid has the glass subdeck of the enhancement deck
apply = function(self, back)
G.E_MANAGER:add_event(Event({
func = function()
if not G.playing_cards then return false end
for k, v in pairs(G.playing_cards) do
v:set_ability(G.P_CENTERS["m_glass"])
end
return true
end
}))
end
```?
Something is wrong with your atlas then, maybe your file isn't a png? maybe the name isn't exactly "Blade.png" or smt
oh damn
could be anything
can someone explain why this isnt working
Any solutions for this?
just iterate over G.playing_cards in your apply function and call set_ability
do you have file extensions enabled in your file explorer
the py need ","?
the screenshot looks fine so you have a syntax error elsewhere
Yes
It has it
the calculate function doesnt need to be in anything? its good?
I don't know what it is then, i guess just restart your game if you haven't
it needs to be inside the SMODS.Joker definition, I don't know how you have it now
I'm helping somebody else with the mod
can you right click the image and open properties and screenshot?
You are missing a , after loc_txt
ohh thanks
these files are called Blade.png.png
What
this you mean? i get the same crash
is there a way to check if you aree in endless mode
No, on the } that closes loc_txt
rename them to just Blade
Like that?
ok syntax fixed, now i get this :p
what is a arithmetic?
G.jokers.cards is a table you want #G.jokers.cards
math
Arithmetic is an elementary branch of mathematics that deals with numerical operations like addition, subtraction, multiplication, and division. In a wider sense, it also includes exponentiation, extraction of roots, and taking logarithms.
Arithmetic systems can be distinguished based on the type of numbers they operate on. Integer arithmetic is...
that is the best question i've seen in this channel ngl
fuck did I just cake into?
how do i check for the rank of a card?
if you brought cake then share with all of us
card:get_id()?
card.config.card.value?
you mean card.base.value for the rank key
possibly
i yoinked that from a piece of code I found
wait no, I am almost certain I did it right
For some reason cards have a card field inside config
trying to add my own consumable type, but I always get this crash:
blinds also have blind.config.blind iirc
After renaming it to just Blade
alr ty
Make sure you have file extensions enabled in your file explorer, then rename it to exactly Blade.png
-# yummers, spanish text, again
Forgot to change it to english again 💀
I mean that looks fine to me
how can i check if the lucky enhancement has hit on a playing card? im trying to check if the 20+ mult or 20$ activates if not then it destroys the card lmao
card.lucky_trigger
owers fr?
thanks
Then what happens
show your code
I don't know what's wrong
ui failure
If I erase the .PNG it gives me the sab_sab error
SMODS.ConsumableType {
key = "tboi_reversed",
default = "c_tboi_r_fool",
primary_colour = HEX("89093a"),
secondary_colour = HEX("89093a"),
collection_rows = { 5, 6 },
shop_rate = 2.5
}
The atlas error
in lua you have \n¿
and the consumable
not in balatro UI code at least
uh
SMODS.Consumable {
key = "r_fool",
set = "tboi_reversed",
loc_txt = {
name = "The Fool?",
text = {
"Creates the last",
"{set.primary_colour}Reversed Tarot{} card",
"used during this run,",
"{s:0.8}{C:inactive}\"Let go and move on\""
}
},
pos = { x = 0, y = 0 },
atlas = "tboi_reversed_tarots",
loc_vars = function(self, info_queue, card)
return {
vars = {
}
}
end,
use = function(self, card, area, copier)
end,
can_use = function(self, card)
end
}
one of them
how can i get the card in this situation?
ok it works now
you need to do it in calculate
shouldn't default be c_tboi_reversed_r_fool?
do I question the strange being on the right of the screen?
that's aikoyori
wtf do you mean strange creature
I'll try that
“Aiko says” lmao
same error
Are you declaring your type before your consumable
dunno, all looks fine from what I can see, are they both in the same file?
it looks good
then i loop through the playing cards and then i can dissolve that said card?
I wasn't ugh, such a dumb error. Thanks for catching that lol
np
back again 
-# with the same problem 
hi toma
what's the problem
hi aiko
The files need to be called Blade.png for the atlas to get it
something like this or i am doing it worng?
the mult gain thing and it
not gaining
same thing as the last 2 times
no, you need to use context.destroy_card like you would in a joker
doesnt this need a context
ok n
yeah i saw that but i have no idea why it isn't working
is this good now?
no
if context.destroy_card and context.destroy_card.lucky_trigger then
return { remove = true }
end
this is nice
does anyone know the variable that gets the number of jokers currently owned?
#G.jokers.cards?
how do you keep doing this
?
The person I'm helping sent me this
it's 1x not x1
well their image name is Joker.png
not Blade.png
this is possibly the strangest development set up I have seen
Oh nvm, they changed their atlas definition too
it was correct here 😭
Looks like they were trying to solve an issue someone else had with their mod, but they just don't have the same mod at all
tried that but it doesnt remove the card if it didnt hit the lucky trigger
oh you want it if it didn't hit?
yeah
that's if it hit
you need to check if the card is lucky too
check if the card is lucky first
how
and SMODS.has_enhancement(context.destroy_card, 'm_lucky')
is there something wrong with this file structure that would cause the joker's xmult gain not to trigger? is it because it's determined with global variables and i'm calling the globals wrong?
-# (is this too many images i just wanted to give proper context)
oh you don't want to return in a calculate_context hook
is this good?
?
no i dont think that's the problem but that will cause errors, the only return should be the last one
Told them
no, the has_enhancement check has to be after checking context.destroy_card
oops
remove the context.individual too
ill try that first then
I'm so confused at this calculate_context hook, can't you just put that using_consumeable part inside the joker itself
tried that but i remained without cards lol
oh context.cardarea == G.play
it removed the card even tho it hit the lucky trigger?
hmm then either i got the name of the value wrong or it's not set/it's cleared before then
yeah looks like it's cleared before then
damn how can i fix it
set your own flag
how?
How can i edit the logo on the title screen
well that depends
the joker is meant to gain xmult if a global variable is updated from 0
said variable updates within a take_ownership of the use function of a consumable
if i can do that within the joker then by all means relinquish the method
yes you can absolutely do that in your joker
you need to check in context.individual as well and set a flag like card.no_lucky_hit and then check for that in destroy_card
curious if i wanted to make a card like the fool but it can recreate last consumable used how would I do that?
something like this?
So when you update said global variable put a calculate_context call, then in your joker's calculate function listen for that specific context you created
also this part here does not need to be in a hook, which was what I was referring to initially
bumping this
You've also already set up the custom context
yeah,,,,,,
then in your joker's calculate function you just do stuff when if context.chudhit then
You would have the key be balatro and set raw_key = true
inside of the atlas or if sstatement in the function?
Remove the function and inside the atlas.
no lol
you want to have a flag in each individual card not the deck, and only if it is a lucky card in G.play that didn't hit
are you fr
Is there a way to remove certain bossess? Or to make them more rare
how can I create a label for my custom consumable?
that's what i was telling you when i told you about the context btw lol
i just thought you were using the hook for something more complicated
Oh cool, how?
ohhhhhhh so i overthought what you meant 😭
Maybe?
are you using loc_txt or localization file
I'm using loc_txt for the individual cards, but it doesn't show up even if I try to use the localization file instead
and in the consumables list the label doesn't show up at all obviously
It worked
seomthing like this?
could there also be a way to change the card that displays on the title screen too?
Yes.
instead of it being an ace or random locked joker?
Is there any documentation of it
No.
Oh damn
for loc_txt in your consumable type
almost, inside has_enhancement it should be other_card and also you need to check if not context.other_card.lucky_trigger then set context.other_card.no_lucky_hit = true
then you check on destroy_card if it has the flag
I know cryptid does it but idk where it's located
stop trying to loop over G.playing_cards
Also the for loop in context.individual is not needed
oh yeah that also
both context.individual and context.destroy_card is already called for every card
Cryptid does a bunch of weird shit.
-# I wouldn't suggest using cryptid as a reference
-# still, I don't know how to modify already existing menus and shit, so uh... yeah
use JoyousSpring as reference
that's alright no worries
(just because i want people to play it)
like this?
like this?
why is card red
what did i do oh god
remove the not in destroy_card and it should work
I need to add my own 'card' (not a card, but just a sprite one can move around like a card) for the title screen.
when you call SMODS.calculate_context { chudhit = true } that is all the information available in that context
i do add a card to the title screen
you're already calling your context when the consumable is used so
you don't need the other stuff
sorry i misread, you also need to change other_card to destroy_card in the second if condition
someone needs to do a tutorial on contexts
also you want to remove the not before your flag check
this one?
oh i dont need the center key either actually
since its in the joker
oh i dont even need the for loop at all ok
its okay. like this?
Isn't there one in like, the SMODS wiki thing?
you don't need the enhancement check here since you're already marking only lucky cards in the first place, you need to change context.other_card.no_lucky_hit for context.destroy_card.no_lucky_hit
uhhh is pseudoseed broken or am I just remarkably unlucky?
no, that's more documentation
I want someone to do like a video going step by step on what a context means rather than what the context are specifically
stay out of a casino
(ironic)
in 600 calls, I hit less than 0.4 23 times
aren't you supposed to be using pseudorandom

idk, I just see contexts as when the fuck something happens when playing a run.
bam(?)
i mean you're right
but a lot of people don't even understand that lol
contexts are just events, people need a tutorial on events
that looks fine, are there any issues?
oh that's a lot better
wanted to make sure i did it right first before the test (i have an i3)
tbh I don't understand half of the shit that is in a context.
understandable, it all looks fine to me
test time 
how can i make this joker talk like jimbo once pressed with custom text n stuff?
poker_hands = poker_hands fuck does that mean under most of the contexts?!
how can i know if hand contains a straight?
it's a list of lists of all the hands that make up the hand you played, so it will have all combinations of full house, pair, and three of a kind if you play full house for example
if next(context.poker_hands['Straight'])?
like that ^
well i have that but it wont work
ah, i see...
-# clueless dumbass
ok
anyone know?
not working yet
You need to put a context check when returning mult.
which one?
Replace not (context.before or context.after)
ok good news and bad news
good: THE GAIN TRIGGERS 
BAD: it does it twice
(i forgot to hit shift)
like with what
context.joker_main
i got a var i wanna use in my SMODS.back but not sure how tho , do i do context.other_Card.ability.extra.numberOfDestroyedCards?
uhhh, you don't happen to have a blueprint next to your joker do you
it was by itself
how can i know if when doing joker main the poker hand isnt a straight?
Do you still have the old code in the hook
i tried to use locals
if not next(context.poker_hands['Straight'])?
nvm
Anyone know?
not sure, could you send updated screenshots of your current code
Let me walk my dog rq anf I’ve got you
woof
yes!
I hope the character makes noises
😭
it just crashes the game
damn
back.ability.extra.....
OH
welp
do i ignore it
i guess it doesnt like that
How do I include more jokers in one mod? And make one create another one after an amount of rounds?
yeah that was it! thank you
You do SMODS.Joker again.
Like it has a different art
is this good UI chat
You would put that on the atlas and use a different position?
As someone else said, I sure hope it has funny audio for text.
also, just noticed the next button.
I may be blind, chat.
Actually, almost.
took me a hot 10 seconds to notice the next button. Perhaps make the text box smaller or put the next button inside the textbox?
goes hard but why does the next button look like a tab selection
honestly idk why it could be triggering twice
lowkey might keep it due to the unlikeliness of it happening
actually yeah no ill keep it
but it works thank you!!
I putted it in a different file
is that definitely the only place you call calc_context(chudhit = true)?
I think the next button should be inside the box, I missed it until it was pointed out on the first image
Literally me.
i mean
Basically give the button a background
Honestly it looks better when it's below the box
or pan it to the left
it should just have some kind of background to make it more visible with the buttons in the background
I wonder how weird the drawing thing looks without the smooth font.
"drawing thing"
why are you so mean towards the drawing 😭
How do I call it?
do we fw the custom presence
Strange green and white being found on the right side of the screen?!
oughhhh vertex shaders giving me a headache.......
i literally cannot find anything about how to make booster packs other than the SMODS page which is not really helpful im ngl do any of yall have like a template or smth
I've figured out how to get this to work, but only for textures whose drawn size is the exact same size as the full atlas
"Nothing"
The 200 xmult just sitting there:
would we say 2x mult is common or uncommon
Shhh its invisible
id lean towards uncommon tbh
Any further context, or just x2 mult, no strings attached.
awesome
Wow, now my blind eyes can actually notice the next button!
2x base
how can i add 10 playable cards at the end of an ante?
Again, how off does the individual on the right look when the font is not super ultra HD?
elaborate
Like, a joker that adds 10 cards to your deck at end of round?
im making a joker that adds 10 playable cards in your deck at the end of an ante
it's a gag joker
at the end of an ante
Try looking at Certificate
You uh... want to probably read about SMODS.add_card(t)
then idk
ok
yummers
how do i check if its a new ante? like after the ante boss it gives the cards
if context.end_of_round and context.main_eval and G.GAME.blind.boss
alright thank you
how can i make the card have the lucky enhancement?
that sound effect
that's from Entropy
kill murder, destroy, obliterate, desintegrate, turn into ashes
I don't know, try changing c_base for m_lucky
uh why does the card just remain there
you're emplacing it in G.discard
can i something like
"If X suit trigger something once, Y suit trigger something twice"?
it's your friend now
No, you would have to patch/take ownership I think.
oh god
yippie
oops , also how can i add 10 of them not just 1
Put it in a loop that goes 10 times.
wdym
i changed it to G.deck but it still remains at the bottom no matter what
uhh maybe it's one of the other arguments that's messing it up
I'm pretty sure they have a suit that is just 2 suits combined and they want it to trigger twice for jokers that check for the original suit.
i dont remember what they were right now, check the code for one of the spectrals
yeah that sounds hard
like
greed joker gives +3 mult for diamonds
it would give +6 mult for fortune (custom suit)
probably not but maybe you can do something silly by hooking is_suit
this is not me telling you to ask me what that is tho
this joker works mostly as expected, however if the first effect triggeres the second one won't(tested with oops all 6s). for example, if the first effect doesn't trigger, it's still possible for the second one to trigger. but if the first one triggers, even if both are guaranteed, the second effect won't activate.
when you return the function ends there
ah ok
well fuck idk which one either
so how do I make it like lucky card where both can trigger
create a local variable before the first if that's just a table
then add stuff to the table in the ifs
then return that after both ifs
awesome
idk i hate that function
would using a ret variable work with Xchips?
this is stupid
im waiting on this
https://github.com/Steamodded/smods/pull/720
and how would i have that return both messages
return {
message = "msg1",
chips = value,
extra = {
message = "msg2",
xchips = value2
}
}
as in like using the ret variable
extra = ret
alr
so if neither trigger the message won't display?
it depends on how you set it up
erm
tried my best but doesnt seem i could fix it
this is how i would do it actually
if pseudorandom < chance1 then --pseudocode obviously
return {
message = "msg1",
chips = value,
extra = pseudorandom < chance2 and {
message = "msg2",
xchips = value2
} or nil
}
that makes chance 2 dependant on chance1
oh are they independent
yeah
maybe don't initialize ret as a table and just leave it as nil
then in the first chance you can set it to a table, in the 2nd one you check if it's not nil then add extra otherwhise just set it
if pseudorandom < chance1 then --pseudocode obviously
return {
message = "msg1",
chips = value,
extra = pseudorandom < chance2 and {
message = "msg2",
xchips = value2
} or nil
}
elseif pseudorandom < chance2 then
return {
message = "msg2",
xchips = value2
}
end
easy
that works too
Okay so how would you check if a specific joker was sold?
if context.selling_card and context.card.config.center.key == "j_modprefix_key"?
Anyone know how to fix this?
apparently something is wrong with this
the idea looks correct but there seem to be syntax errors
that's what i was trying to ask about
tht is the whole function
*that
the bottom part is not needed rn
i just have to copy this and put it there
nvm i see
Thank you
Why the 2nd joker dosen't appear?
You can't have 2 jokers with the same key.
Got it
Anyone know why my card are significantly darker in game version the original image? (Dont ask why its fries)
decided to take a break from art and impement the wips, WoF is close to done for reference on the final product
-# deck is called Tarot of the Holy Spectrum and was made by Chase Voorhees, i like the deck a lot so am balatroing
How do I make a joker create a specific one after an ammount of rounds?
For example make the first one create the second one after an ammount of rounds
I am trying to have this joker view every current joker in possession and keep count of how many are uncommon but I get an error saying that joker_card is a nil value.
this might help #💻・modding-dev message
#G.jokers.cards... yet you use G.joker_cards?
Also, instead of self.config, card.ability.
No way to set that in without thinking that's wrong or thinking about the placement
Also I'm pretty sure G.jokers.cards is always a table, no need to check for its type
🧠
forgot to ask earlier but with how i did the joker (hitting a probability successfully triggers an xmult gain) any possible future crossmods would have to use my context check with their probabilities right? asking so i can like leave a comment on the readme later
yes
mhmmmmmmmmmmmm
Is this right for end of round effects? I wanted to make it so it creates a specific joker after a certain ammount of rounds
if you have red underlined text you have syntax errors
also for end of round effects you want context.end_of_round and context.main_eval as your condition
and idk what you're inventing with that last return statement
Looking in the documentation
no what I mean is that the variable context contains those things inside it
i recommend looking at these
https://github.com/nh6574/VanillaRemade/blob/main/src/jokers.lua
How would I change this so the joker starts with perishable?
G.E_MANAGER:add_event(Event({
func = function()
local card = SMODS.create_card({
set = 'Joker',
area = G.jokers,
key = 'j_dna',
})
card:add_to_deck()
G.jokers:emplace(card)
return true
end
}))
Add a perishable compat?
Not sure if you need additional code tho, never tried it
Looking at existing perishable jokers might help
This is a deck, I want this to start you off with a perishable dna.
Mmh... Dunno enough about perishable things to comment, apologies
I'm guessing it's just another parameter I need to add, not sure what it might be though.
Does this work?
Yep, that works!
anyone know why this blind crashes the game when i try to redeem the cash prize?
Are there any vanilla examples of jokers that add editions to playing cards? Trying to make a joker that adds editions to all cards played
only similar example in vanilla is midas mask pretty sure, but that does enhancement
tried that and its still there
if anyone knows how to fix this issue , would be appreciated
Try adding those before the emplace
_card:add_to_deck()
G.deck.config.card_limit = G.deck.config.card_limit + 1
table.insert(G.playing_cards, _card)
Why is there a comma after the rounded closing parentheses
so my joker wasnt working as intended so i switched the context to this but stay_flipped apparently also activates when cards are returned to the deck
good question
oh weird, it shouldn't
and it also works when drawing cards from deck
i just had a series of events that ill write out here bc its not that long
joker gives +12 mult each time context.stay_flipped is called in current state
start blind > +96 mult (12x 8 cards drawn) > discard 5, draw 5 in return > +216 (120 added, 12x 10 cards (5 to deck, 5 to hand))
which i guess is technically adding mult each time a card is flipped to stay in a state of face down or face up (which means that boss blinds that draw cards face down just... wouldn't add mult?)
How do I make that a Joker gives mult/triggers when a specific rank and suit scores?
i mean yeah that one is intended, the blinds keep cards flipped when drawing from deck
does smods have a context for when a card is drawn face-down
I suppose that the highiest rank is ace and second to it is king
no, you can probably use hand_drawn and check each card drawn
14 is ace 13 is king 12 is queen etc
Thx
like if context.hand_drawn then local face_down = 0 and iterate through the drawn hand for cards that are face down (which i also do not know how to do)?
yes
How do I make it so it creates a joker and destroys itself after a certain amount of rounds?
(not indenting here because discord wont let me use tab on mobile) would this work
local face_down = 0
for k, v in pairs(G.hand_drawn) do
if v:face_down(dunno if this is right) then
face_down = face_down + 1
end
end```
?
Like the Space Ace joker i made creates a joker then destroys itself
Like a perishable joker, or?
if context.hand_drawn then
local face_down = 0
for k, v in pairs(context.hand_drawn) do
if v.facing == "back" then
face_down = face_down + 1
end
end
end
Nope, like
Creates joker
Destroys itself, not debuffing
and i can add my mult gain between the last two ends?
yeah
Ah, could look into SMODS.add_card() for creating cards, and card:start_dissolve() for removing cards.
Like this is fine?
Keep it in the calculate function, not loc_vars. loc_vars is for the tooltip and card description when hovered, not the card's calculating code.
You're using SMODS.create_card(), not SMODS.add_card().
card works as intended now (was even able to get my upgrade message to return in an additional if face_down >=1 then statement), thank you
Does anyone know where to find the documentation for the code!?
Anyone know how to make this so it copies the consumable that was just used rather than the previous one? (Currently its using the fool's code)
key = 'duplicator',
loc_txt = {
name = 'Duplicator',
text = {
'{C:green}1/4{} Chance to Duplicate',
'{C:attention}Consumables{} on use'
},
},
atlas = 'Jokers',
rarity = 1,
cost = 2,
unlocked = true,
discovered = true,
blueprint_compat = false,
eternal_compat = false,
perishable_compat = false,
pos = {x = 12, y = 0},
calculate = function(self,card,context)
if context.using_consumeable and math.random(1,4) > 0 then
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
play_sound('timpani')
local card = create_card('Tarot_Planet', G.consumeables, nil, nil, nil, nil, G.GAME.current_tarot_planet, 'fool')
card:add_to_deck()
G.consumeables:emplace(card)
return true end }))
delay(0.6)
end
end
}```
Now you have two separate calculate functions, and the contexts are confusing. Imma just go back to modding Axy's own stuff, this is a lot. ^^;
Ok, thx for the help
If you're trying to add a joker and remove the joker that added it you could just do this
return {
G.jokers:remove_card(card),
card:remove(),
card = nil,
SMODS.add_card {
key = 'j_[modprefix]_[jokerkey]'
}
}
Man im sure tired
And I still have to know how to trigger after 3 rounds
if context.individual and context.cardarea == G.play then
return {
message = {
"Fusion Queen!",
"Evolution King"
},
message_card = card,
G.jokers:remove_card(card),
card:remove(),
card = nil,
SMODS.add_card {
key = 'j_sab_spade_king'
}
}
end
assuming i did it all right this should be what you would be looking for
Your calculate function seems to end with a '}' when it should end with just 'end'
assuming thats what the problem is
The best way to go about that is to do what the invisible joker does but just make it wait to 3 rather than 2
whats the repo with the vanilla joker recreations again
And changing the chosen_joker with my jokers key?
I'd better go rest, an entire day modding wears me out
I read that custom saved from death messages were added to SMODS but i don't see anything that says how
Okay i was right, just set saved to a string
Yes, but that string has to link to something in the localization.
What is the difference between (not _c) and G.C.RED or G.C.GREEN and _c and G.C.GREEN or G.C.RED?
hi i wanted to make a pair of jokers that work similarly to gros michel and cavendish but when i looked at their code all i could find is this (G.GAME.pool_flags.gros_michel_extinct = true) is this what makes one dissappear from the pool and add the other? and if so how would i make my own? i dont fully understand it
i didnt know that existed, thanks!
VanillaRemade is your friend 
another lost soul led to the light,,, i did good 
LMFAO
LMAO

heh,,,,,, i have,,,, nothing 
How would I go about finding the key of the currently used consumable (in context.consumeable)
context.consumeable.config.center.key
thank u :3
Mhm!
is the context for entering a boss blind just context.setting_boss_blind?
Not that specific, but there is a context.blind attribute when context.setting_blind is true that you can check
