#💻・modding-dev
1 messages · Page 485 of 1
🤔
i didnt bother to remove it from my first time using jokerforge and i used the same file
Keku put up a PR for a jimboquip object but it hasn't been reviewed
I just did mine with patches
shorten the description in the header 🙏
this would be so cool actually
nuh uh
id just use quips to yell at the player
because i still havent changed it yet one of my cards still tells me to end myself when it triggers
I want to make a common joker in tsunami that makes splash say motivational quotes randomly
that's all it does it doesn't contribute to score or anything
make one that just starts rotating the screen
whats the crash again?
do you have a splash partner yet
its about G.P_CENTERS.poisoned
send the log pls
this?
yeas
it should be G.P_CENTERS.m_modprefix_poisoned
and replace modprefix with my mod prefix
yes
ok
darn
i dont think it works
pls send code and crash always
yeah it dont work
exact same
if its the exact same code and crash then you didnt change anything
i mean
the same part
but ill senc it
and i did change what you said to change
is there any other mention of poisoned
in the code for the joker?
yes
because the id for the poisoned enhancement is poisoned and in the code for this joker its also mentions another time
this has to also be m_modprefix_key
how can i halt card selection
Hi quick question, i wanted to try making an music pack, but i got 2 songs, and i would like so the first one plays in the start menu, and the other in-game. Is it somehow possible? i am aware that music1 plays in menu, and in game too
uhhh i think there's like an example mod linked in steamodded github or smth that adds lobotomy corp soundtrack so maybe u can just like look how they did it or smth otherwise idk
bumpicus von bumperton the 3rd
How do I check a card's key as opposed to its ID?
bruh i can't believe someone already did the 'supertrash' joker idea
truly nothing new under the moon
a playing card?
Right now I'm using this as an identifier, but is there a way I can use the key instead of the ID?
if value:get_id() == variablename then
oh well ig i can try to take it to another lvl
Yep
card.base.value
I apologize, there's a lot more cards than playing cards in this.
like yeah ok these are literally what i did already i..... ok
OK, let me see if I can wrap this into my loop. Thanks for this help, but also for all the help over the past few weeks.
What does the game use for the localise function for upgrade text?
'k_upgrade_ex'
Course not what am I thinking
i figureed out how to cut the name and desc from my jokers and stuff and have it load via en-us.lua
I reverted the probability port of my release like 4h ago😭
shame on you for making a release based on dev branch
also to people who actually read the release, is it worth me writing up a full release like this with docs for the new content?
-# I'll also port them into the wiki at some point T_T
it allows me to link to it while theyre not in the docs at the very least
I just wish git's markdown highlighting was prettier
noraml 
blud wants me to change all my probabilities what da helly
how do i stop a rarity from appearing in booster packs
vanillaremade is merged with the new probability stuff + is poker hand visible + is eternal
it just sounds like a whole lot of effort
it took me like 5 minutes
its better in the long run
it would take me 0 to do nothin as the alternative
which is therefore a whole lot of effort
unless you name every card's odds something different
"Take time to schedule maintenance for your equipment, or your equipment will schedule maintenance for you." 5 minutes of work now is better than chasing bugs when something breaks later down the line.
everybody loves sayin things like that but then forget the age old adage of 'if it aint broke dont fix it' smh my head
i mean you dont need to, it wont break
I'm so glad I used an util for proba check I just need to modify one thing
oh unless you have your own oops all 6s
Wait I have to modify the loc vars too iirc
wheres oops all 12s
yes
Is trigger mandatory for SMODS.is_eternal?
no
how do i stop a joker rarity from appearing in booster packs but still have it appear in the shop
oh god the loc_vars
Dumb question how do I create a king with create_card? This doesn't seem to work
SMODS.add_card({ set = "Base", area = G.hand, rank = 13 })
rank = "K" (or "King")
[Maximus 1.1 OUT in 2 hours!!]
Thank you!
does a change so big as porting to new smods version deserve a Patch in the versioning 👀
Why does SMODS.pseudorandom_probability have a card argument?
how exactly would i check if a card has a listed probability
for other cards to check the card that triggered it

sounds very hard
I don't think there's an way to check until they call the new functions
you could make a list of all cards and jokers that have probabilities
but that would be tedious
i think
yeah someone mentioned this
also: that needs manual crossmod
i cant 😔
Won't each mod have their own numerator/denominator addition? there's no global variable to fetch..

