#💻・modding-dev
1 messages · Page 534 of 1
if SMODS.pseudorandom_probability(card, "Better Call Jimbo_Gus Fring_buff", base_numerator, base_denominator) then
can we get a lua ast parser into Steamodded?
base numerator in question is the first number in 1 in 4, while base denominator is the latter
for code manipulation
I NEED A LUA AST PARSER
AAA
-- Thunderstorm
SMODS.Atlas{
key = 'atlas_btct_consumeables_Thunderstorm',
path = 'Thunderstorm.png',
px = 71,
py = 95,
}
SMODS.Consumable {
atlas = 'atlas_btct_consumeables_Thunderstorm',
key = 'Thunderstorm',
set = 'Spectral',
pos = { x = 0, y = 0 },
loc_txt = {
name = "Thunderstorm",
text={
'Select {C:attention}#1#{} card,',
'{C:green}#2# in #3#{} chance to apply',
'{C:dark_edition}Overcharged{}, otherwise',
'{C:attention}destroy{} the card'
},
},
pos = {x = 0, y = 0},
order = 99,
atlas = "atlas_btct_consumeables_Thunderstorm",
unlocked = true,
cost = 4,
hidden = false,
config = {
max_highlighted = 1,
odds = 3,
},
loc_vars = function(self, info_queue, card)
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.odds, 'btct_Corrupt')
info_queue[#info_queue + 1] = {set = "Edition", key = "e_btct_overcharged", vars = {1}, config = {extra = 1}}
return {vars = {(card.ability or self.config).max_highlighted, numerator, denominator}}
end,
use = function(self, card, area, copier)
if SMODS.pseudorandom_probability(card, 'btct_Corrupt', 1, card.ability.odds) then
local corrupt_card = G.hand.highlighted[1]
corrupt_card:set_edition("e_btct_overcharged")
card:juice_up(0.3, 0.5)
else
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
attention_text({
text = localize('k_nope_ex'),
scale = 1.3,
hold = 1.4,
major = card,
backdrop_colour = G.C.SECONDARY_SET.Spectral,
align = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED) and
'tm' or 'cm',
offset = { x = 0, y = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED) and -0.2 or 0 },
silent = true
})
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.06 * G.SETTINGS.GAMESPEED,
blockable = false,
blocking = false,
func = function()
play_sound('tarot1', 0.76, 0.4)
SMODS.destroy_cards(G.hand.highlighted)
return true
end
}))
play_sound('tarot1', 1, 0.4)
card:juice_up(0.3, 0.5)
return true
end
}))
end
end,
})
}
Can someone give me tips to improve my code? It works right now but i also wanna learn how people can utilize stuff easier.
shouldnt the delay in events already be accounting for G.SETTINGS.GAMESPEED
idk
i think this is fine
No idea, the else i dont know anything about
no I think
Still had to have that global. 😅
Sorry, math.random() is preferred here.
pseudorandom if I want to do some actual gameplay stuff.
you can use math.random for stuff like random sounds, random events, whatever
pseudorandom only really matters for gameplay purposes, yeah
I thought it was gameplay stuff
https://github.com/fab13n/metalua-parser
how hard would be exporting this to balatro?
That function is used only by PCMCIA Card.
wat da hell my probability stuff stopped working
it was working yesterday fine??
Whats the problem? It just doesnt proc orrrr…?
did u mak an change in cod
Let me double check this .
Yeah im soup
To make sure blueprint wouldnt trigger i checked for
context.no_blueprint??????
instead of not context.blueprint
no

I really should not have been coding at like 1am
I code better if its 1am or later
The problem is i shouldnt be up at 1am-5am
But i still do it anyways
create_gacha_button = function()
local gacha_button = UIBox({
definition = hpot_gacha_button(),
config = {type = "cm"}
})
end
G.FUNCS.hpot_gamble_gacha = function(e)
print("Let's go gambling!")
end
G.FUNCS.hpot_allow_gacha = function(e)
if false then
e.config.colour = G.C.UI.BACKGROUND_INACTIVE
e.config.button = nil
else
e.config.colour = G.C.MONEY
e.config.button = 'hpot_gamble_gacha'
end
end
hpot_gacha_button = function()
local t = {
n = G.UIT.ROOT, config = {align = "cm", minw = 3.8, minh = 4.6, colour = HEX("00000000")}, nodes =
{n=G.UIT.R, config={align = "cm", minw = 2.8, minh = 1.6, r=0.15,colour = G.C.GREEN, button = 'hpot_gamble_gacha', func = 'hpot_allow_gacha', hover = true,shadow = true}, nodes = {
{n=G.UIT.R, config={align = "cm", padding = 0.07, focus_args = {button = 'x', orientation = 'cr'}, func = 'set_button_pip'}, nodes={
{n=G.UIT.R, config={align = "cm", maxw = 1.3}, nodes={
{n=G.UIT.T, config={text = localize('k_reroll'), scale = 0.4, colour = G.C.WHITE, shadow = true}},
}},
{n=G.UIT.R, config={align = "cm", maxw = 1.3, minw = 1}, nodes={
{n=G.UIT.T, config={text = localize('$'), scale = 0.7, colour = G.C.WHITE, shadow = true}},
{n=G.UIT.T, config={ref_table = G.GAME.current_round, ref_value = 'reroll_cost', scale = 0.75, colour = G.C.WHITE, shadow = true}},
}}
}}
}}}
return t
end
why does the game crash when i run create_gacha_button()

