#💻・modding-dev
1 messages · Page 478 of 1
Is it possible to reroll the 1 in 4 destruction chance of a glass card? trying to make a joker that gains mult every time a glass card scores and loses all of it when a glass card shatters
Why would you need to reroll the chance for that?
A joker that retriggers glass cards
I have a load of stuff that I need to port into smods that allows for custom small/big blinds and the option to have boss blinds as either of the first two options, I just haven’t got round to it yet.
What are the pool and left percentages referencing?
Pool is total amounf of jokers with this rarity, left is pool size minus locked, jokers you have, and optionally jokers in shop slots
Percentages is for one specific card
Like pribability to find blueprint, or dna
Also it checks for showman or SMODS.showman
Not sure which center I should use to repsresent this tab
Hone more for editions, idk
is there a complete reference for G? im looking to hook into function to wait for action complete like G.FUNC.go_to_menu()
no
there's a PR in the smods wiki for some G documentation but not that comprehensive as far as i remember
You can use DebugPlus to check table contents - opening the console and doing eval G or eval G.FUNCS should give you a slightly overwhelming list of everything
hiya! i'm trying to fix No Joke's Talisman requirement again
code
what do i need to safeguard?
(by that, i mean what do i need to do to_big = to_big or function(x) return x end to?)
ooh? what's this :0
Change number:to_number() to to_number(number) and put to_number = to_number or function(x) return x end somewhere in the file.
salty ghost pfp update dt is so low, that's crazy
how would i get a card.ability.extra value to persist when a joker is changed using card:set_ability(G.P_CENTERS["j..."])?
You would hook card:set_ability.
Also done, yayyy
Bump
I also still need help with this, but I'll be out as I'm in a different time zone. Please @ me if you know the answer
is there a way to run function direcly from debugPlus prompt?
eval function()
gughuugh why is it stuck at 10
yeah sorry, i was calling them with wrong args
trying to make a joker that gives Xmult depending on the number of gros michels you have, just looking for tips on how to do this as i literally started learning how to create mods yesterday. I looking for the specific code make this work as the only thing ive tried doing is looking for the abstract joker code and tweaking it so that it only counts it as gros michels rather than all jokers
couldnt find it
you probably want the math logic to be in update and not in calculate
ooh right
good catch
ngl i had a feeling that was the issue but i couldnt remember the function name
if context.joker_main then
return { xmult = 1 + #SMODS.find_card("j_gros_michel") * value }
end
nice, thanks
I am now having problems with trying to get this to actually work. I'm not entirely sure what I need to do in order to make it apply said xmult but whenever I try to play a hand it crashse the game. Ill attach the code for the joker and the error message if you can try and make sense of this mess
that's because my code is also broken 🥲 I'd added that a few days ago and not tested it yet. It should be G.STATE ~= G.STATES.HAND_PLAYED
It's straight up my most made mistake, haha
you were supposed to replace value with whatever the value per gros michel was
I think I consistently do a no x == x and then run broken code before I realize it should've been x ~= x
also this won't gain like the description says
just as yourself if the thing you are noting is a boolean every time you add a not
this will give xmult on joker timing
oh uh how do i make a joker completley not show up in shops or packs
make it legendary?
no clue then
return false in in_pool
thank you
i may sound stupid for saying this but i have no clue what you mean by this
the joker timing thing i mean
this will give xmult for every gros michel you have when jokers score, it wont increase the xmult like it says in the description
ok, that's what i intend it to do but i haven't actually set anything up to check how many gros michels are in your jokers
#SMODS.find_card("j_gros_michel") is what does it
oh wait im stupid i just need to change value to 1
ok ill test it now and if it works then i am indeed stupid for not realising this
card:set_ability("j_modprefix_key")
oh is it really that simple
yeah
okay well, thank you!
ok so there was a small area of code i needed to remove to stop it from crashing at the end of a hand but overall it now works. I can't thank you enough @red flower for putting up with my insane stupidity
im always here to help
is this correct?
no P_CENTERS
ah yeah.. that makes more sense, Thank you!
might need a little assistance trying to get the card to display the current mult it is at in the card description
whats the debugplus keybind for winning an blind so i can test this
its not in the keys.txt in the mod repo
but i heard someone talk about it being a thing
i dont think there one
you can press tab and press the button
you need to put the same thing in loc_vars you do in the calculate return (1 + amount of gros michel)
ah
spam bot
i did that and it crashed the game when the joker appeared on screen
i may have done it wrong
oh huh this isnt working, i want it to downgrade immedietly after scoring of the bad hand
full code for context
nvm i just played the wrong hand
im stupid
it works 
whats the code and crash
WTF I SET in_pool = false WHY ARE YOU HERE
it's a function
yes
Hi chat, does anyone know how to change the font these numbers use?
wtf
oh uh i should probably make this not pluaral at 1 blind uhhhh
whats the easiest way to do that
i could just like have a var specifically for swapping between those
here
i forget is this how you do tenary if in lua
yes
ok cool
anyone?
bump 
how do i get the key of the most played poker hand in the run
do what obelisk does
so im trying to make a joker that always puts Wheel of Fortune in the shop but every time i go to the shop it sends it to the top and you cant buy it or anything
so make it nil? or something else?
no, I think the whole syntax doesnt work because tags work differently than jokers in those contexts
i dont know what that syntax would be however as i just gave up and made my jokers give tags :3
so kinda like diet cola but everytime
yeah, I just made a tag that replaces the next shop item for whatever card i give it
how do you get a table of all stakes applied in a run
so i'm trying to make evil blueprint actually work, i got some help with some of the lines that don't work except line 1207, where 'arg' returns a nil value
uhh is extra supposed to be using two equals... cause it certianly doesnt look like it
also wait you dont even have a return statement there (reffering to line 1199)
you're missing a comma after the end for calculate and befopre check_for_unlock
apparently putting return at line 1199 doesn't work and if i put the comma at line 1205 it says there's an unexpected symbol
i just want to ask... how familiar with programming in lua (and programming languages in general) are you?
i'm still learning, i've only made 2 jokers entirely with lua
I see.
You may want to familiarize yourself with programming concepts and lua more. That is my advice.
Gradient stuff isn't working, help
does anyone know this ive been looking thru other stuff for a while and i got no clue
ok wait hang on, i might have found a good place to put a return statement
I don't think anything in that screenshot is correct if I'm honest
okay yeah your probably right
works now, thanks 
at the very least it let me into a blind without crashing
i know self.GAME.stake has the current one, and i think then i checks the ones below it
try looking at SMODS.setup_stake
what are you trying to do
oh i might be stupid 🥀
i was searching through the whole workspace to find it assuming it was more difficult because i hadnt found someone who had the same question answered before
basically, i'm trying to make a evil blueprint in which it copies the joker to the left, but has a 1/5 chance of not doing anything
is that all?
yeah
let me code it
one more thing: there is a 1/10 chance to 'forgive' itself and turn into a regular blueprint
when does it check the chance
at the end of the round
ignore what i just sent too i noticed a problem :p
something like this
calculate = function(self, card, context)
if context.end_of_round and context.game_over == false and context.main_eval and pseudorandom("seed") < G.GAME.probabilities.normal / card.ability.extra.odds2 then
card:set_ability("j_blueprint")
return {
message = "Forgiven"
}
end
local other_joker = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i - 1] end
end
if other_joker and pseudorandom("seed") < G.GAME.probabilities.normal / card.ability.extra.odds then -- use store the odds in config = {extra = {}}
return {
message = "Nope!",
colour = G.C.RED
}
end
return SMODS.blueprint_effect(card, other_joker, context)
end
this will have a problem tho: it will say nope more often than it should
if context.joker_main and next(context.poker_hands[card.ability.extra.type]) then what does this code mean? i have no idea
if it's in main joker scoring timing and the poker hand contains card.ability.extra.type
context.poker_hands is a table of all the hands contained (eg context.poker_hands["Pair"] contains all possible pairs), because the tables always exist even if empty, next is used to check if theyre not empty (therefore theres a possible hand to be made)
is it possible to add a card enhancement similar to how stone card works? Only difference being that I would like to make it so that it would turn its value into king and kind of make an entirely new suit if possible.
yeah, read the SMODS.Enhancement docs
doing so
well with the code i already have, it spams nope at literally anything for no reason after fixing the message part of the code
yeah the problem is that it's hard to detect when a blueprint is going to copy another joker without triggering side effects
actually, it might be because of my code using math.random instead of psuedorandom
nah, pseudorandom will still be called that many times
also fixed the code because im dumb
anyone know what's causign this error
i've been trying to debug it for 3 days and nothing
whats the code
im not entirely sure what weighting is for cards, my best guess is that it refers to how likely it is to appear as an enhancement but im not sure
@red flower
unlocked and discovered go outside of config
are you sure that the prefix is pkrmd
fixed that
still happeninfg
what is the table that determines that draw order of playing cards
ok looked it up and its basically what i said plus a little more
yeah if the prefix is correct i have no idea
return { vars = { card.ability.extra.repetitions, localize(card.ability.extra.type, 'poker_hands' ) } }
end,
calculate = function(self, card, context)
if context.joker_main and next(context.poker_hands[card.ability.extra.type]) then
return {
repetitions = card.ability.extra.repetitions
}
end
end,
}```
G.deck.cards
what's the crash, also what's in your joker's config
ill send the crash along with the entire code
the code:
name = "The Inner Eye",
key = "innereye",
config = {
extra = {
repetitions = 1,
type = 'Three of a Kind'
}
},
loc_txt = {
['name'] = 'The Inner Eye',
['text'] = {
[1] = 'If played {C:blue}hand{} contains',
[2] = 'a {C:attention}Three of a Kind{},',
[3] = 'retrigger all {C:attention}scored{} cards'
}
},
```
x = 3,
y = 0
},
cost = 7,
rarity = 3,
blueprint_compat = true,
eternal_compat = true,
unlocked = true,
discovered = false,
atlas = 'CustomJokers',
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.repetitions, localize(card.ability.extra.type, 'poker_hands' ) } }
end,```
and draw_from_deck_to_hand is what draws the cards and that uses draw_card, but i cant tell what determines which card is drawn to hand
bro why cant i send this
if context.joker_main and next(context.poker_hands[card.ability.extra.type]) then
return {
repetitions = card.ability.extra.repetitions
}
end
end,
}```
there
entire code
now the crash
is it possible to make any card/multiple cards count as "the first card counted in scoring" so that jokers like photograph and hanging chad can act off of them?
how would you make an enhancement that sets a card to a specific rank?
it's drawn from last to first
Hook get_id and check for said enhancement.
Or hook set_ability to change rank on apply.
-# Or N's gonna provide a better solution-
i dont think so without a lot of trouble but i might be wrong
no youre very smart and awesome
didnt cryptid do that? you could look at their code
does anyone know what function shuffles the order of the cards in G.deck
oh you can't have repetitions in joker_main
did they? I have no idea. do you know what in cryptid does that off the top of your head?
uhm
isnt that all hands are first hand of round?
no but id recognize it
pseudoshuffle, it's called at end of round and when blind is selected iirc
its Labyrinth
cool, thanks
how else do i do it?
context.repetition and context.cardarea == G.play
instead of...?
yeah what labyrinth does is much easier
joker_main
ok
like this?
if context.repetition and context.cardarea == G.play and next(context.poker_hands["Three of a Kind"]) then
yes
card.base.suit
it works yay
this one says it's
"All hands are considered the
first hand of each round,
all discards are considered the
first discard of each round"
Did they change it or smth?
is this actually possible or should I give up on this?
no it always did that
oh i read it wrong
your message
oop
quick check up with my code for the evil blueprint, it works fine now although a friend of mine says that evil blueprint didn't recieve any specific context whenever something happens so it does it for literally every single context in the game
evil blueprint??
baller
cus im looking at the documentation and I cant find any part where this can be done
calculate = function(self, card, context)
if context.joker_main then
local suits = {}
for _, playing_card in ipairs(context.scoring_hand) do
if not playing_card.debuff then
local suit = card.base.suit()
if suit and not suits[suit] then
suits[suit] = true
end
end
end
local suit_count = 0
for _ in pairs(suits) do
suit_count = suit_count + 1
end
if suit_count == 2 then
return {
xmult = card.ability.extra.xmult
}
end
end
end
}
for some reason it crashes trying to index suit
im under the impression that this cannot be done because im not seeing anywhere where this can be done
i think you can only increase and decrease
that's correct, it's how blueprint works
set_ability?
Nh, help me
its alright
@red flower
card.base.suit is not a function
remove the ()
on card base suit?
ye
why it looks fine
if it aint broke, dont fix it
oh is it the loc_txt
i want to add more than just jokers, and this is an addon to the Pokermon Mod so
is there even a way to make the evil blueprint not spam the console with repetitions
ret = SMODS.blueprint_effect(...)
if ret then
return ret
end
but where do i put it within the code though?
wait hang on, there doesn't seem to be any errors when i put it after the check_for_unlock part of the code other than the 3 dots, which i assume i have to put something in there
you replace the return SMODS.blueprint for it
the ... should be replaced for what you already have inside the ()
like this then?
oh and there's still repetitions and crashes after some time trying to index a nil value again
I need help figuring out how this works
good slighty-after-noon modding dev
do you want the card to become the rank or to be treated as the rank while it has the achievement
after some tinkering i did manage to lower the amount of repetitions but it still crashes
while it has the enhancement
at least im assuming you meant enhancement
yeah lol clicked the wrong autocorrect
i think that's not very easy to do no
i wouldn't recommend it at least
please fix your indentation
alright just formatted the document, hows this
why is the check_for_unlock in the calc function
i utilized the code from the og blueprint for the evil blueprint
i forgot to add local before ret
but also it will still display the warning because of the nope message... it's a bit complicated tbh
Can you use card_eval_status_text with context.other_card as the target? trying this seems to crash my game
i already added local before ret but arg still tries to index a nil value
ok thanks, i think ill just keep my enhancement as a card that does nothing, i am planning on trying to add a joker that gives mult based on how many of that enhanced card are in the deck
can i see the crash
ohh that's the unlock i didnt notice
replace args type for args and args.type
wait, i removed the few lines relating to checking for unlocks and it actually works without crashing
but it still doesn't copy the joker to the left
maybe if i add blueprint's config line into evil blueprints?
can anyone figure out why the in game text displays for powerband bur not for goldribbon
loc_txt vs loc_text
anyone know?
even after all of that it still doesn't copy the joker to the left and i have no idea why
loc_vars = function(self, info_queue, card)
local other_joker
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i - 1] end
end
local compatible = other_joker and other_joker ~= card and other_joker.config.center.blueprint_compat
main_end = (card.area and card.area == G.jokers) and {
{
n = G.UIT.C,
nodes = {
{
n = G.UIT.C,
config = { ref_table = card, align = "m", colour = compatible and mix_colours(G.C.GREEN, G.C.JOKER_GREY, 0.8) or mix_colours(G.C.RED, G.C.JOKER_GREY, 0.8), r = 0.05, padding = 0.06 },
nodes = {
{ n = G.UIT.T, config = { text = ' ' .. localize('k_' .. (compatible and 'compatible' or 'incompatible')) .. ' ', colour = G.C.UI.TEXT_LIGHT, scale = 0.32 * 0.8 } },
}
}
}
}
} or nil
return { main_end = main_end }
end,
calculate = function(self, card, context)
local other_joker = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i - 1] end
end
if pseudorandom('seed') < G.GAME.probabilities.normal / card.ability.extra.odds then
return {
message = "Nope!",
colour = G.C.RED
}
else
local ret = SMODS.blueprint_effect(card, other_joker, context)
if ret then
return ret
end
end```
why is the blueprint effect in a ret
instead of just return SMODS.blueprint_effect(card, other_joker, context) i mean
ohhh i see
regardless the evil blueprint doesn't blueprint
at a glance, this could probably really help getting rid of the repetitions i've been getting spammed in the console
did it work or you havent tested yet
oop nevermind, it crashed trying to index blueprint as a nil value
send?
oh fuck my bad
lmao
another case of me making a typo
it's a table
you use []
why did you even change it actually it was fine before
that looks to be the only other thing though
huh
yeah it's still not doing it
pseudorandom("seed", min_number, max_number)
ohhh okay
hi nxkoo
The font 💀
unlucky asf oml
how do you make a tag
are you returning your variables
cause it doesnt look like youre returning your variables, only main_end
sorry call the tag in a joker
add_tag(Tag("tag_key"))
👋
hi dilliard
honestly today im feeling really good
Hell yea
wbu did you get your money back
Why is bro evil
I did yes!
I then immediately spent it on my first concert ticket
This mf was 518 bucks
i'm not sure actually
can you send a ss of your locvars
i almost missed dilly hi dilly
local other_joker
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i - 1] end
end
local compatible = other_joker and other_joker ~= card and other_joker.config.center.blueprint_compat
main_end = (card.area and card.area == G.jokers) and {
{
n = G.UIT.C,
nodes = {
{
n = G.UIT.C,
config = { ref_table = card, align = "m", colour = compatible and mix_colours(G.C.GREEN, G.C.JOKER_GREY, 0.8) or mix_colours(G.C.RED, G.C.JOKER_GREY, 0.8), r = 0.05, padding = 0.06 },
nodes = {
{ n = G.UIT.T, config = { text = ' ' .. localize('k_' .. (compatible and 'compatible' or 'incompatible')) .. ' ', colour = G.C.UI.TEXT_LIGHT, scale = 0.32 * 0.8 } },
}
}
}
}
} or nil
return { main_end = main_end }
end,
calculate = function(self, card, context)
local other_joker = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i - 1] end
end
if pseudorandom('seed') < G.GAME.probabilities.normal / card.ability.extra.odds then
return {
message = "Nope!",
colour = G.C.RED
}
else
local ret = SMODS.blueprint_effect(card, other_joker, context)
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i - 1] end
end
if ret then return ret end
end```
it's literally just blueprint but copies the opposide direction
you're not returning your vars
is there a way to change how much a specific card appears in the shop?
not easily no
still having trouble
have you tried tag_[your mod's prefix]_wof?
wait no sorry
tag_[your mod's prefix]_tag_wof
you dont need to add tag to the key manually
just tried and nothing showed up
can i see
currently I have a separate type of consumable to change that, but it would cause problems if I wanted to add another consumable of the same type that appears more frequently, is there another way?
honestly, i'm pretty lost as to where exactly to return the main_end vars
no because of how balatro's system works
you would have to rewrite it (i have)
code
or whatever your vars in config are
do the quotations have to blank or no
dying
this time my body feels a little better
abs are still sore from a few days ago though
hold
I will fix you and all will be well
thatd be sick
joker code
I see, thank you
it didnt crash?
would next(context.poker_hands['Royal Flush']) work to find if played hand is a royal flush?
why isn't this giving xchips? everything else works though
...
return {
message = "X" .. number_format(lenient_bignum(card.ability.extra.xchipsmult)) .. " Chips and Mult",
sound = "crp_multiplicativechipsmult",
xchips = lenient_bignum(card.ability.extra.xchipsmult),
xmult = lenient_bignum(card.ability.extra.xchipsmult),
remove_default_message = true,
colour = { 0.8, 0.45, 0.85, 1 } -- plasma deck colors
}
...
okay i'm probably gonna assume that i have to put 'hold' into the quotations, not sure though
i dont think so, it would be straight flush still
return{
main_end = main_end,
vars = {
card.ability.extra.yourvariableinconfig1,
card.ability.extra.yourvariableinconfig2,
--etc
}
}
for that iteration, no
oh okay
alright, thanks
no i was telling you to hold on lmfao
hmm weird I have no idea
i think i know whats wrong one sec
is it possible to speed up / skip the animation when entering the MAIN_MENU? I'm using this mod for speed up game play (https://github.com/Steamodded/examples/blob/master/Mods/MoreSpeeds.lua) but the MENU entering animation is still slow.
there's a new context i PR'd in next smods that allows you to check for royal flush
oh really?
what is it
context.evaluate_poker_hand and context.display_name == "Royal Flush"
https://github.com/Steamodded/smods/pull/777
Added a context for modifying a poker hand's name, display name and contained poker hands during evaluation.
You can return replace_scoring_name = key, replace_display_name = key (falls ba...
BUT this works when selecting a card too
ohh okay
no dice
so you need to check if it's being played
alright thanks
what does your locvars look like now
heres my little royal flush tracker
this ain't even a bump it's a poke
for some more clarity, here's the config of evil blueprint
maybe i missed 2 variables?
...what are those for exactly...?
the odds are the for the chances where it doesn't do anything and forgives itself respectively
the yellow underline under config here suggests you have two configs btw
so i should go put those 2 variables back into main end?
why did you take them out
honestly, i was unsure if there was a conflict between the config of the joker and the config of main end
they are two different things
main_end needs a config for the ui
joker needs a config for... well the joker
god damnit
regular blueprint doesnt need one because it doesnt have its own effect, it's just copying everyone else
Nope!
same
but how am i supposed to implement the mechanic that it has a 1/5 chance to not do anything
yeah instead of a message it just does nothing haha
so your telling me to do this right?
yeah
or even just put a not in the conditional if you dont want the ifelse? im 
but thisll work
well at the very least the 'Nope!' spam is gone
unlucky
okay this is an actual bump now
whats that joker to the left
reading now
it gives x1.5 mult for every played heart and/or club
is it yours can i see the code for it
considering it can proc multiple times i'm using that to test evil blueprint, i made that joker by the way
did you try with another joker
even with a different joker nothing happens
hmm i cant watch videos rn sadly
synopsis: nothing happened
this doesn't really help, still unsure what the issue is
actually better idea
have you tried x_chips with an underscore
yes
still didn't work
wait hold the fuck on
i swapped the code when it actually procs with og blueprint's and it actually works now?
it's like you screwed up your code somewhere or something.... /s /lh
? send code?
okay so now it works
oml
i probably just didn't save the file accidentally when i tested it like 10 mins ago
yeah that'll do it
-# Damn, so the probability change kinda broke Virtual PC's chance check... to the point that game hard crashes due to an infinite loop.
is it because it checks every context?
is it out 
INFO - [G] 1 table: 0x3aec3340 main_eval: true
buying_card: true
cardarea: table
card: table
INFO - [G] 1 table: 0x3aec3340 main_eval: true
mod_probability: true
denominator: 15
cardarea: table
numerator: 1
...
The 2nd one repeats on and on until game bails.
looking at SMODS code mod_probability and fix_probability are just banned from retriggers
so you could probably do the same
I'd assume copying is also not allowed... 'cause Virtual PC's trying to copy anything besides being copied.
please..... someone.... why does the face card xmult gain trigger twice.... do i have to do the squareroot trick again or can it be fixed
okay wait hang on
the joker i was testing evil blueprint with doesn't work with og blueprint for some reason
Changing the overall condition to if context and not (context.mod_probability or context.fix_probability) then did fix the crash... but there's definitely a noticable stutter.
is it blueprint incompatible
yeah it is
can
can i see the joker
oh my god
tin im going to get you
christ. 😂
oh my goodness gracious
i'm such an idiot
it happens
ah yeah i always forget about quantum enhancements because i dont use optional features lol
how would i do the effect of this return table in the event?
SMODS.calculate_effect([table here], card)
calculate_effect iirc
example with one of mine
calculate_effect does everything a return table does except sometimes not
except when it doesnt
but i recommend it for messages
same
That's better... and no hiccups when hovered over.
INFO - [G] 1 table: 0x1e79bfa0 main_eval: true
buying_card: true
cardarea: table
card: table
INFO - [G] 2 table: 0x1e7a6f60 main_eval: true
buying_card: true
cardarea: table
card: table
INFO - [G] 3 table: 0x1e7b2518 main_eval: true
buying_card: true
cardarea: table
card: table
INFO - [G] nil
INFO - [G] 4 table: 0x1e7bdae8 main_eval: true
card: table
buying_card: true
cardarea: table
INFO - [G] 5 table: 0x1e7c90b8 main_eval: true
card: table
buying_card: true
cardarea: table
INFO - [G] 6 table: 0x1d838458 main_eval: true
card: table
buying_card: true
cardarea: table
INFO - [G] 1 table: 0x1e79bfa0 buying_card: true
card: table
buying_self: true
INFO - [G] 2 table: 0x1e7a6f60 buying_card: true
card: table
buying_self: true
INFO - [G] 3 table: 0x1e7b2518 buying_card: true
card: table
buying_self: true
INFO - [G] 4 table: 0x1e7bdae8 buying_card: true
card: table
buying_self: true
INFO - [G] 5 table: 0x1e7c90b8 buying_card: true
card: table
buying_self: true
INFO - [G] 6 table: 0x1d838458 buying_card: true
card: table
buying_self: true
Mine? Still testing locally... and, as this works, that's done... just that I'd also want to clean up the effect merging as it was made before the merge function was added.
ohhh i thought this was the smods probability thing they were working on nvm nvm
still in dev
release this week probably according to eremel
then i have time
Yeah, had to change to if context and not (context.mod_probability or context.fix_probability or context.check_enhancement or context.no_blueprint) then being the main check.
i see i see
-# Though I may need to invert for context.no_blueprint, oops.
i will save this because i know we will get many questions about this haha
oh my god it's finally does it's job!
now i gotta check if the forgive mechanic it has works
is there a way to do a counter loop in reverse? e.g 14 to 1. its not liking for i = 1, 14 do
local j = 14 - i
for i = 14, 1, -1

i like how the answer was just "go down"
this goes from 13 to 0, fired
doing the square root trick because it works
but this time it didnt work so i updated the not list a teeny bit
i dont understand what youre doing but if it works it works
it's the same issue as chud if you remember
xmult gain triggering twice
I'll need to figure out the merge function.
i made it so if you have any questions
oh my god it's john... mergefunction?
they call me that yes
nice
Eventually, currently outside.
why did
i cant watch videos anyway
i didnt even mean for that one to be a ping
But I just need to merge effects of all Jokers - Virtual PC copies every compatible Joker, after all.
rude
wait were kinda twinning
why does my vs hate this?
you cant declare and assign at the same time
where is cards being declared
or whatever the words are
how is vs supposed to know that it even exists if you dont declare it
(example: ranks in the same image)
so have a local cards above the loop?
local cards = {}
ty ty!
thank god for me also playing with cryptid to guarantee chances
now i know that the forgiven mechanic works
it detects properly, but the info_queue boxes dont load anything
whats v
the joker's key in the table
also im about to get out of work so i might take a bit to respond
try G.P_CENTERS[v]
got it
hell yeah thanks
why does stencil's info_queue return a Currently Xnil?
thinking it's probably because of the joker not having its detection setup, just the effect
no idea why giving him marble joker effect makes it give 2 stone cards though
okay what the hell did i do
G.jokers doesn't always exist.
but it happened while i was in the main menu though
Yes.
G.jokers doesn't exist then.
so i should rename it then so that it can function in the main menu?
Check for G.jokers existing first.
and i assume i have to add a if statement before the for line relating to G.jokers existing right?
If G.jokers exists, do stuff.
i'm not sure if this would work or not
minus the fact that i fucking made a typo again
loc_vars = function(self, info_queue, card)
if G.jokers then
-- do stuff here.
end
end
For @red flower later, https://github.com/TheOneGoofAli/TOGAPackBalatro/blob/9c3845178857ec8545bbaa049372902302acccb3/items/joker.lua#L312-L349 for cleaner merging question.
A personal timewaster project that is a mod for Balatro. - TheOneGoofAli/TOGAPackBalatro
alright it works now, thank you!
vanilla bug
oh ok
is that also why it doesnt detect slots on the actual mult trigger, or is that something im supposed to add to the ijiraq myself?
as in it always gives x1
uhh no idea sorry i dont touch vanilla jokers
yeah but like
say i have a for loop with this table, if i wanted to start at a random element then go in order e.g. Clubs, Diamonds, Spades, Hearts how could i do that with the wrapping aroud... if that makes any sense...
if not suits[#suits+1] then var = suits[1] end
@red flower, noted the pinging message?
yeah but ill read the code when im home
👍 Ping whenever.
i have this idea for a joker right
add xmult equal to half of the lowest played cards rank
but then do i even put anything in config?
config can be empty
wouldn't this be
if not suits[#suits] then var = suits[1] end
it's about passing variables into the description and what not
also info queues
im really bad at this
which is the bonus window when hovering over something
everyone starts somewhere
why does this crash happen and how can i fix it?
SMODS.Stake {
key = "stencil",
applied_stakes = { "cry_square" },
atlas = "crp_stake",
pos = { x = 2, y = 0 },
shiny = true,
colour = HEX("bccacc"),
modifiers = function()
G.jokers.config.card_limit = G.jokers.config.card.limit - 1
end,
crp_credits = {
idea = { "Unknown" },
art = { "Grahkon" },
code = { "wilfredlam0418", "Glitchkat10" }
}
}
Try putting it in an event.
like this?
...
modifiers = function()
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function()
G.jokers.config.card_limit = G.jokers.config.card.limit - 1
end
}))
end,
...
nope 😭
what should i put in loc_vars 😭
Remove the trigger and delay and put if not G.jokers then return false end
you don't have to put anything there if you don't have variables in description (for example #1#) or info windows like talisman
is that what loc_vars is for?
yes
oh yeah i guess so
you can have no loc_vars if your description doesn't change at all
Probably
raised fist but for G.play instead of G.hand
:3
it's initializing two variables at the same time
i usually dont do it like that but i copied it from vanilla
yeah i would cooy the same thing and then divide it by half instead of multiplying it
but also copy temp_Mult
15 is higher than any rank in vanilla so it's just initializing them to a high value
or make it like idk temp_xmult
the name doesn't matter there
oh ok
only the return at the end
whar?
oh yeah i wasnt there yet
do i have to replace every instance of g.hand with g.play?
oh no
SMODS.Stake {
key = "stencil",
applied_stakes = { "crp_square" },
atlas = "crp_stake",
pos = { x = 2, y = 0 },
shiny = true,
colour = HEX("bccacc"),
modifiers = function()
G.E_MANAGER:add_event(Event({
func = function()
if not G.jokers then
return false
end
G.jokers.config.card_limit = G.jokers.config.card_limit - 1
end
}))
end,
crp_credits = {
idea = { "Unknown" },
art = { "Grahkon" },
code = { "wilfredlam0418" }
}
}
we are not recovering
You need to return true at the end.
ah okay
For some reason I get this error at the end of round when my health goes down (thanks to joker in third screenshot)
Though when I change my health manually (via the console) it works fine, so I'm not sure what is happening here
okay it almost works
if not all played cards score, it does nothing
does g.score exist?
okay my last issue is that the stake that stencil stake applies also tries to apply ascendant stake from cryptid, but it just doesn't
SMODS.Stake {
key = "square",
applied_stakes = { "cry_ascendant" },
atlas = "crp_stake",
pos = { x = 0, y = 0 },
shiny = true,
modifiers = function()
G.E_MANAGER:add_event(Event({
func = function()
if not G.hand then
return false
end
G.hand.config.highlighted_limit = G.hand.config.highlighted_limit - 1
return true
end
}))
end,
crp_credits = {
idea = { "Unknown" },
code = { "wilfredlam0418" }
}
}
(it applying ascendant stake in specific is placeholder rn btw; i wouldn't be THAT horrible)
context.scoring_hand
so replace g.play with that?
yes except the context.cardarea if you have that
where is the ancient joker suit value stored?
G.GAME.current_round.ancient_card.suit
if im not mistaken
im looking at vremade so maybe i changed the name
i need help again, my joker doesn't trigger it should randomly give between 1 and 20 $
SMODS.Joker{
key = "yoz",
loc_txt = {
name = "{C:diamonds}Y{C:attention}o{C:money}z{C:white}a{C:legendary}r{C:legendary}i{C:purple}e",
text = {
"Gives randomly between {C:money}1-20$",
}
},
atlas = "CO",
soul_pos = {x = 0, y = 1},
rarity = 4,
pos = { x = 0, y = 0},
cost = 20,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
config = { extra = { max = 20, min = 1 } },
loc_vars = function(self, info_queue, card)
local r_mults = {}
for i = card.ability.extra.min, card.ability.extra.max do
r_mults[#r_mults + 1] = tostring(i)
end
calculate = function(self, card, context)
if context.joker_main then
return {
money_gain = pseudorandom(card.ability.extra.min, card.ability.extra.max)
}
end
end
end
}```
you are a fucking livesaver
god bless you man
i could NOT do this by myself
N' the goat frl
i dont think money_gain is a thing, replace it with dollars
also pseudorandom needs a seed as the first argument
spongebob me boy
yeah, thanks
it doesn't triggers still and doens't give money
i done it like mail-in rebate but instead of discard when hand played
if context.joker_main and not context.blueprint then
G.GAME.dollar_buffer = (G.GAME.dollar_buffer or 0) + card.ability.extra.dollars
return {
dollars = card.ability.extra.dollars,
func = function() -- This is for timing purposes, it runs after the dollar manipulation
G.E_MANAGER:add_event(Event({
func = function()
G.GAME.dollar_buffer = 0
return true
end
}))
end
}
end
Is this in a joker?
yeah
bulgump
Show the full code.
SMODS.Joker{
key = "yoz",
loc_txt = {
name = "{C:diamonds}Y{C:attention}o{C:money}z{C:white}a{C:legendary}r{C:legendary}i{C:purple}e",
text = {
"Gives randomly between {C:money}1-20$",
}
},
atlas = "CO",
soul_pos = {x = 0, y = 1},
rarity = 4,
pos = { x = 0, y = 0},
cost = 20,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
config = { extra = { max = 20, min = 1 } },
loc_vars = function(self, info_queue, card)
local r_mults = {}
for i = card.ability.extra.min, card.ability.extra.max do
r_mults[#r_mults + 1] = tostring(i)
end
calculate = function(self, card, context)
if context.joker_main then
return {
dollars = pseudorandom('moneymeboy', card.ability.extra.min, card.ability.extra.max)
}
end
end
end
}```
your loc_vars is missing an end
also i think you have one too many ends at the end
is there any mod similar to talisman that is capable to go past naneinf?
i don't believe so, why?
i'd like to have a way to go past naneinf without talisman (=my mod's incompatible with it)
-# why is your mod incompatible with talisman in the first place
it woorks now, idk why i always get f#cked by thses kind of errors
(no clue)
something like this
I don't know if you need all the repetition stuff but I left it there just in case
nice
i think those two errors actually coincided in such a way to just barely not crash
either one on its own would have
No.
- lua extension wasn't marking it not even in yellow so ...
most likely reason is because your mod doesnt account for talisman bignum tables
if you get an error along the lines of "attempt to compare number with table" this is why and its quite fixable
Repetition is for also copying added repetitions-- even then, I kinda am referencing it incorrectly with card.ability.extra 😂.
is there a draw version of context.discard or is that drawing_cards
context.hand_drawn
see but that's the hand
drawing_cards is before drawing
discard is per card
oh, no there isnt
how would i make it compatible then?
guess ill have to make it myself hhh
Yes, because the game thought you were trying to put calculate in loc_vars
do you need it to be per card
yes
why
because it's counting per card drawn
how do i change the played hand by a custom amount of levels instead of just putting level_up = true in my return table to get 1 level
you can do it in hand_drawn too
what
level_up = number
oh
context.hand_drawn is a list of the cards drawn, if you want a message for each you can even do a chain of extra tables in the return
wait you can do that
if thats the issue youre running into then you can use talisman's to_number() function
talisman changes some internal values to be special tables instead of normal nubers so the function converts them into numbers you can work with
so for any variable that is causing a crash because its attempting to compare with table or something similar wrap it in a to_number() and it should work
also make sure to put to_number = to_number or function(x) return x end in your code to make it work without talisman too
whoops forgot to send as reply
No, you use to_big()
so if i wanted to do a reverse yorick and have a counter increment with each card drawn how would that work
to_big() turns it into a talisman bignum doesnt it
which isnt useful here
counter = counter + #context.hand_drawn
So do I just remove the whole context.repetition block, now that merge_effects is used instead?
oh awesome
Yes.
if youre trying to get a number value to perform arithmetic or comparisons you wouldnt want a bignum table though wouldnt you
You want to turn the normal numbers into talisman's bignum, because if you do the opposite you can mess up with the bignums or do wrong calculations when the numbers are big enough
No.
I would
huh i had no idea
i thought bignum was like a table which you cant do stuff with
what does to_number() do then
person []s somebody
"hey i'm walkin' here!"
-# (the word is bump)
It turns Talisman bignums into numbers.
Talisman uses Lua's Metatable functionality so that you can perform arithmetic on the BigNum tables. The issue is that even though number + BigNum works, number > BigNum just doesn't. I think it's just a Lua issue.
it turns them into a normal number so what you said does work
the problem is if you for example want to see if the score is less than 2000
1e309 (bignum) < 2000 (normal) if you do to_big it works correctly because 2000 is a valid bignum, if you do to_number it doesn't because 1e309 is not a valid number (I don't think it will crash but it will lead to unintended side effects)
ooooh
i see now
i though theyd both have to be numbers but both bignum works too okay
that makes more sense
totally forgot what the number limit was im not a real balatrohead
how do I transform one card into another card? Like I want to have a reroll mechanic for cards, but as of right now all it does is add cards into the cardarea I'm rerolling, rather than "changing" the card
card:set_ability("the other key")
ok I'll try that
I got it to work with add_card() since before it was just the shop, I needed to delete the cards anyway
But now I wanna do it with G.jokers so I can't delete the cards
yeah that should work
alright sick
last bump for now until i ditch this
question:
is it posible to make a joker that gives xmult the value of the numbers of e's in final score?
actually i would also like to know
uhh
you can just make a joker that does nothing
because that would be incredibly redundant
hey thats ^^^mult not xmult
😭
yeah but also like same question
i dont know the answer
thats just what i wanted to know because if its possible for ^^^Mult it would also be able for xmult
theres a nice fancy mathematical way to do it that doesnt involve the actual displayed score
but idk it
ask one of the math freaks around here
theyre not freaks
theyre freaky about math
im no freak
nope i insist
ts full house 🥀 💔
was that chocolate milk
i keep forgetting
Something something store the score in variable, then repeatedly divide by 10 and increase an another temporary variable that will technically hold the e... then subtract minimum amount of es that the game will display. 🤔
alright might ask again in a few days then
bump
tested it, it kinda works but the problem is that the hand played has the count updated before it reaches your code
you might want to do a - 1
how so?
else you would need to play all hands once before any hand counts as the least played
no idea then, i did remove all the emult stuff
as you can see i have played two high cards
so i will now play a pair
it just doesnt upgrade
lemme change it up a lil and try smth
ok i tried doing context.before and it still didn't work
can i see how the code looks now
calculate = function(self, card, context)
if context.before and context.cardarea == G.play then
local current_played = G.GAME.hands[context.scoring_name].played or 0
return {
message = current_played,
colour = G.C.DARK_EDITION,
}
-- if (function()
-- local current_played = G.GAME.hands[context.scoring_name].played or 0
-- for handname, values in pairs(G.GAME.hands) do
-- if handname ~= context.scoring_name and values.played < current_played and values.visible then
-- return false
-- end
-- end
-- return true
-- end)() then
-- card.ability.extra.emult = card.ability.extra.emult + card.ability.extra.gain
-- return {
-- message = localize('k_upgrade_ex'),
-- colour = G.C.DARK_EDITION,
-- }
-- end
end
if context.joker_main then
return {
remove_default_message = true,
message = localize({type = "variable", key = "a_emult", vars = {card.ability.extra.emult}}),
colour = G.C.DARK_EDITION,
mult = (mult ^ card.ability.extra.emult) - mult
}
end
end
i changed it to the current_played thing just to test
and it's not even showing THAT
the cardarea check is not needed
did you do the - 1 thing
how do i get the level of the played poker hand?
see the code above haha
.level instead of .played
yeah that tracks
man after 0.7 maybe i should try writing some smods docs
i would sure as hell use them
yeah we lack vanilla docs very badly
no because i thought it wouldnt need it since it's before
either way tho it's still not working
i think it updates it even before that
if i try my test code i get
it i use the commented out code it just
still doesnt upgrade
i will send you the exact code i tested give me a sec
this
if context.joker_main then
if (function()
local current_played = G.GAME.hands[context.scoring_name].played and
G.GAME.hands[context.scoring_name].played - 1 or 0
for handname, values in pairs(G.GAME.hands) do
if handname ~= context.scoring_name and values.played < current_played and values.visible then
return false
end
end
return true
end)() then
return {
message = localize('k_upgrade_ex'),
colour = G.C.DARK_EDITION,
}
end
return {
message = "fail"
}
end
okay THAT worked thank you
i had just replaced the first G.GAME.hands[context.scoring_name].played with G.GAME.hands[context.scoring_name].played - 1 instead of having BOTH
Bump
I've been trying to get this to work, and is there a way I can generate a random Joker from a certain pool? because I don't wanna have to go and define tons of custom item pools manually
i mean any pool you make you would have to define somewhere, what's the goal?
do you have talisman
I do
I tried changing the variables to to_big but that didn't change anything
So i just undid it
you need the opposite there, to_number
Oh
yeah I suppose. Originally I just wanted to use in_pool on all my modded Jokers but if doing it manually is necessary I guess I'll do that
Lemme try
Thank uuu, it works perfectly
There is one final thing but it's significantly more minor
that being that in the script there i have the return statement that's like
return {
message = localize('k_saved_ex'),
saved = 'ph_health',
colour = G.C.RED
}
I know normally instead of ph_health it's ph_bones
Where is that stored
I tried looking in localization in vanilla_remade but idk if it's just somewhere I haven't looked or smth
I was able to make a custom saved message if that's what you're trying to do
yeye
in misc.dictionary I have ph_1_up for the message
then I have this
return {
saved = "ph_1_up",
message = localize("k_saved_ex"),
colour = G.C.RED
}
it works fine for me
oooo
thank u :3
if the card is supposed to self-destruct, you can also add this before to create the mister bones effect:
G.E_MANAGER:add_event(Event({
func = function()
play_sound("tarot1")
card:start_dissolve()
return true
end
}))
yea
It's part of a health mechanic
How does make it so when the probability doesn't hit it would say "Nope"
if context.individual and context.cardarea == G.hand and not context.end_of_round and not context.blueprint and
pseudorandom('j_nic_incognito') < G.GAME.probabilities.normal / card.ability.extra.odds then
if not (context.other_card:is_suit("Spades")) then
context.other_card.should_destroy = true
card.ability.extra.xmult = (card.ability.extra.xmult) + 0.5
return { message = "YUM MULT!", colour = G.C.BLACK }
end
end
```
Been trying to figure it out but there are times where cards don't even have a message to either say Yum mult or nope
you start with 100 HP and then if you lose a blind, you sacrifice the percentage of HP relative to the percent of the blind you had left to score
So if you had 3000 chips and the blind was 4000, you would lose 25 HP since you had 25% of the blind left
my first idea is to seperate the pseudorandom from that first big if statement and make it its own thing, and then else it with a card_eval_status_text
for this
that's really cool 🙂
:3
After i implement the localization thing i shud be all good to release the mod
How would one do that

how do i format code text on discord
is it '''
Np
```
and you specify the programming language at the top
so ```lua for example
Yessir
if context.individual and context.cardarea == G.hand and not context.end_of_round and not context.blueprint then
if pseudorandom('j_nic_incognito') < G.GAME.probabilities.normal / card.ability.extra.odds then
if not (context.other_card:is_suit("Spades")) then
context.other_card.should_destroy = true
card.ability.extra.xmult = (card.ability.extra.xmult) + 0.5
return { message = "YUM MULT!", colour = G.C.BLACK }
end
else
card_eval_status_text(card, "extra", nil, nil, nil, {message = "Nope!"})
end
end
might work or i might have added one too many end statements
i have no idea
Yummy
so in localization this wud just be like uhh
return {
misc = {
dictionary = {
ph_health = {
message = "Saved by the bell!"
}
}
}
}
this right?
misc = {
dictionary = {
a_hands_singular = "+#1# Hand",
k_buffed = "Buffed!",
k_halved = "Halved!",
k_scaled = "Scaled!",
k_descaled = "De-scaled!",
k_swapped = "Swapped!",
-- Saves
ph_1_up = "Saved by 1 Up"
}
}
Let's take this for a spon
"But it refused"
Goofyahhtale
one could argue I should also localize my buttons
But that's even more complicated
probably
i just changed the name of my mod and a completely unrelated function broke 👍 love coding sm
Also AYEEEE it worked
W
Thank you wise horse
😔
It actually makes sense now that I see the code
This is what I get for stealing- I mean borrowing code
just look where "b_use" or whatever you need is in the source code, and put your button's text in there
i mean, in the same vein that all books are dictionary remixes, all code is already stolen
its just 0 or 1
b_ sounds like a dictionary thing
I'll try there
You're true
why does this
- not apply diamond stake
- appear at the end of the list of stakes and not directly above diamond stake
SMODS.Stake {
key = "violet",
name = "Violet Stake",
applied_stakes = { "cry_diamond" },
atlas = "crp_stake",
pos = { x = 1, y = 0 },
shiny = true,
colour = HEX("8a71e1"),
above_stake = "cry_diamond",
modifiers = function()
G.GAME.starting_params.ante_scaling = 2
end,
crp_credits = {
idea = { "Unknown" },
art = { "Grahkon" },
code = { "wilfredlam0418" }
}
}
i've been trying to figure this out for like over an hour and neither the smods wiki nor existing code from other mods seems to help
that was a lot more simple than i thought
yeah its not too bad
debating if it's worth fixing the center thing before launch
It is literally the only thing to do other than release the mod (bc the text is center to the health bar and not to the center of the thing)
Is there a way to have a joker card change the background of the game like how when opening a booster pack or am I trying to overdo things
I think it looks fine, but centering it probably would make it look a bit nicer
Health system? Oh hell naw it's peak

I agree
yea thats what i was thinking
It doesnt look terrible but it's not the intent
But then again it's a UI thing so it's a nightmare to fix
that's what I'm saying
so i have everything for a custom deck ready to do but the game is crashing at line 262 because the key is a nil value
UI is really har imo so its just up to you whether you think its worth your time
forgot an equal after the key
oh right my bad
the question is how long I would be willing to ask for help before someone smarter than me figures it out 
Also if I isn't in already yet I'd recommend putting the card creation in an event, just to make sure G.jokers exists
i need to get better at modding
i already have, don't worry
I'm right there with ya, I've only been modding for like a month or so and I have 16
damn, respect. Making a whole health bar in a month is crazy
jojomod had harder things
well
I mean I had to make an entire cardarea for the healthbar so it's definitely hard
Heaven's Door wasn't easy either tho
It's still broken
How bad is that btw? I'm gonna be adding a cardarea soon
Ranges from easy to hard depending on what you're doing
I want a second Joker cardarea that only allows Jokers with active abilities
how would that work
Not sure 😭
thats why I ask
I already have Jokers with active abilities I just need to make the cardarea
i am the biggest broken record at this point; bump
trying to fix these stakes because i have no clue on why they're just not working how i intend them to
Where do I put the "to_big" thing for talisman bs
Or at least where do I put it to define it
if talisman is installed, to_big can be used any time in your own mod
you don't need to define it or anything
Ah okay
What about this part of it
This will cause crashes as well because to_big doesn't exist without the mod installed, so to prevent that issue we can define it as follows somewhere else in the file:
to_big = to_big or function(x) return x end
Just wanna add this part just in case people have it without talisman
is there a way I can retrieve the mod prefix from something modded? like a function or something
card.config.center.mod.prefix iirc
where is the rate each rarity appears in the shop set, and is that conveniently changable? (in this context via a deck)
it is, the variable should be in the smods.rarity docs
G.GAME.common_mod, etc. i think
ohhhh wait ok i think i remember hearing this
trying to make a joker that gains +3 mult is entirely spades and clubs, if any cards played are hearts/diamonds it sets back to 5
(its initial +mult is 5)
what's the issue
also I would recommend asking in the jokerforge thread
Is there a way to forcefully create a specific booster pack in the shop
idk if there is an issue actually ig i shouldve tested first oops-
SMODS.add_booster_to_shop(key)
what kind of context checks do i need to make it actually work
im not sure if theres a specific context for entering the shop
context.starting_shop
cool the mod now just crashes if you attempt to even look at the joker
Your atlas is called "Jokers", but your joker definition is looking for the "Joker" atlas.
what line?
43
oh...
Yeah, one or the other needs to be changed to match the other.