#💻・modding-dev
1 messages · Page 498 of 1
try vars = G.P_CENTERS[v].loc_vars and G.P_CENTERS[v].loc_vars({ability = G.GAME.hpfx_ijiraq_savedvalues[card.sort_id][v]}, {}).vars
got it boss
Hey @wintry solar did you seen new UI nonsense I kinda started developing today for no reason?
I did
Does it have chance to live what you think?
it seems interesting for people who are scared of UI code but I am not so it's not useful to me 🤣
if you do all the set up in your api I don't see why it wouldn't be used
i have the same vein of question but about the booster weight thing i pitched ✋
It needs deeper development like, creating some sort of contexts which will allows to make deep cross-references
Basically, invent React in Balatro

probably easier to just write a good guide for UI
like, it's actually pretty simple to do, it just looks overwhelming because it tends to be formatted badly imo
That's also true, but I want to try make some sort of bootstrap over UI to make it easier to pickup
Possibly, easier attaching callbacks, easier elements selecting, etc. Not sure can I make smth more complicated than that
will the or 1 actually stop the game from crashing outside of runs, or do i just not need to do that at all
crashed, here's the line they're talking about
I never coded in lua and it's eating my brain a lil' bit lol
like why is there a comma after end sometimes.... Is it only to end functions??
comma is because theres another element after it in a table
Ah... That makes more sense, I'm not used to the syntax yet
It hurts my brain
why does this show as 1 in-game when outside a run? i can see G.hand existing outside of runs but why is #G.hand.cards specifically 1?
there's 1 card in your hand obviously
which is?
maybe the title screen one?
i suppose so then
i should maybe try
downloading another mod that adds a card to the title screen
and see if that makes it 2
oh yeah theory time
oh ok then
or maybe it has to be another playing card
default value maybe
strange!
since vanillaremade does like a ton of shenanigans with the number of cards in deck for blue joker and stuff to make sure the value actually exists first
oh wait no its probably just 0 and not 1
what if i change it from card to self? is that viable or is this still a "never use self" thing
oml
function Card:get_chip_mult()
if self.ability.set == 'Joker' then return 0 end
local ret = (not self.ability.extra_enhancement and self.ability.perma_mult) or 0
if self.ability.effect == "Lucky Card" then
if SMODS.pseudorandom_probability(self, 'lucky_mult', 1, 5) then
self.lucky_trigger = true
ret = ret + self.ability.mult
end
else
ret = ret + self.ability.mult
end
-- TARGET: get_chip_mult
return ret
end
If I want to patch the SMODS.pseudorandom_probability line, how should I proceed? Can this be done through lovely?
Yes, but why do you want to do it?
I wanna set the numbers as variables -> 1 in 5, being 5 a variable
which i could access and modify with other jokers, don't know if this can be done without patching this
You could hook the function instead and it would be less invasive
I'd hook SMODS.get_probability_vars and check for identifier == 'lucky_mult'
how do i debuff every playing card in the deck and hand with a boss blind
if context.debuff_card then
return { debuff = true }
end
oh wait i think that gets jokers too i forgot about that
you got it eventually
verdant leaf https://github.com/nh6574/VanillaRemade/blob/ead482264d9d4d632cff8692f6c72b03c9c6c0ca/src/blinds.lua#L648
ok actually let me explain it
it's a red light green light minigame
when the local state is 'green' you are free to play cards and earn score. when the local state is 'red' all playing cards get debuffed.
dont say it
what?
then you probably need SMODS.debuff_card
cool blind idea btw
erm if its red and you play it should be an instant lose
this is what i had originally
but i'm too stupid to figure this out
for context i've only ever made 1 boss blind
if its red change the blind to the plant
lol
How do I add bonus mult to a card
with the bonus mult enhancement...?
without an enhancement or edition*
oh i have no idea
._.
gl my guy
do u even know how to do this vro? i could use some help...
-# So you're telling me that you can't send a gif but you CAN send a link to a fandom page to squid games!??!??!?
yes
quite dumb
like hiker? use perma_mult
how do i just add a random number to a delay
pseudorandom probably
yeah that's what i thought
probably just when its red if people do whatever
G.STATE = G.STATES.GAME_OVER
G.STATE_COMPLETE = false
I'm kind of confused on how to set up custom rules for challenges, how would I make a rule that gives an investment tag after every boss blind? (Similar to how anaglyph gives you a double tag after every boss blind)
do you know how to do the WHOLE thing though
wym?
should just be if you have the state on red then it does that
unless you mean you dont even have the whole red and green light set up
no vro... i'm not that smart...
uhh, im not sure
maybe could just find a way to set timers and randomize the timers
idk how easy that is to set up myself though
i want to do stuff with timers soon i just havent gotten around to it
ie total time spent in ante, in shop, in blind, etc effects
do you at least know how to randomize delays?
pseudorandom("seed", min, max)
how do i actually properly set the icon for my mod, i dont see anything referencing icon images in any other mods
vro i js gave up on the blind...
how do I make the name of my rarity translate. like I am trying to translate in french my things but the name of the rarity doesn't translate
the first screenshot is in main.lua and the secont is in fr.lua
is there a good way to add custom functionality to debugplus keysbinds without weird patches, because of how its setup its not really possible to patch the original function definitions and debugplus loads them locally so you have to insert hooks in weird places using patches which id like to avoid if possible
You can make custom commands afaik
does this let you change how ctrl+r works for hovering over something custom
i specifically need to stop the current functionality from happening and do something else
ctrl+c too
Unfortunately, fully hardcoded
Use cross-mod lovely patches ig
Still dk why mod structurized like this
It looks like gamemaker thing
its mostly just for my own testing so i could just like
edit my own copy of debugplus
Also an option
but thats lame
You cannot even check is console opened
This variable is local