What is NFS?
VanillaRemade mentions NFS in NFS.getDirectoryItems but i cannot find anything about what NFS actually is
NFS is nativefs
tldr it helps you load files en masse
is there a way to easily figure out when a glass card specifically breaks or would i need to hook shatter() or smth
Thanks, and yes i am as i decided to split everything into a separate lua file for my own sanity.
And until now i've been relying on a big table that specifies everything i need to load.
Breaks or is destroyed by any means
You would check for card.glass_trigger
just breaks from the probability check i had meant
like if card.glass_trigger == true or
check glass joker in vanillaremade
you'd think glass joker triggers off any destruction but it doesn't
it's ONLY natural destruction and hanged man
Yes, but you should just do if card.glass_trigger
im having trouble with this tarot, i copy paste the code from vanilla remade but on use the game crashes and i cant tell which is the problem here, someone can help me?
bump?
you're missing a mod prefix
in mod_conv
what i should put?
My mod now automatically loads every .lua file 
So now i can make new stuff without ever touching main.lua again
W
Yes, it would be m_modprefix_balanced
litteray that?
No, modprefix would be your mod prefix.
remove from deck supports from debuff as well right
yes
thanks bestie
what function could I hook to activate an effect when a run is won
how do i check if a sprites soul pos is this specific y?
win_game
if card.children.floating_sprite.sprite_pos.y == number
if lose run, win run. if win run, lose run 
ok thanks
if Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.children.floating_sprite.sprite_pos.y == 4 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 10 then
Flopprobj.soul_pos.x = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.children.floating_sprite.sprite_pos.y == 5 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 11 then
Flopprobj.soul_pos.x = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
end
im tryna make the animations change if the sprite soul is a specific y, the problem is the game crashes cause children is nil, how can i fix this?
Flopprobj is not a card.
It would be Flopprobj.soul_pos.y == number
ahhhh i see
how do i check joker rarity again
having a bit of trouble getting my card to "soul replace" my other cards. the soul_set is set to the correct set, and soul rate is 100%, so i'm unsure why it's not working
is it card.config.center.rarity?
yup
cool great
works now thanks, only problem now is the joker code not changing its sprite
if context.individual and context.cardarea == G.play and context.other_card:get_id() == 14 then
card.children.floating_sprite:set_sprite_pos({ x = 0, y = 5 })
return {
xmult = card.ability.extra.xmult
}
end
Are you using a booster pack?
Do the cards created have soulable = true?
is that not on by default?
No.
then no let me do that
did I change the sprite wrong? Or is it cause its animated that some stuff need to be added to actually change?
function for exiting shop?
context or function?
function
like, to force you to exit the shop?
G.FUNCS.toggle_shop
also adding soulable = true changed nothing
it still does not appear
is that not going to hit when you enter the shop as well
No, I don't think.
oh okay
bump
math.round() doesn't exist?
Yes.
math.floor(0.5 + value) does that iirc
ahhh
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and context.other_card:get_id() == 14 then
card.children.floating_sprite:set_sprite_pos({ x = 0, y = 7 })
return {
xmult = card.ability.extra.xmult
}
end
end
does nothing happen or the sprite is gone
nothing happens
mm
want the function for anim?
probably not the correct place to use :set_sprite_pos then, i assume
prob
if its the correct place then it should either change the sprite or completely disappear (choosing a blank spot on the spritesheet)
it would go to checkmark cause y7 is the last one
maybe its cause the animation is always updating?
oh wait, it is?
can you show me that update code
thats likely the case
yeah its def that update code, i just tried running the code on my end and it works
just know its a big elseif thing cause idk how to code good and i still have to figure out changing variables inside a joker to outside the joker
-- FlopprAnimations
local btct = {ticks = (5)}
local upd = Game.update
local btct_Floppr_dt = 0
function Game:update(dt)
upd(self, dt)
local Flopprobj = G.P_CENTERS.j_btct_Floppr
btct_Floppr_dt = btct_Floppr_dt + dt
if Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 1 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 2 then
Flopprobj.soul_pos.x = 1
Flopprobj.soul_pos.y = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 2 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 2 then
Flopprobj.soul_pos.x = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 3 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 2 then
Flopprobj.soul_pos.x = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 4 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 10 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 5 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 11 then
Flopprobj.soul_pos.x = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 6 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 12 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 16 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
end
for k, v in pairs(G.I.CARD) do
if v.children.floating_sprite and v.children.floating_sprite.atlas == G.ASSET_ATLAS["btct_FlopprAtlas"] then
v.children.floating_sprite:set_sprite_pos(Flopprobj.soul_pos)
end
end
end
yeah the soul sprite is being force-set here
Is there any expected colour to use for emult?
ah, on which line tho? every?
usually X:dark_edition,C:white
G.C.DARK_EDITION
Thanks 
v.children.floating_sprite:set_sprite_pos(Flopperobj.soul_pos)
what would be my best option here to not force it?