wdym
i was going to check for certain variables present in ability.extra, what else is used aside from odds?
I don't use numerator for my stuff and I'm not sure what I'm supposed to add to make it crossmod compatible
this is crossmod compatible by default
Oh it has a default value?
But like if a mod modifies the numerator and I don't catch that won't that cause issues?
literally just use the new thing and smods will handle it for you
thats why its in a function
when you use the new function it calls a context and that context is where cards modify the numbers
Wait so I shouldn't replace my usual pseudoranom check by the SMODS one?
are vanilla cards patched to use SMODS.pseudorandom_probability yet
Probabilities were pretty broken if you’re looking to do anything remotely interesting with them
no you should
you should, they dont use G.GAME.probabilities.normal anymore
because thats what handles the crossmod
wait do they not
I even wrote a guide for how to update your code 😭
Hey quick question, how can i implement that when the player is in the shop, it plays another music? I wanted so when the player is in the shop, it plays shop_theme.ogg, but i can't get it working. The only thing i got to work is when player is in the main menu, and in-game.
no, except for a case for oops back compat
So I can use "1" as my numerator and it won't cause issues with mods that somehow modify the numerator? Also what if other mods use a different thing to globally modify num/den?
why would other mods use a different thing to do that
- Yes, 1 is the base numerator. Other mods will modify it based on that
- It won't work, they need to use this
Omg no wonder I'm confused the parameters aren't written like in the release...
this should be enough
Well it's written improperly
looks fine to me
it doesn't mention the num and den as the base one which is important and wouldn't have led to confusion
fair
what exactly is the identifier in the new pseudorandom stuff, its just stated that "it is suggested to use an identifier" but its never elaborated what that means
should each individual get_probability_vars() or pseudorandom_probability() have its own identifer? should it be unique per card? should it be written a certain way? if a card has multiple listed probabilities should they use separate identifiers?
the whole thing is mostly fine but this is really bothering me because it never explains what the identifier is or what it does
look at the cool screenshot extension
chat does anyone know if i can stop joker rarities from appearing in booster packs but not in the shop
it should be used like this
not me sorry
(identifier defaults to the seed if nil)
oh so i don't have to put the seed there 2 times? cool
i see thank you
the lsp def needs updating 👀
yeah
oh god i can finally delete that lovely patch from my mod. Ty SMODS 🙏
Pessimistic Joker crossmod compat will be real 
any reason for it to be 'prefix_key_x' (at least i think thats what this is written as) other than just ensuring its unique?
no it's just to ensure it's unique
im so damn close
i just need to somehow get the button back behind the card
and to make it apply the new highlight code without me having to click and unclick it first
does anyone know how to do either of those
the function if it'll help
and i have this in the joker's add_to_deck
any chance anyone knows if theres a mod that can enable you to auto buy and use planets if you have astronomer?
there's always someone that just knows something for some reason
i did nobody responded :I tends to be the case
didnt want to just repeat the same thing over and over so figured id try askin here first
unlucky
Agreed, unlucky lol
oh hey astra
We make the mods here, not necessarily have the mod database in our heads like some players
Hi toma
alright ive done the probability changes begrundingly
bump 
oh hey dilly
hi toma
cant believe you dont have the entire mod index downloaded into your brain smh
Oh yeah toma your chud joker can have crossmod with the new probability stuff now
yeah,,,, i know,,,
I’M SORRY MAN I’M SO SO SORRY
/j
thine punishment is to stub your toe at some point in the next 1000 days
brb all
gonna get this canine out before the storm starts
if the shop or a booster pack wants to spawn a joker rarity but can't find any jokers for it it'll just spawn jimbo right?
probably not, but I remember someone posting a flowchart for the game states, does anyone have it or something like that?
yes

🙂
can i get an example on what initial scoring step would be good for as opposed to before?
Hey so i have an issue. i tried transitioning to the new headers from file headers, but the mod loader doesn't seem to see it. Did i do something wrong?
Chat I dunno what I did wrong
Is there an error?
https://github.com/Steamodded/smods/wiki/Mod-Metadata should have all the info
Why do you have 2 calculate functions
Good question!
how would i stop a joker from appearing in any booster packs? (can be manual crossmod)
I know it should have all the info. I did what i understand from the wiki, and i don't know what i did wrong there. It has all the requied info
Custom rarity
i have a custom rarity but i want it to appear in the shop
which it does
but it also appears in booster packs rn
If I had to guess it's either the lack of version field or the blank string
you have no version number and no badge text color
The version number isn't required
And yes it was the badge text color. I was looking at this for good 10 minutes and didn't saw the empty string
sorry about that
like this?
i have returned
along with my code sized bump
Bump? Ouch
you're thinking of lump
if you have a lump as big as your code, i recommend a doctor
hwarharhar
i contracted illiteracy
came free with my balatro
the effects are normally temporary but i play yugioh
98%…
EAT
ALRIGHT
How would i get all pairs in a played hand?
context.poker_hands["Pair"]
how would i stop a joker from appearing in any booster packs? (can be manual crossmod)
not args or args.source ~= 'buf' works for buffoon packs
for crossmod you would need to check the key_appends
OR you could do the reverse and opt-in to the shop and other abilities manually
wait how would i opt in to the shop
that sounds better
args and args.source == 'sho'
okay NOW ive returned,
well fed and quite the large stomach
no wait that's just the bump
Evening Chat
(this is in in_pool forgot to say)
hi wilson!!
holy shit its john dp
yo!
john diamond and pearl
john degree of polymerization
anyway now i shall have dinner
oh hey it's like we're tagging
Hey so i have an little problem. I wanted to add music to G.STATES.SHOP, and everything looks arlight, but when i try to buy a voucher, it has the same music as G.GAME. I don't know if this is intensional, or is there another G.STATE for buying vouchers?
damn
i hate mkv
lemme convert it
bump
also, can a joker return table take an SMODS.Gradient in the colour arg, or no?
I FORGOT I CHANGED THAT
WELL CRUCIFIED SPAMTON IS PLASMA DECK FROM NOW ON 😭
Yes, it seems to switch to G.STATES.PLAY_TAROT
what to hook if i want to change something from the game over screen
All cards or just cards in hand? And yes.
A gradient is just a normal colour that keeps changing.
just cards in hand
and i mean in the sense that the gradient will work for the colour of the message
Well a normal color doesn't change so it cant be a normal color silly
Game:update_game_over?
I don't think so. When changing that the music plays while G.STATES.PLAY_TAROT, the same problem persists
No, I can guarantee that it does.
which lua is that again
Yes, it's a colour like any other colour but it just changes.
game.lua
best yes, i want to basically deselect all cards in hand and temporarily prevent any cards from being selected
Set G.hand.config.highlighted_limit to 0?
that makes sense
NEVER MIND I FINALLY GOT IT WAHAHAHAAHAAAAAAAAA
i just need to figure out the layer
not entirely true as I had to fix this in SMODS recently haha
how do i deselect any current highlighted cards though
G.hand:unhighlight_all()
ah - so do gradients work in joker return tables as you'd expect or no?
now they do
nice
ok between the two which one would i change to render behind the joker
Oh! Sorry for that! I just typed the function wrong 😭 I did G.STATE == G.STATES.SHOP and G.STATES.PLAY_TAROT instead of G.STATES.SHOP and G.STATES.PLAY_TAROT
so it doesnt look like this i mean
No, it would be G.STATE == G.STATES.SHOP or G.STATE == G.STATES.PLAY_TAROT
because its hard