For no reason ofc
are either of you guys good enough with info_queues? still trying to figure out this value reference thing
never used it
ive used them
ok so
do you think you have an idea on why hovering over the guy crashes the game?
make a new folder in your mod's folder called libs
i dont actually think you need to do that from what i have just also been replied with
its just an atlas
oh
oopsies
key = "modicon",
path = "modicon.png",
px = 32,
py = 32
})```
also folder names should basically never matter outside of the fact that the assets folder always should be named assets i think
idk
i think only names that matter are the assetsfolder and it's subfolders
forgot to show which line this is
oh damn I completely forgot I was helping with this 🤣
this is within the generate_ui function so let me go find it
its likely that cfg is nil somehow
Is there a way to get the chip value of a discarded card?
change the ability to config here
doing both of these
in both cases or
the problem is that you don't have a card
no just when you call the function
oh wait
can i play a sound in return
just do :loc_vars({}, {ability = bla})
also info_queue is second isnt it so it would be :loc_vars(nil, {...})
well not nil
yeah what eremel said
probably
i just have it play when the hand is played, not when the message is displayed for some reason
I don't know why I didn't just look at my own jokers that do this originally 🙃
omg
testing time 🙏
man
idk maybe im missign something
im not the best at reading crashes
Is there a helper mod that adds a calculate function to challenge decks? It seems really annoying that challenge decks have to modify funtions in order to implement custom rules when normal decks just use calculate function
afaik no but itd be c
N can you hop off /j
how can i play a music when a special boosterpack kind open?
Ok, well I'm just going to implement my challenge deck idea as a regular deck then until that gets changed
maybe my hook's screwing it up???
this is how I do my tooltip that's similar I think
oh my god i dont even have a uibox generation function in this is that it
no wait that wouldnt make sense nvm
ill set up the patch first before trying the left image
so im obviously gonna have to change some things out right
like the last_joker_table loc_vars conditional id replace with G.P_CENTERS[v].loc_vars?
yes
SQUID = HEX("ED1B76"),
GHOSTSALT = HEX("4D1575"),
}
G.ARGS.LOC_COLOURS.silly_squid = G.C.SILLY.SQUID
G.ARGS.LOC_COLOURS.silly_ghostsalt = G.C.SILLY.GHOSTSALT```
Is there a context for the very start of a run? I want to make a deck that starts with a tag, and while it seems easy to make decks start with consumables, I can't figure out how to do it for tags
you have to hook one function
wait a sec
what
G.C.SILLY = {
SQUID = HEX("ED1B76"),
GHOSTSALT = HEX("4D1575"),
}
local loc_colour_ref = loc_colour
function loc_colour(_c, _default)
if not G.ARGS.LOC_COLOURS then
loc_colour_ref()
end
G.ARGS.LOC_COLOURS.silly_squid = G.C.SILLY.SQUID
G.ARGS.LOC_COLOURS.silly_ghostsalt = G.C.SILLY.GHOSTSALT
return loc_colour_ref(_c, _default)
end
thanks you
from this message downwards there is a explanation of what this does (stops at my Cya)
line by line
you can also just do loc_colour() at the top of your code
i believe i can't do this though, as it doesn't work in game?
{C:#1#}#2#{}
info_queue[#info_queue + 1] = { key = 'silly_art', set = 'Other', vars = { "silly_ghostsalt", "GhostSalt!" } }
what
i'm trying to make it so you set the color to change the info queue
you'd use {V:1}#1# and then {vars = {"GhostSalf", colours = {'silly_ghostsalt'}}}
"GhostSalf"
info_queue[#info_queue + 1] = { key = 'silly_art', set = 'Other', vars = {"GhostSalt!", colours = {'silly_ghostsalt'}} }
"Art by {V:1}#1#"
on the infoqueue?
in the colours = {}
thanks you
is this right
How do I modify blind payouts? (For example, if I wanted to make boss blinds pay out $25 instead of $5)
what is this
commit message in vscode
oh i do it through ghub desktop so idk
forgot i have reply pings defaulted off mb
@wintry solar
what does hovering over it say
nothing
just try it
your patch is wrong
you need ijiraq = true in the info queue bit
oh okay
so it triggers this bit of the code
like just under the vars = vars
yeah that's fine
🤔
maybe I messed up the infoqueu?
Here's my final ish version of this atlas
Took way too long lmao, the taser really is funny
Can anyone help me with this?
hook into Blind:defeat maybe?
it took what now...
Then it's not going to show on the blind selection screen I don't think
If you mean an existing blind, you can either take ownership of the center itself to set its dollars property, or when it's loaded into G.GAME.blind, you can directly modify G.GAME.blind.dollars
Otherwise if you want to update the UI while also changing it at runtime while also not making a permanent change to the object center, you're gonna need to hook some UI functions I think
Depends on what you're using it for
What I want to do is change the payout of boss blinds from $5 to $25
That's not specific enough
Do you mean just universally? In general? A Joker effect? When is this applied?
It's a deck effect, so it would be applied universally in the context of the run
Is it specifically 5 -> 25 or does it also apply to final boss blinds as general x5 payout?
I.E. 8 -> 40
A 5x multiplier would probably be better
What you're going to want to do is, in the deck's apply function, iterate through G.P_BLINDS and just do blind.dollars = blind.dollars * 5
I'm not 100% sure if this resets correctly when the run is exited however, let me check
it wont
What's the most effective way to reset it? Because regardless of changing the prototypes/centers being always a lil sus, it's probably the easiest method that doesn't involve UI hooking
I think I probably need to UI hook anyway because that's going to be far too many $ signs
40 isnt that much i think, its quite comparable to investment tag and whatever mod it is that normally shortens the numbers doesnt do so until much higher number
I mean on the blind select screen
ah okay i see
If this is difficult, I'd be fine with just having an "extra payout" on the cash out screen like econ jokers
alright its something with my uibox generation
So for the actual internal blind hud:
function Blind:set_blind(blind, reset, silent)
local ret = ref_set_blind(self, blind, reset, silent)
if G.GAME.selected_back_key == 'your_key' then
self.dollars = self.dollars * 5
-- you can modify this however you want to shorten it, like how the game will do $75 and above
G.GAME.current_round.dollars_to_be_earned = self.dollars > 0 and (string.rep(localize('$'), self.dollars)..'') or ('')
G.HUD_blind:recalculate(false)
end
return ret
end```
For the blind selection screen:
function create_UIBox_blind_choice(type, run_info)
local ret = ref_blind_choice(type, run_info)
if G.GAME.selected_back_key == 'your_key' then
local reward_node = ret.nodes[1].nodes[3].nodes[1].nodes[2].nodes[3]
if reward_node then
reward_node.nodes[2].config.text = string.rep(localize("$"), blind_choice.config.dollars * 5)..'+'
end
end
return ret
end```
and then by changing G.GAME.blind.dollars in the first one, it should also cover the cash out
I think. this is kind of a quick thing that I didn't test but give it a whirl @brave blade
Thanks for the help! I thought about it a little bit, and it might be more elegant and simple if I just add a row on the blind payout screen
winter,,, how good is your info_queue knowledge,,,
That can also work too!!
P good
can you save me from this hell
trying to fix the scaling of the infoqueues to follow the ijiraq's effects instead of just not scaling
In what circumstance does the hover crash occur
i give ijiraq at least 1 joker absorbed
in this case it has the effects of shoot the moon
i hover over it to view the shoot the moon effect (which does NOT scale ofc)
crash
Does it show shoot the moon in the infoqueue?
I mean, is it intended to
well yes it's intended to do that with each joker it absorbed
and before this infoqueue thing, the one i had before showed it fine
BUT it did not render the scaling or dynamic values properly
(think wee, stencil)
Okay I know why it occurs but I need to know what you're doing to cause it. Are you trying to call generate_uibox_ability_table from somewhere in your own code?
Additionally, if you can show the full crash log and where that function is called from, I can help you better
within the ijiraq itself
Show me your code
on it
same crash, but this time it's card.lua instead of common_events
oh right this cool code thing I need to figure out how to do this
CodeSnap extension
also noting that this is solely a ui thing, effects wise everything works perfectly
hi dilly
hi friends quick query how can i change a blinds background splash color easily?
ie in a specific blind during specific events the background changes
pretty sure theres a card that does it in Lucky Rabbit iirc
from winters reaction i wonder if she has done it
i think crisis?
it's just
specifically the function is ease_background_colour_blind()
i get your reaction now
And then within, it's ease_background_colour()
So you can just use the latter one in your blind code or wherever probs
ease_background_colour{new_colour = lighten(mix_colours(boss_col, G.C.BLACK, 0.3), 0.1), special_colour = boss_col, contrast = 2}
This is the vanilla code for blind backgrounds
hmm, would i be able to just pass hex values to it you think
ye
awsum
I had to do a whole load of bullshit to get boss backgrounds to support gradients
Don't recommend
thats unfortunate because i want to also do that later
realizing i forgot to also link 868 and the patch the i.q uses
you did that for him lmao
they do have 3 colour values that you can change
Also yeah looking at it toma, it just looks like whatever you've got saved in G.GAME.hpfx_ijiraq_saved_values isn't correct
Since what you're doing is very similar to what vanilla does to create fake info_queue cards..... but whatever you're trying to set in ability is nil
what does correct mean in this context
ah
and this ISNT a change card to self thing even though the function uses self is it
no I don't think so
ok it crashed regardless before but i just wanted to make sure
i mean in terms of ability directly, maybe it's something here?
I mean that's setting the ability on the card itself
Im suggesting whatever you have stored in the G.GAME.hpfx_ijiraq_savedvalues table is itself bad data
Whatever this is, it's returning nil
maybe it's the way the patch works?? though this is for the effects themselves
maybe if i remove the ability line?
balatro source code uses both "consumeables" and "consumables"
thanks stephen
pretty insane if you ask me
No.
Also it doesn't store the values of the last joker it copies.
it's crashing on shoot the moon rn man
ill worry about that in a little
last time i checked shoot the moon doesnt even have values that need storing
I'm trying to do a lovely injection but it doesn't seem to be injecting, do I need to list it somewhere?
did you put it in a lovely.toml
It needs to be in either lovely.toml or a .toml file underneath a lovely folder
Additionally, it can also fail if you're just patching the wrong file
I have it in ModName/lovely/file_name.toml
Code?
Does this look right? This is my first time doing a lovely injection so it might just be completely wrong
is this not the version of it that saves values
for i = 1, #G.jokers.cards doesn't seem to exist in functions/state_events.lua
Shoot hold on I need to fix something
also yeah what somecom said i cant find that line
I realized the opposite, it appears multiple times
No, it doesn't appear at all.
Most lovely patches have a priority above -1 so you're doing it before any of the other ones are doing it.
Hmm... the one I'm trying to patch is in G.FUNCS.evaluate_round()
Are you looking in the Balatro source code?
Ohhhh wait a minute, does negative priority mean it patches first
I think I know where I went wrong
Are you looking in lovely/dump ?
No, where is that?
Yes
Mods/lovely/dump
In your mods folder, you have a lovely folder assuming it's installed correctly
"dump" is the dump of the actual patched files
Which are only valid at runtime
You shouldn't be looking at that unless you're looking at files that don't get patched.
Oh, got it
how can I fix that then? I thought this was the version with the set_ability
G.GAME.soe_joker_savedvalues = G.GAME.soe_joker_savedvalues or {}
G.GAME.soe_joker_savedvalues[card.sort_id] = G.GAME.soe_joker_savedvalues[card.sort_id] or {}
G.GAME.soe_joker_savedvalues[card.sort_id][last] = copy_table(card.ability)
?
isn’t that here?
or do I have to put it again but with card, and in the joker instead?
No, this goes in the patch.
ohhhhhh
anywhwre in it specifically?
Before card.ability, card.config.center, card.config.center_key, jokers = old_ability, old_center, old_center_key, SMODS.merge_effects(jokers_table)
So I got my patch working now, but for some reason, the G.GAME.selected_back.calc_dollar_bonus() is nil even though I defined it for my card back. Is it not getting copied over because it's a new property or something?
got it
I’ll let you know how it goes
Yes, it's G.GAME.selected_back.effect.center.calc_dollar_bonus
Oh, ok
im tryna get into modding and i have no lua experience, anyone got any resources other than the ones listed on modpage of smods
there's also https://github.com/nh6574/VanillaRemade/wiki but it's complete yet
How would i update a UI lets say every 2 seconds?
so instead of updating it on a button press it updates every those 2 second
hello im trying to make my own balatro deck mod, can i get some help please?
i dont know anything about modding balatro
or code
huh? i cant see the chanel
can you click the link?
OH now it apears me
add a func to the config, that runs every frame
the UIBox config?
wait how would i do that? im looking through the docs on the smods wiki and testing but it seems that i dont understand you correctly
i mean there's func field in the config but that apparently is only called when drawn
{ n = G.UIT.C, config = { func = "my_func" } } and then use G.FUNCS.my_func(e)
i think being drawn refers to the draw function which is every frame
oh
how do you get a card's suit, again?
hey i got a error on balatro
looking for a way to count the number of distinct suits held in hand
ty it works <3
what would i do without you N'
can you send the log?
deck creator like never gets updated i think so that could explain it
just some wierd bug if i had to guess
that never got fixed
ill try to delete it
what is deck creator
that's fire I fuck with it
(bump)
card.base.suit
cheers ^u^
is not the deck creator
you have no other mods though...
just reinstall the game atp
try updating smods
or that ig
rlly?
yes
im going to give you the benefit of the doubt and just say to update it through steam
alr
is there a context for after you've discarded, and have drawn your new cards?
No.
No.
aw
There is context.hand_drawn but that happens every time a hand is drawn.
mm, right
i could work with that?
with a flag that triggers when a card is discarded?
HEHE YOU LIE >:3 i will make this happen! >:3
/in reference to the "No."
/what about that doesn't make sense ;u; sob, anyway
exactly ^u^ thanks!!!
what is the condition that I need to put in a can_use for it to return true only during a round
G.GAME.blind.in_blind?
Is there normally a sound effect for cards being debuffed?
ok
got it to work!! thanks ^U^
Ok, I thought I remembered there being one but I guess not
What's a good way to check which vouchers I have redeemed?
G.GAME.used_vouchers
The keys of used vouchers will be there
What I mean by that is
if G.GAME.used_vouchers.v_overstock then would check if overstock is redeemed
why when I capitalize the F for my consumable type it doesn't work in game but when its a small f it work
In the key I mean
Wdym by "doesn't work"
like it doesnt show in the collection
You mean the key?
yeah
and when I try creating my consumable with a joker it crash
do you have cryptid installed
yeah why
oh shit
objecttypes dont add the prefix like other stuff
No, call it modprefix_Food
quick question! how do i get the amount of money the player has?
oh i
rescind, Vagabond does it
^^; sorry
how do I get my variable to add
Is it crashing?
Wtf is this function chain
yes
wait a minute i show the error menssage
If it works it works ig
One error I suspect is those brackets
add a nil check
where
or 0 inside those brackets
dont work
Same error?
where i put the nil check?
yes
like this?
No
What do you think of this?
I gave you the entire line but without the card.ability.extra
Mr white, i love it
Still thinking bout the effect tho
Yep
now is not crashing but not working
Like not scoring mult?
Yes, in the video i use the world and the moon
I still don't know why you have that abomination of functions
What's your config on the joker?
I tried use the Joker Forge
and it came out that
Good god I'm going to the dev
Sorry
Not your fault
.
Ok so in the place where I told you to place a nil check you replace that line with
card.ability.extra.mult = card.ability.extra.mult + 4
And in the return you replace mult = ... with
mult = card.ability.extra.mult
works but does not accumulate, stays at 4
you can try in 2 var like mult = 0 (thats) what it should be return for giving mult and mult_add = 4 thats waht is going to be add each time you change the suit of a card
and like when you change a suit
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_add
and when you give the mult
mult = card.ability.extra.mult
Then the if check with the abomination probably fails
Then in the loc_vars
loc_vars = function (self,info_queue,center)
return{vars = {center.ability.extra.mult_add, center.ability.extra.mult}}
end,
That the simple way that I use all time
did you add mult_add in the config extra
let me see the code
if context.joker_main and card.ability.extra.mult > 0 then
return {
mult = card.ability.extra.mult,
}
end
use that for when you want to give mult
and make the next part to : Gives {C:mult}+#1#{} Mult for each
and change the 1 here to a 2
this part delete and just write : card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_add
not the last end
only the return
config = {
extra = {
slots_to_add = 5,
ante_requirement = 1,
ante_count = 0,
activated = false
}
},
loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.extra.slots_to_add,
card.ability.extra.ante_requirement,
card.ability.extra.ante_count
}
}
end,
calculate = function(self, card, context)
if G.GAME.blind.boss and context.end_of_round and context.game_over == false and context.main_eval then
card.ability.extra.ante_count = card.ability.extra.ante_count + 1
if card.ability.extra.ante_count >= card.ability.extra.ante_requirement then
card.ability.extra.activated = true
G.jokers.config.card_limit = G.jokers.config.card_limit + card.ability.extra.slots_to_add
card:juice_up(0.8, 0.8)
play_sound('chips1', 1.4)
return {
message = localize { type = 'variable', key = 'a_joker_slots', vars = { card.ability.extra.slots_to_add } },
colour = G.C.BLUE
}
else
card:juice_up(0.2, 0.2)
end
end
end,
add_to_deck = function(self, card, from_debuff)
if card.ability.extra.activated then
G.jokers.config.card_limit = G.jokers.config.card_limit + card.ability.extra.slots_to_add
end
end,
remove_from_deck = function(self, card, from_debuff)
if card.ability.extra.activated then
G.jokers.config.card_limit = G.jokers.config.card_limit - card.ability.extra.slots_to_add
end
end
}
why isnt this working
goal: +5 Joker slots once you passed 1 Ante
add_to_deck is only run when the joker is added.
oh
shit
what do then
did you change the first line of your text to Gives {C:mult}+#1#{} Mult for each
Also, what's not working about it?
no the first line
after 1 Ante, it just does nothing
no
change it
and change the part where you give the mult to that instead
if context.joker_main and card.ability.extra.mult > 0 then
return {
card = card,
mult_mod = card.ability.extra.mult,
message = '+' .. card.ability.extra.mult,
colour = G.C.MULT
}
end
try using ```lua when typing a code
easier readability
if context.bruh then
return {
your_ass = true
}
end
Hi everyone! ill be jumping in for some help if anyone could be so kind.
i already did that, but the game says that the error is in this line
same. first time
write all of this
ups, outdated
i wanna send this image
is the same error
I put that in and now everything is broken
Sorry
revome that
thats the problem
You are good at that.
Me when I recreate Cryptid's forcetrigger
the art work omg they are soo cool
It's from the game the mod's based of, they're awesome yes
yeah
Now does work the add
Aaaaaaaaaa
I didn't make the game if that's the question
screen shot the code again
Now the error is here, but i dont understand why is an error
does anybody mind if i jump in for a hot minute? also?
send the file I'll correct it for you
less complicated
yeah
i like the invitation. thanks. so i have the following:
"{C:green}#1# in number of scoring 7's{} chance to",
"{C:attention}Retrigger{} each scoring {C:attention}7's{}",
"Quantum 7 Dice"
},
also,
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play then
if context.other_card:get_id() == 7 or then
return {
repetitions = card.ability.extra.repetitions
}
end
end
end
}
Are you showcasing it or you have an issue with it?
i have an issue. im not sure how to count the scoring 7's for the chance to retrigger
Maybe this will work? Above your if context.repetition line
if context.cardarea == G.jokers and context.before and context.scoring_hand and not context.blueprint then
card.ability.extra.sevens = 0
for k, v in ipairs(context.scoring_hand) do
if v:get_id() == 7 then
card.ability.extra.sevens = card.ability.extra.sevens + 1
end
end
end
How does one change the text of a UIBox_button every frame?
Edit:
SMODS.Joker{
key = '7 Sided Dice',
loc_txt = {
name = '7 Sided Dice',
text = {
"{C:green}#1# in number of scoring 7's{} chance to",
"{C:attention}Retrigger{} each scoring {C:attention}7's{}",
},
},
atlas = 'Jokers',
rarity = 3,
cost = 10,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = false,
perishable_compat = false,
pos = {x = 0, y = 0},
config = { extra = {
repetitions = ,odds = 4
} },
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play then
if context.other_card:get_id() == 7 then
return {
repetitions = card.ability.extra.repetitions
}
end
end
end
}
Are you returning your vars? Show more of the code
hold
config = { extra = {
base_mult = 1,
base_xmult = 1,
heart_mult = 2,
face_xmult = 0.2
}},
loc_vars = function(self, info_queue, card)
return { vars = {
card.ability.extra.heart_mult,
card.ability.extra.face_xmult,
card.ability.extra.mult_per_heart or 1,
card.ability.extra.xmult_face_bonus or 1,
localize('Hearts', 'suits_singular')
},
}
end,
ignore the or for now
wait
im so dumb
thank you
I don't even need to do anything I'm just that good 😎
alright bro
also, how did the code snippet become color embedded? howd you do that?
Ah! legend
works once per round
how do i count how many 7's are played and scoring?
.
Oops forgot an end
Anyway I'm off for today 👋
does anybody know if all of the following hands are correct?:
type = 'High Card'
type = 'Pair'
type = 'Three of a Kind'
type = 'Four of a Kind'
type = 'Five of a Kind'
type = 'Five Flush'
is high card even a type?
it's flush five instead of five flush
or is it different internally somehow
high card seems correct
im not sure. but im trying to either check if the hand played are the above or just count how many scoring 7's there are
well, played hand and scoring 7
does scoring non-7s count?
as in, does it not interrupt the intended function when non-7s get scored alongside 7s
any scoring 7's. so total number of 7's scored in hand
Played*
i'd suggest to find a different way of counting 7s then. there may be cases when 7s get played in a flush with non-7s, for example
you, my guy, are right. didnt even think of that
how do you set a joker sell value
Hook Card:set_cost
oh right i forgot about this, im SO sorry
somethingcom515 {seals on every} are you in this chat every minute of every day
yes
local cost_dt = 0
local oldgameupdate = Game.update
function Game:update(dt)
local g = oldgameupdate(self, dt)
if G.shop and G.jokers and next(SMODS.find_card("j_tngt_dealmaker")) then
cost_dt = cost_dt + dt
if cost_dt > 0.2 then
cost_dt = cost_dt - 0.2
for i, v in ipairs({G.shop_jokers, G.shop_vouchers, G.shop_booster}) do
for ii, vv in ipairs(v.cards) do
vv:set_cost()
end
end
end
end
return g
end
No.
something, which value is the speed value one
like
the time of the update
LIKE
hold on
its connected to a hook for dealmaker, which changes the shop pricing right
and it updates realtime using the game:update hook
but its really quick
i want to make one thats a bit long
You would change cost_dt > 0.2 and cost_dt = cost_dt - 0.2 to bigger numbers.
so i change the 0.2 to a bigger number?
Yes.
(posting this again)
Is there a way so i can disable the negative filter on a joker? i have one that can only spawn negative
with filter i mean like the shader effect
What is the goal?
probably to make it more or less likely for a joker to be able to naturally appear with an edition
besides the selling value, i want this joker to have 1 in 2 chance to spawn with a negative editon in the shop
Yes.
how
You would use the set_ability function I think.
i see
Hook SMODS.DrawSteps.edition.func
at this point I dont really know what to do
how can i get a joker to cause a hand to not score? i tried this based on some of the code in the boss blinds and it technically works, just acts a little strange. i tried adding some extra contexts so that it didnt act strangely but that caused it not work at all.
how did it act strange
hi dilly
hii
local old_set_cost = Card.set_cost
function Card:set_cost()
old_set_cost(self)
if self.config.center and self.config.center.key == "j_tngt_stonks" then
SMODS.Joker("stonks").set_cost(nil, self)
end
end
is this right
no
shit
what are you trying to do
what did i do wrong
randomize it's sell value
like selling the joker
its doing the message popup (the 'Try Again!') every time i select or deselect a card instead of when its intended to (when you submit the hand)
replace the SMODS.Joker line with self.sell_cost = pseudorandom(...)
check for not context.check when sending the message
k will try
its for the seed right
yes but you might need a min and max values too
yeah
aight
i swear to god i added smods to my workspace, why does it still gives out yellow underline
this will randomize it every time you call set_cost tho so it might be weird
i have another hook to update it in realtime
adding it to the workspace doesn't do anything, you need to have it on the same folder or add it to the settings
(check the new vanillaremade wiki for info :3)
wiki shill
finally
documentations
this is the update hook btw, is it wrong
local volatile_update_dt = 0
local old_game_update = Game.update
function Game:update(dt)
local result = old_game_update(self, dt)
if G.jokers and next(SMODS.find_card("j_tngt_stonks")) then
volatile_update_dt = volatile_update_dt + dt
if volatile_update_dt > 0.3 then
volatile_update_dt = 0
for _, joker in ipairs(G.jokers.cards) do
if joker.config.center.key == "j_tngt_stonks" then
local config = joker.ability.extra
local direction = math.random() > 0.5 and 1 or -1
local change = direction * config.change_rate
config.current_value = math.min(
math.max(
config.current_value + change,
config.min_value
),
config.max_value
)
joker:set_cost()
if math.abs(change) > 0 then
joker:juice_up(0.2, 0.2)
end
end
end
end
end
return result
end
it randomizes its sell value
to update all prices?
just the joker itself
oh really?
yes
alright then, ill delete it
it doesn't, you need to do that but not with a hook
just put the hook stuff into the joker's update function
the cost hook?
no, the update hook
but are you sure this is only for that joker? the code looks like its updating all of them
oh wait no, i didnt see the key line
br
SMODS.find_card already gives you a list of the cards owned tho
i know i can do {C:diamonds} for the suit colour, but this is always the LC colour. how do i do the HC colour? 
i think its based on your settings
i learned it the hard way
what if i specifically want the HC colour though 
i could NOT get contrast specific joker working at all
you would need to make your own loc_colour that references the HC colour
yeah, i have a loc_colour hook, but i was wondering if there was just a colour string i could specify that i wasn't thinking of - i guess i'll adjust my hook, then wait, i don't need to adjust my hook at all, i have a system for just adding whatever colours i want
that's what the hook does in the first place
how can i stop something from happening completly
you will have to be more clear than this lmao
you may need to be more specific.
my tried and true method of stopping anything from happening at all is alt + f4 
you cant use that to stop global warming tho
Oh
its just this i want the line that draws the negative shader to just not activate on x joker
you can hook the function somethingcom said and then if it's not you joker you return the original function and if it is you do nothing
not with that attitude you can't
@daring fern @red flower it worked, thanks
like this? (sorry if its dumb joker forge is the only reason i can do shit)
No.
remind me what the function was to make a string lowercase again 
string.lower
How do I make the game restard when I reset something in the config
trying to make a joker that makes arcanas give an extra choice, but i can't find where the game calls the config.extra value of a booster and creates that many cards
i wish i could code i have so many ideas but everytime i try to learn lua im stuck staring at my screen like "what the factorial"
Card:open()
i wish i wasn't able to code
sorry, it's hard to explain without writing out the code myself. I would really recommend learning a bit of basic lua
The text seems to be located at e.UIBox.definition.nodes[1].nodes[1].nodes[1].nodes[2].nodes[1].nodes[1].nodes[1].nodes[1].config.text
dear god
2 questions:
1: How can i make a joker retrigger itself?
2: Is there a way to check if a variable is greater than 0 in a return?
hey fellas im drawin a blank how can i use debugplus to set myself at a specific ante
how do i make a card (a consumable, a joker) to only be available if the user has a certain mod?
i can answer you the second one
holy shit is that john debug
not sure exactly your use but you can probably use the other in your return to have multiple messages. Otherwise you should justb e able to check the card when doing return stuff
well too slow i guess
forgor to reply
i ask the second because i have 5 scoring variables that could all be 0 or more than 0, and i want each one to score only if they are above 0, so i dont fully understand what you mean but i dnt think that's what id need for that
Jokers can retrigger themselves like they would any other joker.
use variables
local xmult = card.ability.extra.xmult
if xmult == 0 then xmult = nil end
-- etc.
return {
xmult = xmult,
-- etc.
}
or well i guess that one doesn't hit 0
but you get the idea
i dont know how jokers retrigger other jokers, either
G.C.SO_1.<suit> low contrast, G.C.SO_2.<suit> high contrast
oh that's actually really smart, ty!
just bumping in case it gets lost
you can check if a mod exists with lua if next(SMODS.find_mod("modID")) then -- Add content here end
I want to make an API mod that adds "equipables" to Balatro. These would be items that you can add to Jokers that either serve their own function or do something relating to the Joker they are on top of. Ideally, you would also be able to customize them so that the same item can do something different depending on the data given on its creation. I included a mock-up of what one such item could look like. Would anyone be up to help me with this?
Gotcha, will look into it
That sounds like a cool idea, I really don't think they should be that big though
would i put this inside of a function or inside of the "SMODS.'thing'{}" table?
Managing giant cards is a really big pain when you have a lot of jokers (like Huge from cryptid)
No, you would put the SMODS object in the if
okay!
doing this now
hi im home
hello im home
You may have a point. I do believe the hat would be an exception however as I imagine most equitable would be directly on top of the Joker.
hi nxkoo
haaii
I mean hats would just be like offset stickers
i think he's just saying it should be smaller to avoid clutter(?)
it crashed mid transformation
did i mess up?
in the balatro vc
smods discord has one
im not doin much rn except modding so sure why not
Yes, last doesn't exist.
I agree, but the reason I decided I wanted to pursue this is because of what stickers can't do. Stickers are suppose to be general abilities that will work regardless of the Joker they are placed on. I want to these to be able to store individual variables and function differently depending on how they were created and what they are placed on. For example, for the mod I am working on I wanted to store a specific Joker in a sticker that it would transform into. This isn't possible with stickers as far as I am aware.
so i can just have it what i had before then?
I meant more from a technical standpoint
Gotcha
@daring fern what i have in the function is oldcenter.key
sned stack trace
this was supposed to be the fix to exactly that lmao
got it
and what does Lua method 'loc_vars' at file 'Ijiraq/Jokers/Ijiraq.lua:23' loo klike?
can I see your lovely dump of card.lua?
the whole dump or
just the crash
just card.lua
like the whole file?
yeah
ok so the saved valu isn;t anything
why store it on a global table and not just the card itself
yeah like why the G.GAME.hpfx_ijiraq_savedvalues wit the cards sort id instead of just putting it in the cards ability table
the patch uses this safe_set_ability function
what is your goal?
you know how stuff like stencil and wee dont track properly?
no
in infoqueues
no
fym no
I dont't know what you mean
how are you specvifying ythe info qwueu?
What does the patch look like again?
it USED to be this and that was it
sorry I don't understand this code well enough to be much help
it's ok i appreciate the attempt regardless
Try putting card:update(0.016) after safe_set_ability
i should be sending the full log atp
What is that line in the lovely dump?
Assuming the dump is unchanged from earlier
Replace old_center_key with last and put last = k at the end of the for loop.
within or after
In the for loop.
You need to do config = {center = G.P_CENTERS[v]}} in the fake card.
got it
is this replacing the sort_id bit or am i adding?
current config in the joker
Yes, remove that and replace it with config = {center = G.P_CENTERS[v]}}
will hyperfixation actually release
the fact that you have to ask that wounds my soul
will hyperfixation actually release
ok little guy
i need you to get in that guy's mouth
and scale his chips
can you do that
what happened to hi
I take a bite
hi
thank you
OKAY

Do
Do you not use debugplus
no i do i had to add 1 lmao
it took me all of my other ones to get a single 2 before
lol
YEAAAAAAAAAAAAAAAAAAAA-
Hell yea
does that say 16
Yes
death
there's no squareroot fixing this one
Sure there is
there's no *optimal squareroot fixing this one
Sure there is
You're gonna make her snap 😭
he's worse than nxkoo fun fact
Im just a silly guy
i will skin you
Bit rude innit
Does Shoot the Moon double trigger
no
im talking about ijiraq himself
I know, I meant the effect the Ijiraq ate
Shoot the moon does not
oh let me see
Just triggers on queens in hand
im OUT of QUEENs
Ye but I was answering
wdym you're right here
oh my goodnesskflnmmkhm
lol
size bug is still here btw
WEEEEEEEEE
i showered TWICE today
hop OFF
Tell it to the judge he said you didnt pass the test
it doesnt
wack
is it literally just his scaling
oh my god wait
that's the link
all of my scaling
it's all
scaling
it's not that effects trigger twice
it's solely
scaling
that triggers twice
weird
Is that the one jiren guy from that one show
Why is this not changing queens in my deck to Jacks?
I think I know why.
that is judas from the binding of isaac
card.rank doesn't exist.
Gosh darnit I swear I saw that somewhere else lmao
Remove the table.insert(extra_jokers_list, 1, card.config.center.key) and add: lua if jokers then table.insert(jokers_table, 1, jokers) end Outside and after the for loop.
wait did this affect non ijiraq jokers too is it the same issue