i tried removing the for k, v in pairs(G.I.CARD) do but all it does now is just put it on the proper position but its just on x=0 and not update
😭
do you think i can set a boolean variable on the joker and put an if before the for?
set something in card.ability to tell the update code which y it is at, and animate accordingly
this works too
Ill try this cause it seems less complex than what i recommended
Also how do i access a local variable inside a joker code to outside the joker code? Can i make it global to check it from outside?
add the variable to card.ability
Then what? How do i call it?
G.gacha = G.gacha or UIBox{
definition = G.UIDEF.gacha(),
config = {align='tm', offset = {x=0,y=G.ROOM.T.y+11},major = G.hand, bond = 'Weak'}
}
``` is there anything wrong with this UIBox or is the issue with the definition function
bump? (idk what order to put these in and have them not crash my game
move the random joker thing to after the for loop
alrighty
Okay so my mod went from okay to cryptid level very fast
now how do I tie this to a table that I have?
I added a card called David, it's legendary but if you get it then the game is over, as it retriggers every card twice
I think ik why people don't retrigger jokers now
But it's a nice op card the rest of my jokers are tame....
how do I get an achievement to unlock itself once its conditions are satisfied
are there any issues with this definition function i'm missing?
returning true doesn't seem to be working?
what conditions
i have all the conditions already done
i've done everything and i know it's reaching the achievement code
the achievement just isn't getting unlocked for some reason
you're sure check_for_unlock is being called?
yep
i put a print inside the checks in the achievement and it gets there
can I not do something like
unga = true
return unga
did you unlock all
do I need to do return true directly
bypass_all_unlocked is- waaait
I need to set that to true don't I
not false.
I thought what that did was make it so the unlock all button would or would not unlock your achievement
unlock all doesn't unlock achievements it unlocks like. jokers
had no idea
not much of an achievement if you get it by pressing one button
the sprite isn't aligned properly
but other than that part I did it
it worked
achievement sprites are
66 x 66 right
is it possible to make a joker buff another of the same pool
like say i set something like popcorn with mult loss to say that the mult itself is "cyberwear" then can i have a joker that buffs all jokers that use "cyberwear" as context by 2x
so instead of popcorn doing 20+ whenever i had this other joker it would be 40+ at base instead
if thats possible....
or should i just leave that as a consumable
How do I check for a joker being in a pool
Like as a check for the calculate
Context.other_joker.object_type == ? Would that work
Ima try that
Is there any way to change the order of a mod's items in the collection screen outside of load order?
this is new
okay so im just adding a custom rarity but would it automatically st itself to be rarity 5 ? or do i need to define that, the remade doesnt really show that
it'd be your mod prefix then an underscore then the key
?
what part don't you get
G.UIDEF.gacha_button = function()
local t = {n=G.UIT.ROOT, config = {align = 'cl', colour = G.C.CLEAR}, nodes={
UIBox_button({ button = "hpot_open_gacha", label = { "Gamble" }, minw = 5 })
}}
return t
end
chat i'm going insane why does this crash on load
just tell me i'm not crazy
how do i access an ability.extra on a function for a joker outside of the joker code?
vanilla balatro has a G.UIDEF right
it comes up with yellow lines underneath like something is wrong
send screenshot
example for you
ok thank you
specify a bit more, please
the weight's in the rarity usually
defaults to 0 afaik
the specific rarity here doesn't appear normally
hmm I wonder what this is for
that's smth you'd do yourself, i did no weight for my own reasons
oh ok so just add that if i want
at least you can help me
ok thats fine thank you
so im making an animation, and i want to set a variable to the current y then tell update which y it is at
I am not smart enough to help, my knowledge is limited to what jokerforge knows lol
like here
...
ability.extra would be at card.ability.extra
i not very smart and get confused
bump, this is an error ive never seen before
have the gods simply cursed me
real
it still says common in game i dont get what i did wrongggg
what do you think random_joker.T.r is doing
random_joker is a table with a joker in it.
nevermind i was dumb
I'm not entirely sure, but I don't think I entirely need it lol oopsies
Crazy win more machine
I'll remove it ande see what it does
No, the problem is random_joker is a table with a joker in it, not the joker inside the table.
Remove the {} around pseudorandom_element
Oh, Iwas told to replace all instances of card to that
so would " if context.other_card.config.rarity == 'mm_cyber' then "work
to get this you need to beat a blind that has 3-7x (i forget exactly) multiplier, i felt it balanced out
where should I move it to?
No, you would remove it.
Also object_type == "DoctorPool" == true will always be false
So basically just beating a wall/vv
yeah, on ante 4
You would want if v.config.center.pools and v.config.center.pools.DoctorPool
is enhancing jokers from a different joker even possible ?
ive done it with editions before
thank you, I probably wouldn't have gotten that lol
it should be
Yes.
like multiplying the base value by 2, i used popcorn as an example but instead of it being +20 it would be +40 if it used instead of mult but a seperate term in he config like cyber
im just struggling with it
Yes.
not something very simple i figured
but im trying
i just get a crash from a nil context
no matter what i do
Like Cryptids Gemini?
wait thats a thing
ok now im confused on how to do this, wdym tell the update code which y it is at?
here we go again
let me check their code hold on u might have saved me
i cant find it
Is the key for the SMODS.ObjectType DoctorPool?
used ctrl+f and typed it in but no results
Yes, it's called gemino in the code.
in the misc_joker file yeah ?
No, it's an exotic.
The DoctorPoll is the object type, but I'll change that to the set key
this looks complex as all hell is this worth it... god needs to shine light on me because i will die from this
I have a much simpler function for this though.
should I be able to change the object_type = "ObjectType"
you do
function SEALS.modify_joker_values(card, modifytbl, exclusions, ignoreimmutable, nodeckeffects)
if not card or not modifytbl then return nil end
if card.config.center.immutable and not ignoreimmutable then return nil end
local cardwasindeck = card.added_to_deck
if not nodeckeffects and cardwasindeck then card:remove_from_deck(true) end
exclusions = exclusions or {}
local ops = {"=", "+", "-", "*", "/", "%", "^"}
local function modify_value(ref_table, ref_value, isdirectlyinability)
if type(ref_table[ref_value]) == 'table' and (ignoreimmutable or ref_value ~= "immutable") then
for k, v in pairs(ref_table[ref_value]) do
modify_value(ref_table[ref_value], k, false)
end
elseif type(ref_table[ref_value]) == 'number' and ((not (exclusions[ref_value] == true or exclusions[ref_value] == ref_table[ref_value])) or not isdirectlyinability) then
for i, v in ipairs(ops) do
if modifytbl[v] then
ref_table[ref_value] = SEALS.perform_operations(ref_table[ref_value], v, modifytbl[v])
end
end
end
end
for k, v in pairs(card.ability) do
modify_value(card.ability, k, true)
end
if not nodeckeffects and cardwasindeck then card:add_to_deck(true) end
end
where do i add the config in which it changes
the ref table
and ref value is the value im multiplying by im guessing
In your case it would be modify_joker_values(card, {["*"] = 2}, {x_mult = 1, x_chips = 1})
i dont understand any of this and vs code is saying everything about this is wrong what is going on
Code?
Did you put it outside of the joker?
wait i need it outside
mb
okay i put it outside and change u said after and now its still crying at me
What is it saying?
bump
everything
feel like ive just been given a newborn that cries all the time
No, I meant that when you call the function you would do modify_joker_values(card, {["*"] = 2}, {x_mult = 1, x_chips = 1})
oh
yellow is usually just an undefined global but still works (in my experience), red is what needs attention
You need to keep everything the same except remove the SEALS
ok
the line SEALS.perform_operations(ref_table[ref_value], v, modifytbl[v]) when seals is removed it shows yellow under
undefined global
local function perform_operations(val1, op, val2)
if op == "=" then return val2 end
if op == "+" then return val1 + val2 end
if op == "-" then return val1 - val2 end
if op == "*" then return val1 * val2 end
if op == "/" then return val1 / val2 end
if op == "%" then return val1 % val2 end
if op == "^" then return val1 ^ val2 end
end
local function modify_joker_values(card, modifytbl, exclusions, ignoreimmutable, nodeckeffects)
if not card or not modifytbl then return nil end
if card.config.center.immutable and not ignoreimmutable then return nil end
local cardwasindeck = card.added_to_deck
if not nodeckeffects and cardwasindeck then card:remove_from_deck(true) end
exclusions = exclusions or {}
local ops = {"=", "+", "-", "*", "/", "%", "^"}
local function modify_value(ref_table, ref_value, isdirectlyinability)
if type(ref_table[ref_value]) == 'table' and (ignoreimmutable or ref_value ~= "immutable") then
for k, v in pairs(ref_table[ref_value]) do
modify_value(ref_table[ref_value], k, false)
end
elseif type(ref_table[ref_value]) == 'number' and ((not (exclusions[ref_value] == true or exclusions[ref_value] == ref_table[ref_value])) or not isdirectlyinability) then
for i, v in ipairs(ops) do
if modifytbl[v] then
ref_table[ref_value] = perform_operations(ref_table[ref_value], v, modifytbl[v])
end
end
end
end
for k, v in pairs(card.ability) do
modify_value(card.ability, k, true)
end
if not nodeckeffects and cardwasindeck then card:add_to_deck(true) end
end
```?
Replace everything with that.
it has been tamed
able to help me with this?
i still have a problem with my context being nil on the joker itself
im just using the line if context.other_card.config.rarity == 'mm_cyber' then and it isnt working
Code?
its mainly just unfinished but its saying the context is nil i havnt been able to play with the actual return or anything
or do i need to define that this joker is not involved
wait no im already doing that nvm
should i do it for the start of a round
Yes, it would be calculate = function(self, card, context)
oh woops
it normally autofills right
dk why it di that
other card has a nil value
eh but it doesnt
Yes, context.other_card doesn't always exist.
does it not here
it also is only crashing when i add another card to my hand
well joker
so am i not giving it the context
and then for some reason after it tells me that the context it nil
-- for loop for animation
if Flopprobj.card.ability.extra.flopprTrigger then
for k, v in pairs(G.I.CARD) do
if v.children.floating_sprite and v.children.floating_sprite.atlas == G.ASSET_ATLAS["btct_FlopprAtlas"] then
v.children.floating_sprite:set_sprite_pos(Flopprobj.soul_pos)
end
end
end
local Flopprobj = G.P_CENTERS.j_btct_Floppr -- what Flopprobj is
how do i access card.ability.extra.flopprTrigger? like its a function outside the joker so i cant just do card right?
-- FlopprAnimations
local btct = {ticks = (5)}
local upd = Game.update
local btct_Floppr_dt = 0
function Game:update(dt)
upd(self, dt)
local Flopprobj = G.P_CENTERS.j_btct_Floppr
btct_Floppr_dt = btct_Floppr_dt + dt
if Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 1 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 2 then
Flopprobj.soul_pos.x = 1
Flopprobj.soul_pos.y = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 2 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 2 then
Flopprobj.soul_pos.x = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 3 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 2 then
Flopprobj.soul_pos.x = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 4 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 10 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 5 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 11 then
Flopprobj.soul_pos.x = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 6 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 12 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 16 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
end
if Flopprobj.flopprTrigger then
for k, v in pairs(G.I.CARD) do
if v.children.floating_sprite and v.children.floating_sprite.atlas == G.ASSET_ATLAS["btct_FlopprAtlas"] then
v.children.floating_sprite:set_sprite_pos(Flopprobj.soul_pos)
end
end
end
end
bepis said i could just set a boolean and put the if before the for but i def didnt do it right
what are you animating it by
im too tired to read through your code, what events do you want it to animate by? You said "we're playing different animations based on different conditions"
if i wanna check context.other_card but that doesnt exist what should else i put to not cause a nil crash
only a few contexts have context.other_card
so the main problem is not being able to change the y because the for loop locks it.
in the joker code i change the soul sprite to x = 0 and y = 7 but because of the for loop it locks me from changing it.
im using config.rarity but no matter what i do i always crash when adding another joker
even one with a matching rarity
bepis said to "set something in card.ability to tell the update code which y it is at, and animate accordingly" but my idea also works too but i cant figure out how to do either 😭
this is my last project of the night i js need the pain to be over 🤣
That'd be because it doesn't exist
real
i mean the way im using it , it does
I've put off this mod project for a while because of this stupid Spectral
if context.other_card.config.rarity == 'mm_cyber' then
you aren't getting my question: what are the events that you want the card to animate for
again: that doesn't exist.
its fine for me tho
and i am seeing ur using vs code like i am
so whats different and why is mine fine
the red line was unrelated look at the big box above it
its because u havent defined a rarity thats why its red
idk then but it has worked before
i feel bad for the people that live here
i used it in a different mod to retrigger specific raritys
hold on let me just whack up a retrigger joker with it and check if im going insane
I live in a wonderful society...
also, you're using other_card which is not the same as other_joker
one is for playing cards
one is for jokers
nvm that didnt work either
i mean still worth trying with my joker ig
no it wasnt
how else can i check the rarity of jokers
so theres 7 animations, anim 1 is booting up so anim 3 4 6 7 will all resort to it after its animation is finished, once anim 1 is finished it resorts to just 1 sigular sprite.
anim 3 4 will be activated after a certain amount of time
anim 2 will be activated cause i change y to their y anim on the sprite sheet but they will go to whatever i change a variable to
anim 5 will be activated cause i change y to their y anim on the sprite sheet but wont stop doing the anim till the round is over
anim 6 7 will be also be activated cause i change y to their y anim on the sprite sheet but they go to anim 1 directly
5.) activated for current score being less than half the blind score and have only one hand
6.) activated for not having an ace in the played hand
7.) activated for having an ace in the played hand
-# (srry theres alot)
that is... very complex
indeed
a lot of for loops and a lot of if statements
real
im just tryna figure out how to change y and the anim changes to that one
i can do the rest
-# (probably not but eh)
good luck with that, you'll need it
😭
now is there anyone able to help me with this?
im going to do a lot of testing, if somethingcom comes back then ignore me and take their advice but if not ill update you and @drowsy heath
thank you
thank you
also i dont think somethingcom knows about my problem 
this exists
ill try putting in joker code
Just use that when you want to change it's y
i think it works now thanks so much, now to just figure out how to NOT make is do the animation for like half a second. Any idea as to why this happens?
-# sorry for asking so much
...
Ever hear of game event manager?
fun fact: 
i apologize but i can't find anything, you'll need to wait for someone smarter than me to come along (which happens a lot in this channel)
maybe N can help
-# if he was here
fun fact: thanks!
N needs to sleep, too
yes
thats ok ill just head to bed now anyway its just reached 10 to 8 in the morning and i dont feel like working on it rn ive lost hope on ts
ask when you wake up, there should be someone smarter avalible to help
probably will do
actually shi i cant go to sleep
i have to meet with people in a couple hours
i have made a mistake well im off anyway
thank you my goat creature
@drowsy heath update:
How does printing help tho
it tells you if the rarity is working
Idk how that works or how it checks for that specific rarity
Ik it's working tho bcoz it shows seperate in the game with the cyber title
this should work on context.other_joker (testing now) but context.other_joker only exists in context.other_joker (i dont get why that is either)
it tells the rarity of that joker when its played (as long as you have debugplus)
Ofc
...
i used the print to see if config.center.rarity exists...
oh
did i or did i not just say it printed properly.
this exists and is probably what you're looking for, it can only be used in context.other_joker
im leaving before i lose it, im sorry i was unable to help you @sleek cliff
I think I'll wait til more people are on tmr to ask for help since theres not a lot of people on rn (at least thats what I see)
Wait but how do I define the rarity
ur fine lol
-# must i spell it out for you with blocks
Give me a minute
I took a 2 month break from coding and came back yesterday I forgot a few things
Been busy so I feel like I'm back at square one
It all starts with E4
I'm sorry for taking out some anger on you there, it was misdirected and i shouldn't have. You don't need to define config.center.rarity as it already exists, its what you put in the rarity part of a joker (see image 2). Image 1 is what you're looking for if i understood everything correctly
Thanks I'll put it to use now and honestly I'm fine with people taking it out on me we all know how infuriating this can get
real
Yes but I shouldn't have taken it out on you, so the right thing is to apologize
also it says context has a nil value so im just gunna try find something to fix it later coz its rlly starting to get on my nerves coz ik ts possible
Are you in context.other_joker when using that if statement?
yeah same way u wrote it
No, I mean what context is that if statement in?
i think my brain has melted from being awake too long but i should understand what u said yet i dont, ive managed to code over 34 jokers and still get lost when people say things and ive been up too long
that if statement (that i showed earlier) needs to be in this if statement
also that's fair, tiredness affects us all
still under the function yeah
yes, but it needs to be in a context if statement, specifically the one in this image
example
ahhh okok
it didnt crash when i added another joker but when i tried to play a hand and still the same error
hold on let me check something tho
its the second if statement which causes the crash of nil
im officially lost again, well ill leave you to your freedom ill try have a proper crack at this for a few minutes before i get annoyed
idk why it wouldn't, i have checked multiple times and every time it's worked for me
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
G.E_MANAGER:add_event(Event({
trigger = "immediate",
delay = 0.1,
func = function()
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 16 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
return true
end
}))
end
so uh... my stupidity led me to this. It works! problem is it doesnt stop the elseif (i think) soooo... this event just keeps happening and since it puts it to a different sprite, its just going through the wrong sprites again and again after the proper animation works. 
(actually right now its wierd, it goes to doing smth wierd then i replenish cards then it goes to normal...?)
wait now im being dumb
i saw that but i couldnt reply cause i was editing the thing
i got it to work in the end, i was tired and anywhere i was supposed to put a word beggining in c i put context
beginning
idk what the right spelling is rn
but its not multiplying itself and idk why
so ima just quickly fix that
at least im not the only one doubting myself
Hello. Does anyone that knows UI wizardy know how to get this card area element thing?
the day i learn ui is the day i...
idk what day it'd be, but good luck with it!
The day i learn ui will happen after i die
the day you realise ur dreaming
hi
does anyone know how to check what the first card drawn to hand is gonna be for any given seed before the first blind is started?
i tried checking misprint and its code but it just showed me the default 11c in game so i dunno
the deck is shuffled when round starts
Yep
That's why I cut my losses
Well I tried just always viewing the next card drawn and failed that too but that's bcoz I'm stupid
how would i make a timer in boss blind?
you need to check G.deck.cards[#G.deck.cards]
the deck draws in reverse order
Don't forget to check if G.deck exists
i always forget to check if my cardareas exist before doing arithmetic on them ngl
does SMODS.add_card/create_card support an options field like poll_enhancement and poll_seal do
you can assign those functions to a local var before hand then do edition = edition
why edition?
idk that's just what I call my variables, for example when I do main ends I just call them local main end =
you can call it whatever you like tho ^^
in fact you don't even have to assign them to local variables you can call poll eiditon in the add_card
No.
is there an equivalent for it in those functions
i don't think there's poll enhancement or seal functions unless you create them
there are
bump idk help
qhat isn't working?
im assuming you want to put cards in it
when I did that I created and assigned the card area out of the nodes with local ca = CardArea... then used ca:emplace()
no, you need to make an ObjectType
(a list with pseudorandom_element works too of course)
You declare the card area elsewhere and them add the card area to the node or..?
the only example I have of it is in a main end where i declared it above my local main_end = if that makes sense
Crazy thing, I was sleeping
I woke up and saw my phone was still unlocked lmao
Also delayed hello to you also
ok, i got the target the card area thing to work. Now uh... am I doing this right?
The card area does say that a card is being added, but there is like, no card.
where tf is my card
Position 20 20 is very out of screen
I tried 0 0
I do not know how those values work for creating cards
And 3 3
Nothin'
what's the cardarea code
are the pools in G.P_CENTER_POOLS just lists of keys?
you need to hook more functions for a type to work correctly
ah
you missed return in can_highlight btw
they're lists of centers
Also will be better to totally override functions for specific card area rather add even more type checks
?
I have like -15 experience in function hooking.
You have card area instance, instead hook them, write own ones
How would I get my card area to do that huh what?
are they indexed by keys like in P_CENTERS or do i need to grab the config.center.key of a center in the pool to get the key?
the second option but it's just .key because it's already the center
is there a consumable equivalent for context.joker_main?
No, because it's still context.joker_main
Hi smt
does anyone know how to force close a booster pack? im doing something intentionally funky witch means it cant close the normal way by skipping or choosing.
G.FUNCS.end_consumeable()
thank you!
i dont think I get drawstep order, or my method of applying an overlay is fucked? I have a drawstep that draws a transparent overlay sprite over the base card, but ive tried every order, and seals still get drawn under the overlay, when i want seals to go over them
seals have drawstep order 30, right? well seals look like this with order 29 and 31
self.children.sand_overlay = Sprite(self.T.x, self.T.y, self.T.w, self.T.h,
G.ASSET_ATLAS['maxboism_CustomEnhancements'], { x = 0, y = 0 })
[...]
self.children.sand_overlay:set_role({ major = self, role_type = 'Glued', draw_major = self })
this is my method for applying the overlay sprite
the [...] is the standard hover/click/drag/can collide stuff
i’m not sure i thought the order was 80 or something for seals
this is how i do it for shader + png
But on the back of the card
i remember it drawing under the seal when i had 80 order
or something idk
i just tried 81 and 79 and its still the same
its def the way i render the overlay sprite
or its a case where alt + f5 doesnt reload everything properly
one moment
ok no its not that
ret is something like
mult = 5,
attack_type = {"attack"}
what it does is its supposed to convert a certain percentage of mult into chips, but for some reason its being triggered twice, so if the percentage in question is 25%, its actually giving 5 chips instead
help
Hehe sis is typing
i checked and its not running the function twice
its something with the logic here and i cant figure it out
twice ?
yeah, i assumed its, doubling the percentage because its running the function twice, but its not
but also, when im running the function outside the joker it works, so idk??
hi bepis
hi dilly
effect_type = {"attack"}, right?
N ♥
hi dilly and wepis
do i not get a shatout
a yea, effect_type
hi s
what Stacked.ismult, Stacked.ischips does is just, checking the index to see if its mult, mult_mod, chips, chips_mod, etc etc
the ischips check is just in case theres chips_mod so i can change the message
is it maybe because youre adding stuff to the table in the middle of an iteration
it might work depending on the order pairs goes through it
Umm actuwally you can’t because balatro uses the framework smods which is made by lua 🤓
kee observation , solution ? Just make balatro with c# and include modding support without lovely
Kee
i think it might have to do with what i said
mm
if it inserts chips before mult it might be running mult again
uh
the problem seems to be that its seeing effect_type twice somehow
i think ur onto something, maybe i should add the stuff after the for loop?
probably something like this
OH MY GOD IT FINALLY WORKS
thanks N' 3:
if im increasing values in a cards ability or ability extra is there a way i can see what value is applied to the denominator argument for the probability vars? im trying to catch cases where odds are in extra in order to not modify those
like for example if i have
SMODS.get_probability_vars(card, 1, card.ability.extra.eternal_odds, 'eternifier_eternal')
instead of
SMODS.get_probability_vars(card, 1, 2, 'eternifier_eternal')
does context.denominator still pull the ability in this case?
---@param cards Card[]
---@return table <number|string,number>
function CHAR.FUNC.check_played_rank_deck(cards)
print('Updating highest played...')
local cards_played_bleh = {}
local cards_id_played = {}
local highest_played_val = 'None'
local highest_played_id = 1
local highest_played_num = -2 --why cant i just use a small number? fuck you
for k,_ in ipairs(cards) do
if not cards_played_bleh[cards[k].base.value] then
cards_played_bleh[cards[k].base.value] = 0
end
if not cards_id_played[cards[k].base.id] then
cards_played_bleh[cards[k].base.id] = 0
end
cards_played_bleh[cards[k].base.value] = (cards[k].base.times_played > 0 and cards_played_bleh[cards[k].base.value] + cards[k].base.times_played) or 0
cards_id_played[cards[k].base.id] = (cards[k].base.times_played > 0 and cards_played_bleh[cards[k].base.id] + cards[k].base.times_played) or 0
end
for k,_ in pairs(cards_played_bleh) do
if cards_played_bleh[k] > highest_played_num then
print("Highest played val " ..highest_played_val)
highest_played_val = k
end
end
for k,_ in pairs(cards_id_played) do
if cards_id_played[k] > highest_played_num then
highest_played_id = k
end
end
print("Highest played is " .. highest_played_val .. " with an ID of " .. highest_played_id)
return {rank = highest_played_val, id = highest_played_id}
end
this is just.. outputting the entirely wrong thing ??
Could someone help? I just wanna gamble...
how would I properly give a consumable type a name and description using localization/<locale>.lua?
Any way to get Balatro to have a different save folder?
As in; I need to get the Linux version of Balatro to pretend really hard that it should use Steam's emulated C root's save folder
A symlink doesn't seem to work
how do i get the width and height of the balatro window?
how do you mess with the screen shake
how would i position a button above the deck?
Haya DOS pack should have that
where
@unborn bay i forgot where
G.UIDEF.gacha_button = function()
local t = UIBox{definition = {n = G.UIT.ROOT, config = { align = 'cm', colour = G.C.CLEAR, minw = G.deck.T.w, minh = 0.5 }, nodes = {
{ n = G.UIT.R, nodes = {{n = G.UIT.C, config = {align = "tm", minw = 2, padding = 0.1, r = 0.1, hover = true, colour = G.C.RED, shadow = true, button = "hpot_open_gacha", func = nil}, nodes = {
{n = G.UIT.R, config = { align = "bm", padding = 0 }, nodes = {
{n = G.UIT.T, config = { text = "Gamble", scale = 0.35, colour = G.C.WHITE}
}
}},
}}}}}},
config = { major = G.deck, align = 'tm', offset = { x = 0, y = -0.35 }, bond = 'Weak' }}
return t
end
why does this crash when the ui element is loaded
(unsure if this is the right place to ask)
would it be more readable/understandable to have the base mult in the parentheses, or the temporary mult?
I feel like itd be easier to understand if you color-coded the temporary mult
and maybe have it like +(20 + 29) Mult
the +s and the () would be red, along with the permanent mult, and maybe have the temporary mult just be orange?
🤔
anyone who can recommend any tools for making shaders? i wanna try my hand at an edition but i have 0 glsl experience
I'm having an issue with running Balatro under Linux
Specifically; when using a Linux version of Love2D, using the latest Github engine version, with a patch to change save directory to /home/reabs/.local/share/Steam/steamapps/compatdata/2379780/pfx/drive_c/users/steamuser/AppData/Roaming/Balatro (To match what Windows does)
The issue is that it isn't loading saves
Or settings
think i'll need to learn custom colors bc Diamonds aren't cutting it
like this for the formatting, though?
The plus on the inside should also be red I think
(hotpot)
||adding a second currency, how would i stop it from going directly to the right of the first on cashout?||
I'm looking for opinions on this.
Is it better to have focused mod (that focuses around a mechanic or specific theme) or a more general kitchen sink mod that has a bit of everything in it?
just do what you want
if you have a lot of disorganized ideas id recommend kitchen sink
I'm just undecided right now, i was originally on kitchen sink.
But talking with my girlfriend have made me question if i should steer it back into being more animal themed (and in parts focused around a new poker hand)
oh damn we're gatekeeping modding-dev from me now
now that more people are awake, anyone able to help me with this?
get rid of the random_joker.T.r
i told you that yesterday
oop, sorgy
check that pool is populating properly
to me it seems like pool is empty once it gets to the pseudorandom, which makes it return a nil?
bump
how do i get the key of the current deck?
How do you add repetitions to only one card?
how to create a cardType Badge?
can you elaborate?
Like for context.repetition, if i only want certain cards to retrigger instead of the entire hand.
context.other_card has the card targeted similar to individual
I see
I have print(pool) after the removecard but nothing is printing (I changed it to card so it doesn't crash)
Hi! i'mwondering how I can make a number in a joker's description dynamically change after x event occurs (like how invisible joker's round count goes up after every round)
anyone could help me please?
what are you stuck on? have you looked at how invisible joker does it?
how do I know if a hand is exactly a pair for example
is there any context for that?
what part
Wouldn’t you check scoring_name?
this is what I was doing
but
for some reason it also triggers with three of a kinds
if context.destroying_card and not context.blueprint then
if context.scoring_name == "Pair"
and context.scoring_hand[1]:get_id() == 2
and not context._wildtag_triggered then
context._wildtag_triggered = true
card.ability.extra.triggered = true
G.E_MANAGER:add_event(Event({
func = (function()
add_tag(Tag('tag_ina_wild_tag'))
play_sound('generic1', 0.9 + math.random() * 0.1, 0.8)
play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
return true
end)
}))
end
return true```
well, looking at the Vanilla remade mod, it doesn't seem like they added any loc_txt so I am a bit confused
it's in the localization file in localization/en-us.lua
whats the goal
to destroy both cards if 2 2s are played
and give one tag?
try this
if context.joker_main and context.scoring_name == "Pair" and context.scoring_hand[1]:get_id() == 2 then
G.E_MANAGER:add_event(Event({
func = (function()
add_tag(Tag('tag_ina_wild_tag'))
play_sound('generic1', 0.9 + math.random() * 0.1, 0.8)
play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
return true
end)
}))
end
if context.destroying_card and not context.blueprint then
if context.scoring_name == "Pair" and context.scoring_hand[1]:get_id() == 2 then
return { remove = true }
end
end
Bump
it actually worked just by changing the order of the if
debuff = { is_face = true },
for this, why doesn't this work
i think I got it form vanilla remade
try is_face = 'face'
ill fix it in vremade
i might be stupid
Edition = {
e_maxboism_sepia = {
name = 'Sepia',
label = 'Sepia',
text = {
'Balances {C:attention}#1#%{} of chips and mult'
},
}
}
why is the label not showing up? (sepia is a placeholder until I learn how to shader)
the name and description show up fine
calculate = function(self, card, context)
if context.scoring_hand and context.cardarea == G.play
and context.other_card == context.scoring_hand[#context.scoring_hand] then
return {
chips = context.other_card:get_chip_bonus() * 2,
card = context.other_card
}
end
end,```
why does this logs a warning about repetition tables?
ah, thank you
Not in discriptions also
does anyone here have experience writing new pages in galdur?
i got it to work
so if I understand correctly, #"number"# will show up the number of the designated returned variable in order?
so like #1# will show the first variable?
correct
so if u return {vars = {1,2,3}}
then in loc files
#1# will get 1
yes
oooh alr
larswijn?
and i;m guessing that if it's not a number it will give 'nil' :0
return {vars = {"Hello", "Hearts"}}
works as well
#1# would get "Hello"
so basically if you access #3# in loc files but ur return {vars = {...}} only has 2 things then #3# will be nil
---@param cards Card[]
---@return table <number|string,number>
function CHAR.FUNC.check_played_rank_deck(cards)
print('Updating highest played...')
local cards_played_bleh = {}
local cards_id_played = {}
local highest_played_val = 'None'
local highest_played_id = 1
local highest_played_num = -2 --why cant i just use a small number? fuck you
for k,_ in ipairs(cards) do
if not cards_played_bleh[cards[k].base.value] then
cards_played_bleh[cards[k].base.value] = 0
end
if not cards_id_played[cards[k].base.id] then
cards_played_bleh[cards[k].base.id] = 0
end
cards_played_bleh[cards[k].base.value] = (cards[k].base.times_played > 0 and cards_played_bleh[cards[k].base.value] + cards[k].base.times_played) or 0
cards_id_played[cards[k].base.id] = (cards[k].base.times_played > 0 and cards_played_bleh[cards[k].base.id] + cards[k].base.times_played) or 0
end
for k,_ in pairs(cards_played_bleh) do
if cards_played_bleh[k] > highest_played_num then
print("Highest played val " ..highest_played_val)
highest_played_val = k
end
end
for k,_ in pairs(cards_id_played) do
if cards_id_played[k] > highest_played_num then
highest_played_id = k
end
end
print("Highest played is " .. highest_played_val .. " with an ID of " .. highest_played_id)
return {rank = highest_played_val, id = highest_played_id}
end
could somebody assist me in debugging this function? it just does not return the right thing
There's ways to return not only numbers
so if I get nil its either that its not detecting the variable or its not there?
what does it do
gets the highest played rank in the deck
but it just completely does not work
yeah
or the variable itself is nil
oh, maybe, going to be interesting to use cardsleeves as a base as it's far from what i want to do but its a start
return {vars = {"not_nil", nil, "not_nil"}} works
and #2# will indeed be nil
so yeah either its not there or the value itself is nil
Bump
kk i'll try to work with that then
because my current code is giving me nil but then its maybe just a typo error lol
hmm can i see your code then?
might be a quick fix
need a wee bit of help
i'd like to change a card's suit, but keep what it used to be in a variable attached to it
how can i do that? (specifically, obtaining its suit)
(don't mind my SMODS.poll_seal not being finished making everything yellow lmao-)
if thats it istg
okay
this is false
i played 2 sevens prior to running this
should probably have made the arrow the other way around
its loc_vars not loc_var
oh its the same error lol
gah
it still does the same thing
wait what
it just randomly switched to 2s
the id is the same
??
lmao it works now ty
cards_played_bleh[cards[k].base.value] = (cards[k].base.times_played > 0 and cards_played_bleh[cards[k].base.value] + cards[k].base.times_played) or cards_played_bleh[cards[k].base.value]
how would i render an image in a uibox?
im not updating highest_played_num
oh yeah
i think this will also be an issue tho
alright
should i do something similar for the ID check or should that stay as is
yes
how do i use this to render a sprite in a uibox
hey, could i perhaps ask for a little help? i have made a joker like blueprint but i cant find the thing that blueprint has with it showing "compatible" and "incompatible" and i cant really figure out how to get it to work.
okay new problem
so now the ID is constantly 1
the rank updates just fine now
but the ID is always 1
which is it's inital value
nvm found a fix
= instead of >
calculate = function(self, card, context)
if context.scoring_hand and context.cardarea == G.play
and context.other_card == context.scoring_hand[#context.scoring_hand] then
return {
chips = context.other_card:get_chip_bonus() * 2,
card = context.other_card
}
end
end,```
Why does this logs a warning about retriggers? And my retrigger jokers crash with this
is joker retriggering enabled?
SMODS.current_mod.optional_features.retrigger_joker must be true
yes
hmm okay
other jokers work perfectly
oh wait this isnt even relevant nvm
you need a stricter context check
mmm
Bump
how does that work
you know the calculate docs?
you should have one of the contexts that are at the top of each code box
like context.individual in this case
i will make a vremade wiki entry about this
is there a function to get the poker hand of a given a list of cards? something like SMODS.evaluate but without the hand part?
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
G.E_MANAGER:add_event(Event({
trigger = "immediate",
delay = 0.1,
func = function()
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 16 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
return true
end
}))
end
so uh... my stupidity led me to this. It works! problem is it doesnt stop the elseif (i think) soooo... this event just keeps happening and since it puts it to a different sprite, its just going through the wrong sprites again and again after the proper animation works. 
(actually right now its wierd, it goes to doing smth wierd then i replenish cards then it goes to normal...?)
Did i do the event manager wrong or smth?
G.FUNCS.get_poker_hand_info
N’ have you tried putting an event on an animation before?
Dang
I think the main problem on mine is the event changes the sprite after the animation which is what i want, but it continues to change it after like 5 seconds it stops on 1 of 3 options…
in the vanilla remade mod, I am searching for the type_key of the Certificate joker named "vremade_certificate_seal" but I can;t seem to find it using ctrl_F (outside of the jokers folder I mean)
anyone knows where I could find it?
yeee
if G.gacha_button then
G.gacha_button:remove()
G.gacha_button = nil
end
if G.gacha_machine then
G.gacha_machine:remove()
G.gacha_machine = nil
end
``` why doesn't this remove the ui elements G.gacha_button and G.gacha_machine?
wait so that's the seed it ain't referencing anything? ;-;
no it's an optional unique string to be used as a seed for the seal
well and in_pool but yeah
Oooh alr so I don’t see to use it?
no
trully epic then
trying to make a deck that doesn't spawn commons. bunco has a patch for this but is there an easier way to do this nowadays?
take ownership of common and use
G.GAME.common_mod = 0?
maybe i don't remember if that was multiplicative or not
how do i get the end of round bonus
bump
for money
i've never needed to take ownship or work with pools how do i do any of that
vanilla seems to do it on the fly
calculate = function(self, blind, context)
if not blind.disabled then
if context.debuff_hand then
blind.triggered = false
if G.GAME.hands[context.scoring_name].level > 1 then
blind.triggered = true
if not context.check then
return {
level_up = -G.GAME.hands[context.scoring_name].level + 1
}
end
end
end
end
end```
Why is this crashing at this line: if G.GAME.hands[context.scoring_name].level > 1 then?
i might be stupid what from the returned is the poker hand
i dont have the code with me rn but it returns multiple values
search for it in the vanilla code
if G.gacha_button then
G.gacha_button:remove()
G.gacha_button = nil
end
if G.gacha_machine then
G.gacha_machine:remove()
G.gacha_machine = nil
end
chat why wont these ui elements get removed
how do I access the level of played hand?
ok i did it but now it won't change back to normal behaviour when i switch decks
like in your code
so why does it crash?
take_ownership is universal so you need to make the function account for normal decks and your deck
also don't do it in apply it's bad practice to take_ownweship during a game
what's the crash
i have an override for Card:is_suit() that will never return the suit phanta_unknown, however, for displaying the deck, i need this to return that value, so that the cards won't be placed in the row corresponding to their actual suit
I need it for some pows**
what do i need to patch to fix this?
can i not just hook or something instead of taking ownership
you can use take ownership as a hook
you would save the original get_weight in a reference variable
like local ref = SMODS.Rarities["Common"].get_weight
dunno if it has one by default tho
good morning
I shouldn't have napped but frankly I deserved it
[[patches]]
[patches.pattern]
target = 'functions/button_callbacks.lua'
position = 'after'
pattern = '''G.shop = nil'''
payload = '''
if G.gacha_button then
G.gacha_button:remove()
G.gacha_button = nil
end
if G.gacha_machine then
G.gacha_machine:remove()
G.gacha_machine = nil
end
'''
match_indent = true
why doesnt this patch do anything
it wont remove any uiboxes
if not context.check then
return {
level_up = -to_big(G.GAME.hands[context.scoring_name].level) + to_big(1)
}
end```
Why does this levels up by 1 the hand instead of decreasing it to 1?
hmm
uh oh i think this is not the way to do this
maybe the level_up can only go by 1?
i think its the bug where you return a big_num
G.GAME.hands[...].level is a bignum with talisman
big_num + int = bignum
my workaround for it is wrapping every big_num i return in lenient_bignum()
can you show the full function?
calculate = function(self, blind, context)
if not blind.disabled then
if context.debuff_hand then
blind.triggered = false
if G.GAME.hands[context.scoring_name].level > to_big(1) then
blind.triggered = true
if not context.check then
local level_down = -G.GAME.hands[context.scoring_name].level + 1
return {
level_up = level_down
}
end
end
end
end
end```
so with the lenient_bignum i should do lenient_bignum(level_down)
?
what in the nesting
if my memory isn't lacking yes
i hate talisman so much
I'm starting to
9 commits just for talisman fixes so far ( in "my" "side" project)
no
it can go up more at least, and im sure it can go negative too
oh wow this got sent super late
recently had a crash with talisman where it was returning the big_num
yeah i think it got fixed now?
fixed it by wrapping it in the function i mentioned so ¯_(ツ)_/¯
oh my god i bet im outdated as fuck
not sure tho i dont test with talisman
how old is this
old enough to be jank af
~month
-# they're all jank af shhhh
question, why would the soul egg thingy still be displaying on this - i've take_ownership the soul spectral and overwritten the atlas, pos, and soul_pos
(also how do I get it to dance like that)
because the soul uses a thing called G.shared_soul which is basically the floating sprite... but it's a global variable.
your solution here is not to set the soul_pos in the soul and instead overwrite G.shared_soul with your soul sprite
and/or make a malverk texture pack instead which does all of this and in a way that's more compatible with other mods
well do you specifically want the delta rune to shake like the Soul does or do you just want the floating sprite like a Legendary Joker
oh no wait i'm. i might be stupid
if floating sprite i could just G.shared_soul = nil i believe
unfortunately that is not my goal
wack
there is a lot of hardcoded stuff that has been made easily modable by different apis
is there a reason you're hard coding texture replacements?
when concepting modded cards/items, do i just have to care about the name and its effect?
like is there some bullshit i'm forgetting that i should list
not counting category-specific things like joker rarity
price?
that is true
i just thought to check the official wiki page for a random card and look at it that way
cause i'm also adjusting other features of the cards, and it's not too difficult to just tack on atlas = whatever, pos = { x = 1, y = 2 }
How do i check how many challenges have been completed?
I thought i found it with G.PROFILES[G.SETTINGS.profile].challenges.tally but just got nil
so it'd be name, effect, rarity (if joker), unlock req, buy price (i assume sell price is pre-calculated rather than having to be coded in manually every time), and then compatibility with blueprint/brainstorm, perishable and eternal stickers
sell price is half the buy price
there's ways to manually set one, but you don't have to
local btct = {ticks = (5)}
local upd = Game.update
local btct_Floppr_dt = 0
function Game:update(dt)
upd(self, dt)
local Flopprobj = G.P_CENTERS.j_btct_Floppr
btct_Floppr_dt = btct_Floppr_dt + dt
if Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 1 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 2 then
Flopprobj.soul_pos.x = 1
Flopprobj.soul_pos.y = 0
else
G.E_MANAGER:add_event(Event({
trigger = "immediate",
delay = 0.1,
func = function()
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
return true
end
}))
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 2 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 2 then
if to_base then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 7
to_base = false
end
else
G.E_MANAGER:add_event(Event({
trigger = "immediate",
delay = 0.1,
func = function()
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
return true
end
}))
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 3 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 2 then
Flopprobj.soul_pos.x = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 4 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 10 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 5 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 11 then
Flopprobj.soul_pos.x = 0
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 6 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 12 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
end
elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
btct_Floppr_dt = btct_Floppr_dt - 0.1
if Flopprobj.soul_pos.x > 16 then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 1
else
G.E_MANAGER:add_event(Event({
trigger = "immediate",
delay = 0.1,
func = function()
Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
return true
end
}))
end
end
for k, v in pairs(G.I.CARD) do
if v.children.floating_sprite and v.children.floating_sprite.atlas == G.ASSET_ATLAS["btct_FlopprAtlas"] then
v.children.floating_sprite:set_sprite_pos(Flopprobj.soul_pos)
end
end
end
Why does this just happen instead of just going to x=1, y=0?
ok
is there a context or function on a joker that's called when the joker is initially created? for example, when it spawns into the shop or booster pack.
i think you could use set_sprites for its not intended purpose maybe?
or mayb set_ability
set_ability yeah
bump
how on earth can you soft lock and still have the event queue running, what does that even mean
honestly if you want to force a run reset just manually game over

that is a thing right
like
when blind is won:
if score // blindReq => 3:
kill the run lmfao```
"kill the run lmfao" so wise
i mean you can force gameover regardless but thats not what they want to do
i try my hardest
forcing a softlock doesn't. entirely sound like a good idea if i'm being honest :/
id assume you could just infinite loop event
that is one way
yea i think its poor design to punisht he player for performing well
but people have had all sorts of concepts
i mean sure if you want to punish the player for overkill then by all means but maybe don't softlock the run so you have to manually start a new one
i mean i dont personally feel like that changes much
its not hard to manually start a new run
i guess it's understandable if you expect to be able to still pause the game while it's "softlocked"
my concern comes from if you have to alt+f4 the game just to reopen it and keep playing
im pretty sure you can still restart through menu and through holding r
times where ive fucked up and the event queue was launching high i was able to
unless it was some wacky fluke
oh cool
if you do that though you should probably tell the player you can still manually restart in this failstate
someone's gonna be stupid enough to think you can only alt+f4 out of it (me being a good example)
id assume the player would notice something has gone awry after nothing has happened for awhile
but you are right it should notify them
maybe once its triggered in the desc it can refresh and say that you need to restart your run
if to_base then
Flopprobj.soul_pos.x = 0
Flopprobj.soul_pos.y = 7
to_base = false
end
can i still do this inside a function out of the joker even though to_base is set inside the joker code?
imo if the effect soflocks you should only be able to alt+f4 out of it
anything else and you're a coward
im gonna soft lock you buddy
u can hardlock me
😳

if to_base is a global, yes
but i dont recommend having globals with generic names
throw in your modprefix modprefix_to_base
omg my fanfiction is being brought to life 
or call it modprefix_what_the_fuck
its in card.ability.extra... how do i access that?
anyone got the hex codes for joker rarity? just google sheet housekeeping
then you would need access to that card
nvm i remembered imagecolorpicker exists
Common: 009dff
Uncommon: 4BC292
Rare: fe5f55
Legendary: b26cbb
that sould be it
i have local Flopprobj = G.P_CENTERS.j_btct_Floppr so would i just do Flopprobj.ability.extra.to_base?
Is card.ability only available after fully loading into a game?
Because i'm getting crashes trying to access it from the set_sprites function
card.ability exists after the card is created
omg its flopprobj
the card object itself
You're gonna be kurakuobj here in a second
is == 'is' in code?
in fact i am