good luck
it is something with instance_type right
i would imagine though i have tried that for something similar and it didnt work
oh damn i never used or 😭 well thanks for the info tho
wait what layer are jokerdisplay boxes on cause what if i can render the clickbox above the visual
UIBOX
what is used for the floating effect on not discovered jokers? i tried soul_pos but it looks a little different
Released a new Cardsauce update 
my joker on top, not discovered joker on bottom
?
It's in the center SMODS.Drawstep in src/card_draw.lua in SMODS
how would i have a joker add a wild ace to the deck? i currently am using SMODS.add_card and it adds a wild card to the deck, but even though i specify rank = 'Ace' like in documentation it just picks one at random
do any of you guys ever mess with restarting a run?
SMODS.add_card { set = "Base", rank = "Ace", enhancement= "m_wild" }
you need to be in a recent version of smods
Now how the heck you do that
pretty sure im on 0530b, i see thats two releases behind currently. but that's exactly what i have when i create the card
this is after that version im pretty sure
there's a button on github that says Draft Release I think
ahh ok ill update then and try it, thanks
Im out here thinking you traveling but you out here releasing
I mean my plane got canceled and my new flight isn't until tomorrow morning
Not much I can do now
I thought you weren't even here yet
Thought you was still en route
No I never even left home
I had to get someone to pick me back up from the airport
Ooo
Icic
I thought you were getting here and that one was canceled icic
I totes misunderstood
thats exactly what the problem was, thanks a ton
yw i added that feature :3
Can I add your feature
yes
@daring fern what do i put here if i want it to play a sound
play_sound("modprefix_key")
in the first if or the second one
The second one probably.
sure
-# Ack, Virtual PC be causing infinity loops somewhere again on stable.
does base game have any toggle buttons am i forgetting one
buttons that toggle
Im sad gang I wanted to be gay with my partner but instead im at home making mods
Ehh it's dragging close to the end here
twinning 
Gonna slap next() around some vars...
but thats probably just cause its ui
you probably over there with rocket science
...did SMODS.merge_effects change..?
yes
how much
the change is that empty tables are skipped
hardest sigh of relief ive had all day
Buying causes that familiar infinite loop.
local returns = nil
local merge = {}
for i = 1, #G.jokers.cards do
local other_joker = G.jokers.cards[i]
if other_joker and other_joker:can_calculate() and other_joker.config.center.key ~= self.key and SMODS.pseudorandom_probability(card, "virtualpc2004sp1", 1, card.ability.extra.odds) then
local other_joker_effect = SMODS.blueprint_effect(card, other_joker, context)
if other_joker_effect and not other_joker_effect.was_blueprinted then
other_joker_effect.was_blueprinted = true
if next(other_joker_effect) ~= nil then
if context.repetition then
returns = returns or {}
returns.repetitions = (returns.repetitions or 0) + other_joker_effect.repetitions
else
table.insert(merge, other_joker_effect)
end
end
end
end
end
print(merge, next(merge))
if next(merge) ~= nil then returns = SMODS.merge_effects(merge) end
if returns and next(returns) ~= nil then
return returns
end
like this is the only change
I'd assume SMODS.blueprint_effect returns nil for no "blueprint" effects...
yes
mood
i noticed an unrelated bug testing merge_effects just now lol
So something changed elsewhere, because the loop occurs with or without the commented out end.
local returns = nil
local merge = {}
for i = 1, #G.jokers.cards do
local other_joker = G.jokers.cards[i]
if other_joker and other_joker:can_calculate() and other_joker.config.center.key ~= self.key and SMODS.pseudorandom_probability(card, "virtualpc2004sp1", 1, card.ability.extra.odds) then
local other_joker_effect = SMODS.blueprint_effect(card, other_joker, context)
if other_joker_effect and not other_joker_effect.was_blueprinted then
if next(other_joker_effect) ~= nil then
other_joker_effect.was_blueprinted = true
if context.repetition then
returns = returns or {}
returns.repetitions = (returns.repetitions or 0) + other_joker_effect.repetitions
else
table.insert(merge, other_joker_effect)
end
end
end
end
end
-- if next(merge) ~= nil then
-- print(next(merge))
-- returns = SMODS.merge_effects(merge)
-- end
-- if returns and next(returns) ~= nil then
-- return returns
-- end
Or the other added probability-related contexts are not checked for.
oh yeah thats probably it
INFO - [G] card_added: true
main_eval: true
cardarea: table
card: table
INFO - [G] main_eval: true
buying_card: true
cardarea: table
card: table
INFO - [G] trigger_obj: table
pseudorandom_result: true
identifier: virtualpc2004sp1
main_eval: true
result: false
denominator: 15
cardarea: table
numerator: 1
That last one repeats on.
Reverted main block, only changed the
if context and not (context.mod_probability or context.fix_probability or context.check_enhancement or context.blueprint or context.pseudorandom_result) then
line.
All of this was just because I was migrating the two probability vouchers to also use calculate
if context.mod_probability and not context.blueprint then
return { numerator = context.numerator * (card and card.ability.extra or self.config.extra).probabilitymult }
end
from
for k, v in pairs(G.GAME.probabilities) do
G.GAME.probabilities[k] = v*(card and card.ability.extra or self.config.extra).probabilitymult
end
in redeem.
Anyway, I feel like the probability contexts should also have a warning about being copied. 😅
ok i think i'm fully moved over to new probability
reading eremel's writeup has me excited about new jokers
Where are the colours for text formatting stored?
G.ARGS.LOC_COLOURS iirc
Hey guys, does anyone know if the game allows for a booster pack to allow you to select other booster packs instead of cards? I want to implement some kind of chest system and I'm just wondering if it'd be best to have it be implemented through boosters instead of consumables
okii
which file would that be in
uhh no idea
it's in misc_functions
i recommend checking the modded wiki too as it has many modded ones if you're doing it for the manager
thank uuu :3
i am indeed
it's the only thing left i need to finish the wiki
does it have all the modded ones? Don't wanna miss one and have to go back
Tho i guess it would just be adding to an array anyway
i mean it's obviously not going to have all, just the ones that are on the wiki and they cared enough to add the colors, but its a lot of them
https://balatromods.miraheze.org/wiki/Module:Ct/data
If i wanna take a name of a joker from a list and have a deck spawn a random one from the list, how could I do that? because this code generate a random joker
oh boy i was gonna add this manually
i thought it was like maybe 70
SMODS.add_card { key = space } should work
if i wanna set it to eternal would this work
or is it to set it to a specific sticker
didn't work unfortunately
it's stickers = { "eternal" }
now it doesn't spawn anything
can i see the entire code
wha
math
wat does "math" mean
Here you go ^^
gonna fix some stuff since we're mainly doing add_card without creating a card obj
seems to be from showdown
Like this
that looks correct to me
Doesn't spawn anything ingame unfortunately
wait a second I'm a programmer
I can just write code to scrape this
i somehow completely forgot about that
weird, try replacing space for "j_joker"
...why not move the local vars inside the event?
ok now that new probability is out, assume i don't care about old probability compat. how do i check if a joker has a listed probability (or can perform a probability roll)
that works properly
no programmer does silly
so it might be an issue with my list??
huh
try moving the locals like ali said
well
except the person who made a regex that prints prime numbers
but theyre a god amongst men
but yeah theres no real clean way to know if a joker has probabilities
how does the new smods probability api work so i can make my stuff work w/ it
read the docs there
Something something hook the prob-functions, store initial num/denum, perform the functions, check against stored values...
-# Alternatively, my brain is fried.
oh i didnt realize it was in that
is it even possible in Lua
bc Lua doesn't have regex (unless you import it but they hate that)
Lua does have its own version of regex but it's terrible
Ok now it's working properly now
i thought that was part of the point in the new probability system was a cleaner way to know
is something like this possible or can you not do this with buttons?
wait nevermind it just spawns just one type of joker and doesn't change when starting a new run
it's a cleaner way to know if a joker is trying to calculate probabilities
what they want to know is if a joker will do it at any point in the future
it stops at the third option in my list
The new identifier concept kind of informs that a center can have a probability roll even if it doesn't directly subscribe it anywhere
It just does allow you to correlate instances of the roll being displayed in the UI
no, because that's also only given if you call the function
i guess hovering over all jokers is a way haha
Like this?
Inside the func.
I should start with a better initial question, work it through by steps
"How can I detect when a Joker's card is clicked on?"
Card:click() hook?
these hooks will be the depth of me
🪝
ok yeah that looks simple enough
now how to link it to the button being clicked instead...
wait i can do that already
I was going to say, wouldn't it be easier to have a button to have the joker flip through different states (ie. consumable_copy = true or false)?
ok if i have a function in my gfuncs right
can the variables it uses be used in the joker caue then how do i link the button to the joker itself
like
you can add it to the card
im listening
but they wont be saved on reload unless you do stuff or save it to .ability.extra
i mean it's a gimmick for a joker--oh unless you mean like within the run too
is this always the same joker
then you can do card.ability.extra.yourvariable in the g funcs function
you already have the card
oh ok awesome
i love regex
ur missing a comma
im missing two :3
all good?
in the gfunc instead of the conditional?
yeah
got it
can you run set sprites in a situation like this or no? want the sprite to change depending on the setting
nothing animated, just two still images
or even just changing the atlas, swap between the normal perkeo's floating sprite and the fake one's
or would doing that change the card's base too
card.children.center:set_sprite_pos({x=0, y=0})
idk how to do this with the soul sprite but it should be possible
how difficult would it be to make a joker that allows your consumable slots to be used as joker slots
but you can still use consumables if they have space ofcourse
considering i did it on accident
consumable slots run joker calculations
shouldnt be too hard i believe?
the problem is the UI i think
truth nuke
surely it would just be the same
it has different values for consumables
idk if it looks bad or not
the buttons i mean
is there any jokers that use this idea or is this an original thought
i havent seen it like that, ive only seen stuff that let you transfer jokers as a gimmick
like aiko's freedom deck
but i also dont play mods
RAAAAAAAA FREEDOMMMM
ok why does this throw up an attempt to index "extra" nil error when it IS the nil check
am i stupid
what is the context for a probability succeeding
check the release page:3
i almost answered make one but who knows there might b-fuck....
i dont wanna update chud but i know its gonna be so much better......
You're not checking card_to_check.ability.extra and type(card_to_check.ability.extra) == "table"
this wont work for vanilla stuff because some of them have the odds directly in extra btw
like card_check.extra.odds??
vanilla jokers do not use extra table
No, card.ability.extra is the odds.
oh
i think some do
im pretty sure one of the odds ones has it in extra.odds
cavendish or something
bloodstone has it by the looks of it
yeah
so if im understanding this correctly itd be context.pseudorandom_result and context.result?
tyty
I literally don't know what is happening, its probably some sort of error when the card appears in the shop, trying to find a value or something.
SMODS.Joker {
key = "r_freddy",
atlas = 'Joker',
pos = { x = 7, y = 1 },
blueprint_compat = true,
rarity = 2,
cost = 6,
config = { extra = { seal = 'Gold', chips_mod = 25, chips = 0 } },
loc_vars = function(self, info_queue, card)
info_queue[#info_queue + 1] = G.P_SEALS[card.ability.extra.seal]
local gold_tally = 0
if G.playing_cards then
for _, playing_card in ipairs(G.playing_cards) do
if playing_card.seal == card.ability.extra.seal then gold_tally = gold_tally + 1 end
end
end
return { vars = { card.ability.extra.seal, card.ability.extra.chips_mod, card.ability.extra.chips } }
end,
calculate = function(self, card, context)
if context.joker_main then
local gold_tally = 0
for _, playing_card in ipairs(G.playing_cards) do
if playing_card.seal == card.ability.extra.seal then gold_tally = gold_tally + 1 end
end
return {
chips = card.ability.extra.chips_mod * gold_tally
}
end
end,
in_pool = function(self, args)
for _, playing_card in ipairs(G.playing_cards or {}) do
if SMODS.has_enhancement(playing_card, card.ability.extra.seal) then
return true
end
end
return false
end
}```
j_fnaf_r_freddy = {
name = "Rockstar Freddy",
text = {
"Gives {C:chips}+#1#{} Chips for",
"each {C:attention}Gold Seal",
"in your {C:attention}full deck",
"{C:inactive}(Currently {C:chips}+#2#{C:inactive} Chips)",
},
},
there's no card in in_pool
the problem is in the in_pool I see
context.denominator is just that value
how would I fix this
self.config.extra.seal instead of card.ability.extra.seal
it worked
thank you
realized that this wont really work cause they share the same position
can i just change the soul pos's atlas instead
or even just the general atlas is fine if changing only the atlas of the floating sprite is too complicated
i know you can but dunno how
because of how sprites work you should be able to change the atlas of soul sprites or at last change the sprite on the fly to one with the new atlas, but i dont even know how to access the soul sprite from the card
What's the set ability for editions
set_edition?
bed
so i have a thing to spawn a joker but how do i make it spawn a random joker from a certain pool?
new_card:add_to_deck()
G.jokers:emplace(new_card)```
SMODS.add_card({set = "poolkey"})
thanks
just experienced some nice little stack overflow
weird how it never cropped up til now after this joker has existed for...almost half a year
How could i make a joker's name change depending on the amount of rounds it's been in hand?
What are the rules around debugging? I'm trying to write a script to simulate deck shuffling, and I'm stumped trying to figure out the bugs with my implementation differing from the games. Would discussion about adding things like print statements to figure out what the values are for a hand be fine?
return a key in loc_vars to a different localization entry
ignore the debugging rule, it just means to not bother thunk with bugs found reading code
Ohhh, got it
how do i ensure this only upgrades once per hand instead of once per card?
what's the effect?
how do you make a custom rarity with functioning weights?
i have mine set to weight 0.1 but i can confirm i have seen three brainstorms before even one of these jokers
SMODS.Rarity {
key = "lingo",
default_weight = 0.1,
badge_colour = HEX('f3d793'),
get_weight = function(self, weight, object_type)
return weight
end,
}
i dont think i did it right 💀
if context.setting_blind then
SMODS.add_card({set = "Rowansmodaddition"}) {
set = "Joker",
}
end
end```
this
everything works mostly alright, only issue is that it upgrades once for every played card
I tried to get a joker to spawn a playing card with the foil edition but i got a crash
--pseudocode because phone
local is_valid = true
for _ pcard in ipairs(context.full_hand) do
if pcard:get_id() ~= 4 then is_valid = false; break end
end
if is_valid then
-- upgrade
return { message...... }
end
actually i just read the code and you also check for hand having size for so you can just break out of the loop
fixed
i have no idea what i'm doing
set foil doesn't exist
read the docs
i recommend brushing up a bit more on basic lua syntax
mb
Still crashing, trying to get a joker to spawn a foil playing card
set_edition is not a valid field, and you do need a set or a key
again, please read the docs
I am reading the docs
well it doesn't say set edition so you might be reading it wrong
where is this found at? i don't see it anywhere
3 of the jokers triggered, but every time it triggers it creates this "invisible consumable" that just seems to take up a consumable slot
are you using add_card and then emplacing it
yes
aight that fixed it thanks
You guys know how stone joker detects how many stone cards are in your deck, how would one do it but for held hand instead
replace G.playing_cards for G.hand.cards
N its bedtime why are you wakie
watching anime show good fun anime
What fun cool anime
Aim for the Ace! (1973)
Oic
Are you liking it
yes it's very good
Very awesome
As always very helpful
i did that but I forgot to replace all of it
why are they looking at me like that
now you removed everything: (
Thats how I look at you winky face
i still need help with this
wdym?
like I said, it needs a set or a key
sending this for checks before i ship it for testing
ah alright
the atlas needs to be an atlas object not a string
got it- wait what
Toma
Dilly please
🛏️
how would i check if a given consumable is a planet card
i havent used an asset object before
G.ASSET_ATLAS["modprefix_key"] should wokr
IN A MINUTE
card.ability.set == "Planet"
Thats it.
Im about to grug.
given said planet card how would i check what hand it levels up
like this or do i still need the quotes
card.ability.hand_type
you need the quotes
wait how do i even level up a hand
returning level_up as true
in calculate?
in a joker calculate
(o.o)/
goodnight n even though im about to aswelll
can anyone help with this, I'm trying to get the joker to spawn a playing card with the foil edition
SMODS.create_card({set = "Playing Card", area = G.discard, edition = "e_foil"})
So when I'm viewing a joker in the main menu collection, my games crash. But when I'm viewing a joker in game collection, it doesn't crash
loc_vars = function(self, info_queue, card)
info_queue[#info_queue + 1] = G.P_CENTERS.m_stone
local stone_tally = 0
if G.hand.cards then
for _, v in ipairs(G.hand.cards) do
if SMODS.has_enhancement(v, 'm_stone') then stone_tally = stone_tally + 1 end
end
end
return { vars = { card.ability.extra.chips * stone_tally, card.ability.extra.xmult * stone_tally } }
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
if SMODS.has_enhancement(context.other_card, 'm_stone') then
card.ability.extra.chips = card.ability.extra.chips + 25
local other_card = context.other_card
G.E_MANAGER:add_event(Event({
func = function()
other_card:juice_up()
other_card:set_edition('e_negative')
return true
end
}))
end
end
if context.joker_main then
local stone_tally = 0
for _, v in ipairs(G.hand.cards) do
if SMODS.has_enhancement(v, 'm_stone') then stone_tally = stone_tally + 1 end
end
return {
chips = card.ability.extra.chips * stone_tally,
xmult = card.ability.extra.xmult * stone_tally
}
end
end,
in_pool = function(self, args) --equivalent to `enhancement_gate = 'm_stone'`
for _, v in ipairs(G.hand.cards or {}) do
if SMODS.has_enhancement(v, 'm_stone') then
return true
end
end
return false
end
}
Yes, G.hand doesn't exist in the main menu.
So how should I get around this
if G.hand
is there a way to replace all blinds with 1 boss blind for a specific ante number
Interesting
Yes.
we really need a how emoji
that looks like this but it's just How?
anyways
How?
Patch reset_blinds() perhaps?
aw man not another patch
thank you
why doesn't this level up a poker hand
How would i make a boss blind that has its chips required randomize between 2x and 5x including decimals?
When it's selected or does it only randomize once every run?
Once per run
You would probably hook Game:start_run and set G.P_BLINDS.bl_modprefix_key.mult to a random number between 2 and 5
Ah, thanks!
how do i see how many cards are drawn
cuz im tryna add chips every time a card is drawn
context.hand_drawn
#context.hand_drawn
woah
You're returning something in context.repetition with no repetitions.
Or you're just returning something with no context checks.
i dont think i use repetitions
here's the code
calculate = function(self, card, context)
if context.joker_main and pseudorandom('mustard') < G.GAME.probabilities.normal / card.ability.extra.chance then
card:juice_up(1, 0.8)
play_sound('tarot1', 1.2)
return {
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.mult_plier } },
xmult = card.ability.extra.mult_plier,
colour = G.C.RED,
card_eval = card
}
else
return {
mult = card.ability.extra.base_mult,
card_eval = card
}
end
end
}
You're not checking for a context in the else
i see
should be good now?
You would do: ```lua
if context.joker_main then
if SMODS.pseudorandom_probability(card, 'mustard', 1, card.ability.extra.chance) then
-- do things
else
-- do other things
end
end
Also card_eval doesn't do anything.
oh thanks
noted
like this?
whats the code for the joker? There might be a line that specifies multiples can show up without showman
they probably spawn it with debugplus
SMODS.Atlas{
key = 'saba',
path = 'saba.png',
px = 71,
py = 95
}
SMODS.Joker{
key = 'saba',
blueprint_compat = true,
rarity = 3,
loc_txt = {
name = 'saba',
text = {
'Gains {C:chips}+1{} chips every time a card is drawn,',
'Currently at {C:chips}+#1#{}.'
}
},
atlas = 'saba',
pos = {x = 0, y = 0},
config = { extra = {
chips = 0,
}},
loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.extra.chips
}
}
end,
calculate = function(self, card, context)
if context.hand_drawn then
card.ability.extra.chips = card.ability.extra.chips + #context.hand_drawn
end
if context.joker_main then
return {
chips = card.ability.extra.chips
}
end
end,
}
oh is that it
that too i guess
i didnt know lol
yes
i know ive seen people have a tag specifically for more to show up regardless of showman
debugplus spit on the pool
ok good to know :3
while theres a few people here, does anyone know how to calculate/read a Blind's score before it finishes? Basically just The Joke from Cryptid but if score is >= G.GAME.blind.chips/2 then it transitions into a different boss
tried to understand how both Cryptid and LobotomyCorp do it and my implementation of their stuff doesnt work
Yes.
Is there a way to check to see how many duplicates you have of a certain joker?
Yes.
What might that be?
#SMODS.find_card("j_modprefix_key")-1
Thank you!
is this code like correct?
if context.individual and context.cardarea == G.play and context.other_card:is_face() then
return {
card.ability.extra.mult = card.ability.extra.mult - card.ability.extra.mult_mod }
end,
if context.joker_main then
return {
mult = card.ability.extra.mult
}
end
end
}```
i'm getting the forbidden "attempted to compare number with table" error from this joker, which is supposed to give xmult based on jokers to the right of this one
loc_vars = function(self, info_queue, card) -- line 535
if card.area and card.area == G.jokers then -- note: do not delete the doubling. the grouping is (card.area) and (card.area == G.jokers).
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then
local card_index = i
return {
vars = { math.max(1, #G.jokers.cards - card_index or 1) + 1 }
}
end
end
end
end,
calculate = function(self, card, context)
if context.joker_main and card.area and card.area == G.jokers then
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then
local card_index = i
return {
xmult = { math.max(1, #G.jokers.cards - card_index or 1) + 1 }
}
end
end
end
end
} -- line 559
what are you trying to do
35 mult, -5 mult per scored face card
the subtraction code is not meant to be returned, the correct code should be this
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and context.other_card:is_face() then
card.ability.extra.mult = card.ability.extra.mult - card.ability.extra.mult_mod
end,
if context.joker_main then
return {
mult = card.ability.extra.mult
}
end
end
}
ohhh thanks
is there a list of cardareas anywhere ingame
No.
i guess its not worth my time trying to do what i wanted to do anyway
What is the full crash?
What is that line in the lovely dump?
still seems to be the same
No, the lovely dump, not the lovely log.
where do you find that
Mods/lovely/dump
which folder
ohhhhhhhhhhhhhhhh
function G.FUNCS.evaluate_play(...) -- line 1919
G.SCORING_COROUTINE = coroutine.create(oldplay)
G.LAST_SCORING_YIELD = love.timer.getTime()
G.CARD_CALC_COUNTS = {} -- keys = cards, values = table containing numbers
local success, err = coroutine.resume(G.SCORING_COROUTINE, ...)
if not success then
error(err) -- line 1925
end
end -- line 1927
if amt > 0 or amt < 0 then -- line 1097
if extra and extra.instant then
if extrafunc then extrafunc() end
attention_text({
text = text,
scale = config.scale or 1,
hold = delay - 0.2,
backdrop_colour = colour,
align = card_aligned,
major = card,
offset = {x = 0, y = y_off}
})
play_sound(sound, 0.8+percent*0.2, volume)
if not extra or not extra.no_juice then
if card and card.juice_up then card:juice_up(0.6, 0.1) end
G.ROOM.jiggle = G.ROOM.jiggle + 0.7
end -- line 1113
-- (more stuff at the bottom)
Yes, that is a Talisman problem, and not a problem with your code.
I think.
hm okay it might be the new steamodded conflict
idk just a hypothesis
since the new 711 or whatever update changed quite a bit
Yes, but that is not the problem.
is there a way to order jokers in the collection in a way different from the order theyre created code wise?
No.
aw sad
How do I change the saved message?
good luck changing color
i don't think you can do that without
idk
patching
oh dear god
Anyone know how to?
check wiki?
bump
did you define SMODS.Sound()?
everyone knows you have to remake the entire sound atlas system from smods to get sounds to work
like this is trivial
i'm fucking with you but uhh
is the keynotes correct?
show us the sound entry
D:
You have to set saved to the key of a localization entry.
ok, can I somehow do that within SMODS.Joker?
to play a sound in return you need to also supply a message
no
Yes, saved = "keytolocalizationentry"
you can also just call play_sound before the return if you don't want a message
yeah
Yes, but remove the mod prefix when you're defining the sounds.
message = "this school makes me want to whip my
i see i see
(they don't see)
yall gotta see this IMG_7956
thanks yo mb genghis kan
i think this is caused by your code @daring fern
Oops! The game crashed:
[SMODS tangent "imrocksolidrnouuugh.lua"]:1428: attempt to call field 'pseudorandom_probability' (a nil value)
o idk how to use pp
Update smods
oh yeah that
listen to mr gligg fox
nvm no more fact check
what they said is false
n
do not listen to them
THEN
we all need to normalize egg reacting
I don't even know what the hell localization is doing here.
It's still not working.
Do you have a loc file
yes. i have en-us.lua
Yes, it needs to be in Localization > misc > dictionary
so a misc folder leading into a dictionary folder?
-# so close to scrapping this idea.
Nevermind, you single-handedly saved me from rage quitting.
it's no he deep
what does this mean
How do you implement a third layer on a sprite?
@daring fern is it really mandatory to change all probabilities stuff
Yes.
FUCK
With SMODS.Drawstep
Elaborate
Read the docs I can't rn
It means you can do scoring before cards score.
ah okay i see
What’s the point of typing out full docs for new updates if people don’t even read them 🥲🙃
I DID READ IT JUST NOW
So N' can't point people to them
And some people read the docs
greetings fellas
is there a state i can use to instantly win a run?
i assume that there's one since there's a state to instantly lose a run
win_game()?
i actually had no idea that was a thing xd
thanks :)
that will be just great for this stinker
config = {
extra = {
mult_gain = 3,
chip_gain = 25,
consumed = 0
}
},
loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.extra.mult_gain,
card.ability.extra.chip_gain,
G.GAME.consumeable_usage_total or 0,
card.ability.extra.mult_gain * G.GAME.consumeable_usage_total,
card.ability.extra.chip_gain * G.GAME.consumeable_usage_total
}
}
end,
calculate = function(self, card, context)
if context.using_consumeable and not context.blueprint then
G.GAME.consumeable_usage_total = G.GAME.consumeable_usage_total + 1
G.E_MANAGER:add_event(Event({
func = function()
card:juice_up(0.5, 0.5)
return true
end
}))
return {
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult_gain } } ..
" " ..
localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chip_gain } },
colour = G.C.MULT
}
end
if context.joker_main and G.GAME.consumeable_usage_total > 0 then
return {
mult = card.ability.extra.mult_gain * G.GAME.consumeable_usage_total,
chips = card.ability.extra.chip_gain * G.GAME.consumeable_usage_total
}
end
end
}
this crashes the game
somehow
trying to index consumeable_usage_total
G.GAME.consumeable_usage_total is a table
thanks
Use G.GAME.consumeable_usage_total.all instead to do math, no need to increment it
so no ()?
what should i change tho
For things like mult = card.ability.extra.mult_gain * G.GAME.consumeable_usage_total add .all to the usage total thinggy
And remove G.GAME.consumeable_usage_total = G.GAME.consumeable_usage_total + 1
alright
what about this
same, add .all
thanks dude
-- Glitch blind
SMODS.Atlas {
key = "GlitchBlind",
path = "GlitchBlind.png",
px = 34,
py = 34,
frames = 1,
atlas_table = 'ANIMATION_ATLAS'
}
SMODS.Blind {
key = "GlitchBlind",
atlas = "GlitchBlind",
dollars = 5,
mult = 2,
idk how the animation works on blinds so can anyone help me?
im trying to get this joker to create an exact copy of itself when it is destroyed and the way im (trying) to go about it is by having it select itself to copy sort of like invisible joker does in the code but apparently og_card is a nil value, anybody know what exactly im doing wrong? remove_from_deck = function (self, card, from_debuff) if not from_debuff and card.ability.active ~= false then card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_mod print(tostring(card.ability.extra.Xmult)) G.E_MANAGER:add_event(Event({ delay = 0.1, func = function () local my_pos = nil for i = 1, #G.jokers.cards do if G.jokers.cards[i] == card then my_pos = i break end end local og_card = G.jokers.cards[my_pos] local copy = copy_card(og_card, nil, nil, nil, og_card.edition) copy:start_materialize() copy:add_to_deck() G.jokers:emplace(copy) return true end })) end end }
once something is removed from the deck, it no longer exists in the area its in
@maiden phoenix it still crashes
so my_pos remains nil
i see, that makes sense
Show your whole code
bump
config = {
extra = {
mult_gain = 3,
chip_gain = 25,
consumed = 0
}
},
loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.extra.mult_gain,
card.ability.extra.chip_gain,
card.ability.extra.consumed,
card.ability.extra.mult_gain * G.GAME.consumeable_usage_total,
card.ability.extra.chip_gain * G.GAME.consumeable_usage_total.all
}
}
end,
calculate = function(self, card, context)
if context.using_consumeable and not context.blueprint then
G.E_MANAGER:add_event(Event({
func = function()
card:juice_up(0.5, 0.5)
return true
end
}))
return {
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult_gain } } ..
" " ..
localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chip_gain } },
colour = G.C.MULT
}
end
if context.joker_main and G.GAME.consumeable_usage_total.all > 0 then
return {
mult = card.ability.extra.mult_gain * G.GAME.consumeable_usage_total.all,
chips = card.ability.extra.chip_gain * G.GAME.consumeable_usage_total.all
}
end
end
}
im not sure what the goal is with using my_pos though if you're only using it to get.... the same card you're already referencing
just clone the card directly lmao
Which line is 1572?
card.ability.extra.mult_gain * G.GAME.consumeable_usage_total,
you forgot an .all
fuck
ive been trying to figure out how and i am now fresh out of ideas lol
the rest is good tho right
you daft
Should be yea
shush it
same crash
GOD DAMNIT
Why don't you copy "card" directly?
as i i just plug in card in place of the copys i have rn?
in place of og_card
should i put increments?
Replace og_card in copy_card by card
the card parameter references the card being removed, so there's no need to fetch for it
ok that almost works, its just missing its edition
unless using DebugPlus to add the edition to the joker somehow makes it not work
Remove og_card.edition in your copy_card, that's to remove the edition, not add it
thats what i was thinking after looking at Invisible Joker's code again 🤦♂️
thanks a lot for the help 
yw
is there any way to check for these values
where in this code can i put a message?
if context.individual and context.cardarea == G.play and context.other_card:is_face() then
card.ability.extra.mult = card.ability.extra.mult - card.ability.extra.mult_mod
end
if context.joker_main then
return {
mult = card.ability.extra.mult
}
end
if context.first_hand_drawn then
card.ability.extra.mult = card.ability.extra.base_mult
end
end
}```
(message when mult_mod is subtracted from mult)
how do i debuff a card permanently
ig this
Fuck I forgot that exists
just add a return after that
SMODS.debuff_card(card, true, "source")
Wait
Is it allowed to
Put all your code in one lua?
Vouchers, Consumables, Jokers, all in one lua?
yes
its bad practice however
you can, but you can seperate them to have it more easily accessible
Thank you!
How can I edit the rate at which stickers are added onto Jokers?
need to know for a voucher i'm making
tried looking at documentation to no avail
Good schmorning chat
Morning Dilly
What if I picked up the plane wyd
N hi N what's up N hi
🛌
bump
Im having trouble with the balatro undertale mod (VioMarks on twitter), the folder has inside two folder (undertale and _MACOSX) and i dont know if i have to put both folder separately, only one, or together in the same folder, since the readme doesnt say anything about that. Anyone know how to fix? thanks!
The _MACOSX folder can be completely ignored
it's only there because of the weird way Mac OS does metadata and doesn't do anything for Windows or Linux
you dont need to use the new context just because its there lol
ok thx
However, if i put only the "undertale" folder, the game crashes
could be the version of the game? or the version of the mod manager?
If i want to test how a custom made voucher works when debugging, what command should i use in the debug menu to redeem a voucher for testing
is it trying to spawn itself
it spawns gdaniel
Hover the voucher in the collection and put eval dp.hovered:redeem() in the console
not gdamn
i gotta try it
Thank you!
dunno then, try context.before
in the spawning code?
instead of context.initial_scoring_step
i dont think it should make a difference but i havent looked at how that context is called
fai
r
Did i put it in the wrong place? 🫣
still spawns duplicate
imma do
something rq
is if G.GAME.hands_played a thing
question: is the problem that this code spawn multiple or that it spawns one even if you already have one?
second
Oh
ohh ok then idk what j.ability.temporary is
That’s not what I thought the problem was
You want to only spawn the card if it’s missing right?
yes
So when i was debuging this, I saw it was creating foil playing cards, but I don't want it to spawn playing cards with enchancements.
could anyone help with this?
change the set to "Base"
i thought context.initial_scoring_step will make it so that it counts both jokers
into scoring
turns out only damn scores
not daniel
You should change this crap to use SMODS.find_card then
-# does it work like that
on it
You’re adding it within an event, so it’ll get added after all the calculations are calculated
so what do i do
I don’t know the full idea behind the joker, but it seems it’s intended to be one joker split into two cards?
yes
so here's what it does
the first joker only works like a normal joker
but has 1 in 2 chance to spawn
another joker
and adds score to the hand
and then destroys itself
after scoring
I guess just use add card not in an event within your calculate step
so outside of events for both of them?
Bump
you need to put how many frames your animation has in frames
AHHHHH thanks ill try later
I have a question for "context.post_trigger":
On the wiki it says "for effects after a Joker has triggered",
but while testing I noticed it seems to trigger before the Joker triggers?
I'm currently testing something with "Lusty Joker" (I only play one hearts-card),
when I print the order of operations it goes as follows: context.post_trigger context.individual context.other_joker context.post_trigger context.other_joker
But I would expect, based on the description: context.individual context.post_trigger context.other_joker [...]
individual is playing cards, other_joker is jokers so it makes sense it goes after that
unless im misundertanding something
oh yeah sorry i misread
but the post_trigger can only come after the individual, right?
I mean, the hearts-card is triggering the lusty joker which then triggers the post_trigger, is it not?
yeah that makes sense
why doesnt this code work?
if context.individual and context.card_area == G.play and
context.other_card:is_suit(card.ability.extra.suit) and
(context.other_card:get_id() == 14 or context.other_card:get_id() == 2) then
return {
Xmult = card.ability.extra.xmult
}
end
end
}```
context.cardarea


