#💻・modding-dev
1 messages · Page 584 of 1
If you're comparing <card>.config.center.key then the answer is yes.
ok
You mean when it changes size?
whatever transform_projection is in the dissolve shader
i need this for a custom shader, so i can fix the remaining issue with the hat
how do I get a message event to play before the return in a calculate function?
like I want it to send 3 different messages, wait a second, and then send a 4th message along with its appropriate return output
(yes this is me working more on the slot machine)
No, use extra
so extra is where I put in the output?
like this?
message = "TEST",
extra = {
message = "TEST2",
chips = 10
}
-# whipped this up as an example
No, it would be return {message = 'message1', extra = {message = 'message2', extra = {message = 'message3' delay = 1, extra = {message = 'message4', otherreturnvalues = yes}}}}
ohhh
how can i make my joker not show my mod's tag
no_mod_badge = true
no_collection = true
alright thanks
I was thinking of making a mod where the jokers and cards are flipped (i.e. you have a deck of jokers and a single hand of cards you can buy and sell)
after looking at smods and the balatro source, it seems like a giant undertaking, like I might even have to rewrite large portions of the game
anyone know if a mod like this already exists?
is there something I'm missing like an easy way to modify the card and joker collections? can I add hooks anywhere?
I've never developed in lua before, please assume I know absolutely nothing
how can i make my enhancement swap chips and mult when scored?
i keep getting this error
can you send some more of the code
show code
key = "swapping",
loc_txt = {
name = "Swapping Card",
text = {
"Swaps {C:chips}Chips{} and {C:mult}Mult{}",
"when scored"
}
},
unlocked = true,
discovered = true,
atlas = "swapping",
calculate = function(self, card, context)
if context.main_scoring and context.cardarea = G.play then
return {swap = true}
end
end
}```
you need ==
how do I have the sound's pitch not get changed (specifically when a sound is set in the return part of a calculate function)?
if context.main_scoring and context.cardarea == G.play then
yeah that was it now it's working perfectly thanksss
How can i stop Found effect table with no assigned repetitions during repetition check from showing up in debug log.
It means you're returning something without repetitions in context.repetition or context.retrigger_joker_check
So i can do not context.repetition/context.retrigger_joker_check in the if statement and it'll fix the problem?
Code?
ret.playing_card = {}
local chips = card:get_chip_bonus()
if chips ~= 0 then
ret.playing_card.chips = chips
end
end``` in eval_card general effects
Or where the card is scoring SMODS.score_card(context.other_card, {cardarea = G.play, all_in_jest = { main_scoring_chip_vaules = true }})
anyone know a good way to have a joker do something like give money multiple times in the same context? In this case I want it to give money once per card destroyed. I tried this with and without what's commented out, but the way it is it happens way too fast (obvsiouly) or with the events the game just stops.
for i, destroyed_card in ipairs(context.removed) do
-- G.E_MANAGER:add_event(Event({
-- func = function()
ease_dollars(card.ability.extra.money)
-- return
-- end
-- }))
end
end```
sorry to jump in lol
you need to return true in events
if context.main_scoring
This seemed to work, also i added that because i didn't want to trigger things that weren't the chip value.
oh but now the happen at the same time
this might not even be possible without smt wack
add the line delay = 0.4, before the line func = function()
you can tweak the number to change the timing
oo cool
Like this? i'm not noticing any change even when I set the delay to smt unreasonable
G.E_MANAGER:add_event(Event({
delay = 0.4,
func = function()
ease_dollars(card.ability.extra.money)
return true
end
}))```
oh right i forgot the trigger isn't the default
also add this line before the delay line:
trigger = "after",
(by default, events have trigger = "immediate", which just trigger as soon as they possibly can and totally disregard any delays)
got it, I'll keep that in mind
lol, so the delay works but it delays first then triggers both at the same time
@frosty rampart
with delay set to 5 for dramatic effect. No worries if you don't know a fix for this but I thought I'd double check
Yes, you should be returning dollars
well they want it to give money in separate chunks once for each destroyed card
oh ok, I didn't think the event could return dollars I'll try that
No, it can't.
ok cool
sorry ik i should prolly just return twice the amount once but I feel like that would feel weird
Yes, what's the issue?
I can't get each animation to be seperate
No, extra exists.
return {dollars = number, extra = {dollars = number}}
yea that'll do two dollars popups, you'll probably have to figure out how to automate the process for an arbitrary number of destroyed cards
(you can nest extra tables i think)
Yes, use SMODS.merge_effects
alrighty I think I can figure that out, thanks guys
Btw here's all the possible payouts that could happen:
3 diamonds
- +300 chips
3 hearts
- +20 mult
3 spades
- x15 mult
3 clubs
- $20
Jackpot
- +700 chips
- +100 mult
- X70 mult
- $77 dollars
- played hand goes up 7 levels
- 1 negative Soul Spectral Card
-# reminder that each of these payouts have a 1/125 chance of happening
Btw not getting a payout has a 120/125 chance of happening.
if any of the payouts need to be buffed/nerfed, let me know
the only reason why the jackpot can give you a negative The Soul is because the odds of getting that jackpot is very close to the odds of getting The Soul from a booster pack
This is fun, for the suits I'd say you could reorder them to be like the uncommon suit jokers, money for diamonds, chips for spades, mult for clubs, and xmult for hearts. Though x15 mult is kind of bonkers compared to the other ones lol. same for the xmult in the jackpot
I think like x2 or x3 is equivalnt to the others
chips is also pretty high comparitive to money and mult
I'm thinking of like, money and mult are similar to on luckys but x15 mult is like in the stratosphere and 300 chips is 10x a bonus card. maybe like 100?
this is also just from a vanilla perspective, just do whatever you want if thats what you wanna do
how can i update the reward text on a blind
would x7 mult work for the hearts
as the payout
prolly still a little high but since its random anyway go for it, 7 is thematic
yea
cause i'm trying to think about how to make the payout rewarding, since it's a 1 in 125 chance for each.
speaking of which, here's how I calculate each slot:
local m1 = pseudorandom("comedy_slot_machine", 0, 4)
local m2 = pseudorandom("comedy_slot_machine", 0, 4)
local m3 = pseudorandom("comedy_slot_machine", 0, 4)
local outputs = { "Diamond", "Heart", "Spade", "Club", "7" }
so, there's a 1 in 5 chance to get 1 seven, a 1 in 25 chance to get 2 sevens, and a 1 in 125 chance to get 3 sevens, for example
Why is it 0 to 4 instead of 1 to 5?
for how rare the effects are i don't think i'd ever pick it up
and because of how it works you couldn't even use cryptid seed on it to guarantee a jackpot or something
thats true
because when I coded it I thought I was coding in java for a brief moment
I actually just fixed it
You might want to consider making all the rewards be unrelated to scoring since you'll never be able to rely on it
though you could leave some in as like, not a real reward but its fun to see big number
alternatively, there should be a bare minimum payout of like +4 mult, and weaker versions of your 3-of-a-kind payouts for matching two of a kind
yea I was thinking about that too
like the bonkers xmult is probably actually fine in this scenario
i'll add that later tho
that would also be good
hii, i'm having an issue with a sticker that is applying to all stakes and i have no idea why. i have an SMODS.Sticker {} and it's currently in one stake--and is commented out in the stake (so not even enabled). am i missing something as to why its applying to all stakes?
would this work for getting 2 of a kind?
elseif (m1 == m2 and (not m2 == m3)) or ((not m1 == m2) and m2 == m3) then
don't do not x == y, do x ~= y
otherwise that's almost there, but you still need to account for when m1 == m3
post the sticker code and the stake code
What is the goal?
checking if 2 out of 3 random numbers match
You also need a m1 == m3 version of the check, otherwise it won't be counted by this.
Updated Payouts
3 diamonds
-
- $25
3 hearts
- x7 mult
3 spades
- +150 chips
3 clubs
- +25 mult
3 7's (Jackpot)
- +700 chips
- +100 mult
- x70 mult
- $77 dollars
- played hand goes up 5 levels
- one negative The Soul
2 diamonds
- +$5
2 hearts
- x3 mult
2 spades
- 75 chips
2 clubs
- +10 mult
2 7's
- +20 chips
- +3 mult
- x1.5 mult
- +$2
Default
- +4 mult
oh i guess I forgot that lol
if (m1 == m2 and m1 ~= m3) or (m1 == m3 and m1 ~= m2) or (m2 == m3 and m2 ~= m1)?
cant select consumable card
elseif (m1 == m2 and m1 ~= m3) or (m1 == m3 and m1 ~= m2) or (m2 == m3 and m2 ~= m1) then
this is what I did
now how do I have it give the soul after the "jackpot" message is displayed?
hold on I figured it out
Put it in the func of that return.
yea i just figured that out
for some reason the card created through here doesnt get placed into consumables
and can just be moved anywhere
Im only just jumping in but you prolly wanna use SMODS.add_card
can i make a card enhancement texture appear in front with the "set_sprites = function(self, card, front)"?
oh
worked ty
np
No, you would have to use SMODS.DrawStep
bump
check the Paperback beta, i literally just did that for the Sleeved enhancement
(the DrawStep is in the same file as the enhancement itself. it displays on top of the center, the front, and the edition, but still lets seals and stickers go on top)
i know this is probably the most fucked up code you guys have ever seen but ive tried everything i could think of and it just doesnt work,
the idea is that the whoosh effect triggers before the money and tarot generation trigger (the joker works functionally)
(preferrably i want the money and tarot to happen during joker triggers)
I think that'll prolly need a lua hook or whatever which is beyond me atm sorry
Swap the message and sound in your return with where the dollars is
And change your context check to joker main if you want it to trigger during the joker scoring
what do i need to hook tho?
No, just change G.GAME.current_round.dollars_to_be_earned then do G.HUD_blind:recalculate(false) I think.
does that you do stuff that besides change the dollar amount?
Its also possible they do just wanna change the dollar amount
im so confused on how it works, like i just want the base texture enchacement to be behind it like normal, but have an overlay with sprite pos of "x=0 y=1" on top of it
Yes, you would use SMODS.DrawStep to draw that on the card.
problem is i don't know how to use it😭🙏
Sleeved draws the default base card on the actual card center, so you can ignore the enhancement's set_sprites function entirely. you don't need that part
everything you need is the DrawStep in the sleeved file. you can pretty much copy/paste it, replace the check for self.children.center.paperback_sleeved with a check for self.children.center.modprefix_enhancementkey (where you fill in your own mod's prefix and enhancement key), and replace the positions in the set_sprite_pos calls with positions relevant to your own atlas
??
yeah i did do that, but it didn't work SMODS.DrawStep { key = "rigged", order = 21, func = function(self, layer) if self.children.center.omega_rigged then self.children.center:set_sprite_pos({ x = 0, y = 1 }) self.children.center:draw_shader('dissolve') end end, conditions = { vortex = false, facing = 'front' } }
you need the second set_sprite_pos call to reset it back to the original center's art
without it the center will start drawing the overlay's art too
still didn't work
why does this happen? what did i do wrong?
elaborate on "didn't work" then
i feel like you didn't save the file properly
wdym?
the card still looks like this, but i want the bent corner to be on top
if you have debugplus, hover over a card with the enhancement, and in the console run eval dp.hovered.children.center.omega_rigged
Did you save the file and restart the game?
i did not
wait
i think im getting this the wrong way
it is saved
...
so you got the stuff wrong
is that your mod prefix and the key of the enhancement?
i realized the issue
Show the line numbers.
im a dumbass
i think so?
you do need a set_sprites function in your enhancement
set_sprites = function(self, card, front)
card.children.center.omega_rigged = true
end,
it doesn't automatically set that, i manually put it in lmao
💀ok yeah that was it thanks!
i've returned for my info_queue-based torture and suffering
aka: trying to make an upgrade preview
this time, i wanna try a different approach
how do i make a custom info_queue description type
or whatever i need to do
to just make {set = "Joker", key = "j_modded_key", vars = {}} work
because it only works with vanilla jokers and that sucks
i can make a table containing every value that a G.P_CENTERS table has, and it doesn't work while the G.P_CENTERS table does
so i have no idea what the problem is
how do i set a specific joker to be created
?
nvm ignore
i have tried literally everything and nothing works
oops wrong server
i love asking for help with the same thing on 2 different servers 😊
modifiers = function()
G.GAME.modifiers.enable_rentals_in_shop = true
end
})
SMODS.Stake:take_ownership('stake_orange', {
unlocked_stake = 'fanatic_viridian'
})
SMODS.Stake {
key = 'viridian',
unlocked_stake = 'fanatic_rose',
applied_stakes = {'orange'},
above_stake = 'orange',
prefix_config = {above_stake = {mod = false}, applied_stakes = {mod = false}},
modifiers = function()
--G.GAME.modifiers.enable_fanatic_luxurious = true
end,
colour = HEX('239087'),
pos = {x = 0, y = 0},
atlas = 'fanatic_stakes',
sticker_pos = {x = 0, y = 0},
sticker_atlas = G.ASSET_ATLAS["stake_stickers"]
}
SMODS.Stake {
key = 'rose',
unlocked_stake = 'gold',
applied_stakes = {'fanatic_viridian'},
above_stake = 'fanatic_viridian',
modifiers = function()
-- nothing
end,
colour = HEX('D4426E'),
pos = {x = 1, y = 0},
atlas = 'fanatic_stakes',
sticker_pos = {x = 0, y = 0},
sticker_atlas = G.ASSET_ATLAS["stake_stickers"]
}```
```SMODS.Sticker {
key = "luxurious",
badge_colour = HEX('8FF8E2'),
pos = { x = 0, y = 0 },
atlas = 'fanatic_stickers',
default_compat = false,
needs_enable_flag = true,
should_apply = function(self, card, center, area, bypass_roll)
local is_in_shop = (area == G.shop_jokers) or (area == G.pack_cards)
local chance = (math.random(1, 100) <= 30) --manual chance
local is_joker = (card.ability.set == "Joker")
--local random_chance
return not card.ability.rental and is_in_shop and is_joker and chance
end,
apply = function(self, card, val)
card.ability[self.key] = val
if card.ability[self.key] then
card.cost = card.cost * 2
card.sell_cost = 0
end
end
}```
sorry that's huge lol
also bc they linked to a msg from here lol
the sticker's should_apply function needs to also check if G.GAME.modifiers.enable_fanatic_luxurious is true, that's not handled automatically
oh! thank you!
would you bychance also know why the not card.ability.rental check doesn't actually check for rentals?
How do I make a joker detect if an attempt to destroy it was made
when stickers are applied in shop, modded stickers are applied before the vanilla stickers unfortunately
oh yikesss, so i should use a love patch to instead make rental stickers check if a sticker has luxury?
i think so, yes
or maybe take ownership of rental to modify its should_apply function
gotcha, thank you :3
And also is there a way to make it immortal without being eternal
I'm trying to make this effect
you could do a work around! look at https://github.com/survovoaneend/All-In-Jest/blob/c8903770254e96ef97e067828d97ab1f3ab36c65/Items/Jokers/pellesini.lua and you could copy this mechanic for jimboraga to copy itsself and then also have a 1/4 chance to spawn a spectral
Interesting, i'll look
How does this work
Because i'm reading it and i'm lost
when a joker is created it makes an exact copy
How do I do that? I can't tell how the mod is doing that or how to make that work in mine
This is all I have right now
I'm trying to find documentation and i'm lost lol
if context.check_eternal and context.other_card == card then return {destroy = true} end
how does that work
do I put it in calculate
I assume so because of it using context
but I can't for the life of me find the documentation for what check_eternal and other_card are
eternal agony and despair
what about other.card?
That's just the other card being calculated.
ok.
@red flower
FAN
for some reason specifically the part where it makes a clone of itself doesn't work. everything else does but i'm not sure why this specifically fails. i've looked at the code for perkeo and judgement in vremade and i still have no clue so, as usual, i come to the balalalalatro discord in my time of need
Yes, because it's in a use function.
ah
not gonna lie classic me move to ignore the obvious problem lmao
thanks my man
and now it's crashing because of <name> expeccted near [
THERE IS NO CHARACTER!!
ETERNAL AGONY AND DESPAIR!!!!!!!!
I LITERALLY COPIED THE JSON BASE FROM A FUNCTIONING MOD!!!!!!!!
send the json file here
like the file itself, don't copy/paste
making tarots is kinda hard for me only because my mouse can go all over the place.
dw
i will
copied from Yahimod and previously that one modding tutorial i cant find
forgive me if the issues obvious i have no knowledge on lua and i called everything gay because its a test mod
i meant like. drag the json file into discord and upload it
my mouse moving around is making me angy
so... can someone tell me why the game crashes when i run this code?
the rest of the joker code doesn't matter as this section isn't connected to anything other than a if/then/else command which i know works as the game crashes on line 55 (aka where this section begins)
OH
mb
didnt know that was possible
its not
letting me post it
why are you starting a new function inside another function
because it's that way in the code from judgement i based this on
asides from that i have no clue
tbh i think it's stupid too
i think the file is just corrupted somehow
so i should redo it?
can you post the full code
or make a new file and paste the code
yea from a fresh new text document
also you should probably name the function?
i wouldn't copy/paste
ok
no
that's because it needs to run the event in the "use" function
remove the function(self, card, area, copier) and its relevant end
you don't need a separate function because it's already in the calculate function
yeah that's a whole other function
ah
good to know
i am a noob
it works! huzzah!
only note is that for some reason the negative copy and the original switch places but that's probably just a debug+ shenanigan
Visual Studio Code or whatnot isnt an issue right?
shouldn't be
ok after a tiny change it works perfectly
this makes my third joker (and most complicated yet) done
...well i need to add in the description but that should be easy
also wont let me post
thanks balatro people
maybe its a visual studio setting
sets your pc on fire
yea i don't understand what's happening lol
how is it erroring when you try to upload it?
oh uh
i mean the only error ive seen is just the lovely logs one
it doesnt crash or go into debug logs (if that even happens?) it just doesnt appear because its never loaded
do i need extensions?
how is it not letting you post the file in discord
ah
i press enter
doesnt show
NEVERMIND
THE ISSUE WAS ME BEING A SPED
BECAUSE I DIDNT KNOW I NEED TO CLOSE IT TO SAVE IT ON VSC
SO IT HAD NO DATA
...ah
sorry for wasting your time
glad it's fixed lmao
thanks for helping me realize that though
:D
my code,
my code disappeared
its gone
is it possible to add a seal to a specific card in the deck?
MY BOY IS ALIVE!!
they ain't all going to be winners i guess
i think i know what's the issue being that its the list of cards discarded but is there something where it only grabs the cards you just discarded
how do you disable the boss blind without causing the win screen to break
uh what?
like the luchador/chicot effect
not blind.disabled for checks and disable = function(self)
no i mean how do i trigger the blind to be disabled
without breaking
does it break if you call disable on a already disabled boss
i believe so
or something weird idk
that explains it then
some disables more so reverts so stuff like the wall borks
so does it cause the "small blind - score at least 0" issue
no idea
so check G.GAME.blind.disabled?
i guess?
got it working by looking at yorick
?
for my blind
at how many jokers would you upload your mod to #1209506514763522108
i mean depends on your scope honestly for me im going to wait until most if not all the content is finished code and design wise before a public beta
how do I check if I won a run with a specific joker? (this is to make an unlock requirement for a deck)
do negative playing cards exist in basegame (but unused)?
yeah
it's an edition so it can be used on cards but as you could probably see there's probably a reason why it's not in the vanilla game
9999999999 negative red seal kings
local main_menu_hook = Game.main_menu
function Game.main_menu(change_context)
local ret = main_menu_hook(change_context)
G.SPLASH_MULTIVERSE_LOGO = Sprite(
0, 0,
6,
6 * G.ASSET_ATLAS["mul_mod_logo"].py / G.ASSET_ATLAS["mul_mod_logo"].px,
G.ASSET_ATLAS["mul_mod_logo"],
{ x = 0, y = 0 }
)
G.SPLASH_MULTIVERSE_LOGO:set_alignment({
major = G.title_top,
type = "cm",
bond = "Strong",
offset = { x = 0, y = 3.75 }
})
G.SPLASH_MULTIVERSE_LOGO:define_draw_steps({ {
shader = 'dissolve',
} })
G.SPLASH_MULTIVERSE_LOGO.tilt_var = { mx = 0, my = 0, dx = 0, dy = 0, amt = 0 }
G.SPLASH_MULTIVERSE_LOGO.states.collide.can = true
G.SPLASH_MULTIVERSE_LOGO.dissolve = 1
G.SPLASH_MULTIVERSE_LOGO.dissolve_colours = {Multiverse.C.PRIMARY1, Multiverse.C.PRIMARY2}
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = change_context == 'splash' and 3.6 or change_context == 'game' and 4 or 1,
blockable = false,
blocking = false,
func = (function()
play_sound('whoosh1', 0.2, 0.8)
ease_value(G.SPLASH_MULTIVERSE_LOGO, 'dissolve', -1, nil, nil, nil,
change_context == 'splash' and 2.3 or 0.9)
G.SPLASH_MULTIVERSE_LOGO:juice_up(0.1,0.1)
G.VIBRATION = G.VIBRATION + 1.5
return true
end)
}))
function G.SPLASH_MULTIVERSE_LOGO:click()
play_sound('button', 1, 0.3)
G.FUNCS['openModUI_Multiverse']()
end
function G.SPLASH_MULTIVERSE_LOGO:hover()
G.SPLASH_MULTIVERSE_LOGO:juice_up(0.05,0.05)
Node.hover(self)
end
function G.SPLASH_MULTIVERSE_LOGO:stop_hover()
Node.stop_hover(self)
end
return ret
end
@sturdy compass
the hook for the main menu
[manifest]
version = "1.0.0"
dump_lua = true
priority = 1
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''
if G.SPLASH_LOGO then
love.graphics.push()
G.SPLASH_LOGO:translate_container()
G.SPLASH_LOGO:draw()
love.graphics.pop()
end
'''
position = "after"
payload = '''
if self.SPLASH_MULTIVERSE_LOGO then
love.graphics.push()
self.SPLASH_MULTIVERSE_LOGO:translate_container()
self.SPLASH_MULTIVERSE_LOGO.T.r = 0.08 * math.sin(G.TIMERS.REAL * 1.152)
self.SPLASH_MULTIVERSE_LOGO.T.scale = 1 + 0.03 * math.sin(G.TIMERS.REAL * 1.06)
self.SPLASH_MULTIVERSE_LOGO:draw()
love.graphics.pop()
end
'''
match_indent = true
times = 1
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''
if self.SPLASH_LOGO then self.SPLASH_LOGO:remove(); self.SPLASH_LOGO = nil end
'''
position = "after"
payload = '''
if self.SPLASH_MULTIVERSE_LOGO then self.SPLASH_MULTIVERSE_LOGO:remove(); self.SPLASH_MULTIVERSE_LOGO = nil end
'''
match_indent = true
times = 1
the lovely toml file
idk what im doing wrong
You have created an atlas containing your logo sprite correct
yes
it runs correctly without cryptid installed
but for some reason it breaks when cryptid is installed
i was fiddling with some stuff earlier tho while trying to fix it
Again, that crash report is very foreign to me so I have no clue what could be causing it as everything seems to look fine. I just tested again with Cryptid and it still works fine 
Considering nothing is destructive you shouldn't need to
yeah
this is a really strange crash tho
hmm
val being nil there is kinda sus
ok Astra im going to fully ctrl c ctrl v ur main menu code
and see if that works
ofc i'll change vars as needed
@sturdy compass i cant 😭
i literally ctrl c ctrl v'd ur code into my mod and it still gave me that same exact error

i guess my mod is eternally incompat with cryptid now
good :)
the only files that messed with the main menu were main.lua and other.toml, correct?
yes
this is a dumb question but how do i set ante as opposed to adding/subtracting with ease_ante
do
ease_ante(-G.GAME.round_resets.ante + x)
where x is the ante u want to set to
oh alr thank u
its basically setting ante to 0 then adding to it until the ante becomes what u want it to be
Hello again friends, I have another issue I'm looking to resolve
Arceus here (praise be his name) is supposed to copy the effects of all jokers in your posession, but he's not doing that. Can someone figure out why this is not happening?
Hey guys, how do I make new consumables?
read the wiki
where is it?
https://github.com/Steamodded/smods/wiki/SMODS.Consumable looking at this
undocumented functions my beloved...
uhhhhhhhhhh
I forgor to make a pack sprite. Does that matter?
does the pack sprites matter or no?
@loud summit ?
i dont think it technically matters
though you usually get consumables through packs
do you think a sprite is going to magically come into existence for you
you need a sprite. it doesn't have to be good but you need to either implement one or point it to reuse an existing pack's texture as a placeholder
i mean you dont nnnneed a pack if there are other ways to spawn it
3 is ok?
3 what
packs i assume
normal, jumbo, mega
yea
it's your mod you can do literally whatever you want
3 packs, 35, 0, as long as you're happy with how your mod turns out
maybe 0 will be better
do the consumables show up in the shop?
haven't coded it yet
they do.
also consumables shouldn't have rarities
bump
yea you can't just do that if it doesn't already exist in smods
unrelated but update your steamodded, latest release is 0827c
taking a break..
Why do you have two calculate functions defined???
that may be the problem
I think it just might be
Also I see y'all are getting the F treatment here... good luck
that was precisely the problem
Glad I could help
real dumb one, whats the G.GAME thing to access the current ante?
https://github.com/BakersDozenBagels/Smods-Wiki/blob/g-documentation/G.md
tried checking there, no ante
G.GAME.round_resets.ante
thats just what vscode says when something can be multiple values
ok another question how to make legendaries appear in shop bc when I changed the legendary_mod value to 1 as a test the game crashed do I just take ownership of the legendaries and make them appear or what?
Take ownership of the rarity and make it have a weight greater than 0
but I want from it to stay 0
So you don't want them to appear in shop?
I want them to appear in shop when my joker is present
ok as a temporary idea I will just set the weight to 0.000000000001
Take ownership of legendary rarity and for the get_weight have it be if smods find card or whatever in your joker slots then return a number
and then an else return 0
(Bad explanation but I can't send code bc I'm on mobile)
oh ok thanks
SMODS.Rarity:take_ownership("Legendary",
{
default_weight = 1
})
test code
doesn't work why?
You also have to change the code in get_current_pool to allow them to spawn
how to do that?
Do you know how to lovely patch?
nope
I decided to add a deck back to the mgs deck for the screenshot only to remember the deck back doesn't show up in the cards view
newbie here
hi, im trying to work out how id do this, but i got no clue
im trying to print something to the console when it is the end of the round and the last played hand was a high card
if context.end_of_round and context.scoring_name == "High Card" then
return true
end
thats what i had
im trying to make more achievements, but im figuring out how stuff like this works, starting simple before making it more complicated
i just cant figure it
looks menacing
anyways thanks I will try to figure it out
Look how other mods use it too it's a good reference point 👍
Usually they're in lovely folders within the mod, or .toml files
ima look at cryptid(big mistake probably)
how to find how many cards are being drawn in context.drawing_cards
context.amount
thanks
if (context.setting_blind) or (context.before and G.GAME.current_round.hands_left == 1)then
card.ability.extra.activate = true
end
if context.drawing_cards and card.ability.extra.activate then
card.ability.extra.activate = false
G.E_MANAGER:add_event(Event({
func = (function()
card:juice_up()
play_sound('cardFan2', 0.9 + math.random() * 0.1, 0.8)
return true
end)
}))
return {
cards_to_draw = context.amount + card.ability.extra.extra_cards
}
end
end```why did this trigger when opening a tarot pack
Because it's drawing cards in the booster pack.
yeah but activate should be false
Hi, new to modding. I just wanted to ask about blueprint_effect. I've read some of the other issues people have had and tried implementing it but im not sure why its not returning the 'other_joker_effect' despite in testing, the joker triggering the message that is also within the return statement (this also goes for card ability.extra.count == 1 not working as well)
extra = other_joker_effect in the return
Also what is the goal?
the goal i have is basically when you play gold cards, it grants retriggers to the adjacent joker ala blueprint. once the the retriggers have been used, it resets.
basically its gonna give bursts of retriggers fueled by gold cards
So it retriggers the joker to the right for every gold card played?
yes kinda
[edit cause im half asleep and didnt realise what im saying]
- i want gold cards to store retriggers based on the amount played so if you wanted to save the retriggers, you could move this joker to the far right and have it not activate
if ((G.play and G.play.cards > 0) or card.ability.extra.count > 0) and context.retrigger_joker_check then
local other_joker, failed = nil, false
for k, v in pairs(G.jokers.cards) do
if v == card then
if i == #G.jokers.cards then failed = true end
other_joker = G.jokers.cards[i+1]
end
end
if context.other_card == other_joker then
local count = card.ability.extra.count
for k, v in pairs(G.play.cards or {}) do
if SMODS.has_enhancement(v, 'm_gold') then
count = count + 1
end
end
card.ability.extra.count = (failed and card.ability.extra.count) or 0
if failed then return nil end
if count > 0 then
return {repetitions = count}
end
end
end
thanks a bunch. also would this retrigger context work for jokers that don't score? for instance in my current attempt at an implementation, if there is not a compatible joker i wanted the count to remain at whatever many gold cards were played so that the retriggers could be stored for use with other non scoring jokers.
Yes, but it wont trigger.
would i have to include another context for other situations for retriggers to occur (example: discard context for mail-in-rebate)?
No, context.retrigger_joker_check is called when any joker is checking for retriggers, if it's enabled.
ok sweet
how to i show a sticker tooltip using the "info_queue[#1116390750314307698_queue+1] = G.P_CENTERS.s_star"?
what's the sticker prefix basically
no letter prefix, you do need the mod prefix, and it won't be in P_CENTERS because it's not a center. try P_STICKERS maybe?
update smods
oh
it's only a feature in 0827
well, im trying to make my mod compatible with a mod that relies on the old version im on
is it possible to port the smod function
into my mod
have you set the Card's phanta?
or wait
try doing a test print by doing
print(type(card.phanta_dimmadomeextra))
👍
table
the second log line didn't run
so i'm assuming set_hard_T isn't actually being called, then
which is fine
No, it's SMODS.Stickers but I don't think that works either.
nope
yeah thats the issue, the snippet of code you gave has no calls of the function
where does Balatro set the tilt of the children in a Card, when it's being hovered?
where does smods use SMODS.calculate_round_score or SMODS.set_scoring_calculation?
aside from its apposite functions
that do that
just a quick question how do you make probabliities update after obtaining oops all sixes?
Use SMODS.pseudorandom_probability
look at how cavendish does it in vanillaremade
oh right i shouldve specified,
Use SMODS.get_probability_vars
the first parameter of get probability vars is your card
second is the nominator
third is denominator
fourth is your seed
you'll want to use that seed later on so it calculates it correctly
No, that's the third.
No, that's the fourth.
i cant count
corrected
the first and second vars are for the local ones
so you can use it in the description of the card
they will change dynamically
im confused, how do i use that to update my joker text from 1/2 to 2/2
when oops all sixes is obtained
atlas?
bump
(bump)
try storing the value of this in before, and accessing it in after
i'm not sure if it can be called there
seem the same here
if you store it in ability.extra in after, then yes
if you store it there in before, then maybe not
you do not need to add register
i think, since it's calculating the hand after it's been played, it's like "no hand is being played so it's worth 0"
The only other reason I can see if both keys match is that the image isn't in the files or the file with the atlas isn't loaded
Sprite:draw_shader?
oh, so the diffuse shader handles the hover skewing?
No, because that doesn't exist.
The word diffuse is not found in balatro.
dissolve* sorry
that's not a shader
oh wait you mean the variable in said shader
so yes then
i don't follow ;u; start over
so, what does balatro do to make cards rotate in 3D space, when hovered?
[aware that Balatro is 2D but it makes it appear as 3D]
you can't just delete all that 😭
show the error
so your Voucher, right
did you give it an atlas
atlas = 'CustomVouchers'
?
wait nvm that's not the error anyway
you can remove the parentheses around the table you're giving Atlas
that's probably the issue
you're passing a table in as the first argument
that wouldn't change anything
nevermind :> but still do that
try removing the atlas_table line
still crashes
same crash?
do you have the files in the correct place? is your voucher defined after your atlas?
theres this function that should load the voacher
yeah but is the atlas code before the voucher code
the atlas code is before the voucher code
i have a more theoritcal question,
as some of you might know yahimice made a balatro mod where he has his twitch stream as a joker,
the joker gives 1 mult per 5 viewers he has,
is it possible for me to do this with how many hours a friend of mine has on a game on steam?
Yes, if their profile is public, I think.
im pretty sure it is
yes it is
how to actually do it is probably a task for later bcs thats gonna require alot of effort
but im happy to hear you think its possible
i mean you just need to make a SMODS.http and query a public steam api
i give up trying to make Doug Dimmadome cleverly ;u;
i'm just gonna make a gigantic sprite
maybe later, if i'm smarter, i can improve it
what does this crash mean again?
It means the atlas doesn't exist, or is the wrong atlas table.
grand, thanks
i don't get it
in both 1x and 2x
why is this one Joker doomed to not work 😭
No, I mean the atlas itself, not the file.
yeah i don't know why it wouldn't exist
How are you referring to it?
soo how can i resolve this crash
Im working on music for a mod i wanna make, how does this sound (im trying to kinda make it sound like the regular balatro music)

@maiden phoenix i have a question related to the fusion multi_box patch you shared with me
would you happen to know if i keep hovering/unhovering over a fusion card, with, lets say about 30 jokers, that it then produces lag that stays even when the card is sold?
# Add fusion ability to multibox -credit SDM_0
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = "if AUT.info then"
position = "before"
payload = """
if card and card.ability and card.ability.extra and type(card.ability.extra) == 'table' and card.ability.extra.maxboism_multi_boxes then
multi_boxes = {}
local _first = true
if card.ability.extra.maxboism_multi_boxes then
local boxes = SMODS.shallow_copy(card.ability.extra.maxboism_multi_boxes)
for i, v in ipairs(boxes) do
local key = v[1]
if not G.maxboism_savedjokercards[card.sort_id] then break end
local fusion_ui = Card.generate_UIBox_ability_table(G.maxboism_savedjokercards[card.sort_id][key])
if _first then
AUT.main = fusion_ui.main
AUT.main.main_box_flag = true
_first = false
else
multi_boxes[#multi_boxes + 1] = desc_from_rows(fusion_ui.main)
end
end
end
end
"""
match_indent = true
it really kills fps and im too stupid to see why
Does it keep appending multi_boxes with lower fusions?
it does not
even with only 2 jokers in if i keep at it for like a solid 10 seconds
the lag dissapears upon starting a new game though
or leaving to the main menu
genuinely baffled at what the cause is because my fusion jokers work almost perfectly atm its just the multi boxes kill performance somehow?
or something related to them
Can you check if multiboxes keeps adding up internally by printing its length?
alright let me see
looks fine?
but i may be stupid let me read the whole function itself to see whats going on
yeah no i dont see the reason why it would be like this
hey quick question
currently adjusting a legendary joker that I made
is gaining x1 mult whenever a probability fails good, or is it too broken and I need to tone down the mult gain
wait hold on
lucky cards are a thing
yeah one hand of lucky cards would be like X7 mult
how about x0.5 mult gain then?
Maybe its from shallow copying? Other than that no clue, if you still dont know ask Eremel, he's the one who integrated multiboxes to smods iirc
iirc i tried also directly reading from the table with the same result?
but let me try again rq
lmao if i disable multiboxes i can merge like 3000 jokers
i still haven't figured this out 😭🙏, it should be a prefix but it isn't s_
non, i do have my mod prefix
because if i put a joker name and j_ it appears just fine
but i don't want to display a joker i want to display a sticker description
also why does the badge say ERROR?
that is a separate localization file entry iirc
iirc its misc = { labels = { modprefix_stickerid = 'Text'}}
what does iirc mean?
if i recall correctly
goddam it's fine
so after looking at a bunch of toml files I still don't know hwo to patch nor even just add legendaries to the shop pool
FWÆ
so uh pls help
Pretty sure it shows the name in the docs
But it was label (in loc_txt) iirc
it is label thank you very much
I even found my old screenshot of the docs :clueless:
truly a patch
I've ran into so many bugs on smods release as people mark them as a bug from the mod i'm working on. (they still occur without the mod though)
help ;u; what went wrong this time
okay changing the py value of the atlas fixes this
but i need it to be that value
it's a big hat :3
ah ok
i tried doing it with a 71×95 image but it was broken so i gave up
YOUR LONG
Firstly, you shouldn't call card:set_sprites every frame, but it does nothing without inputs.
Why?
so the pos stays up to date
bump
No, because it's doing nothing.
how can i make a joker check when another joker is being triggered
if context.post_trigger
ty
doug cant get it up anymore
is the joker that got triggered context.post_joker?
No, it's context.other_card
okay
doesnt seem to work
is there a way to loop through each rank in the full deck and check how many of each rank there is?
make a table
add an index which has the id of the ranks
loop through all the deck with G.deck.cards
check if the card has an id equal to that
hold on
oh
ill do the code
Did you enable it?
its optional??
paper hat heh
Yes, because it calls a context to every card every time a joker triggers.
local tab = {}
for n, x in pairs(G.deck.cards) do
if tab[x:get_id()] then
table.insert(tab[x:get_id()], x)
else
tab[x:get_id()] = {x}
end
end
oooh thanks
np
whats the option i have to enable
like
what do i add
No, it's: ```lua
local ranks = {}
for k, v in pairs(G.playing_cards) do
ranks[v:get_id()] = (ranks[v:get_id()] or 0) + 1
end
oh
who should be the spades
SMODS.current_mod.optional_features = function()
return {
post_trigger = true,
}
end
G:delete_run()
how does this one work(it just crashes)
G.FUNCS.start_run()
ok thanks, although i am getting red squiggly lines on get_id
v:get_id()
right
me
It means something is trying to do assert() on something that doesn't exist.
Code?
if context.joker_main then
local rand = math.random(1,6)
if rand == 1 then
G.FUNCS.start_run()
end
ignore the other strat run one it is just a test
anything?
does anyone have a code example for SMODS.gradient
smods does
game_object.lua
that's pretty simple I can do that
smods has examples of most of the stuff it implements in game_object.lua, basically redefining vanilla content in smods terms
(although i think these gradients are used for the notice that you have mod conflicts/missing dependencies)
if context.joker_main then
-- code
end
gotta close that first if statement
how do i replace a card? adding jokers that replace themself with another card once their time is up
ok so I'm mostly finished with ther joker but the bottom row of the text is Xnil when it should say the current Xmult
key = "solo",
loc_txt = {
name = 'The Solo',
text = {
"Gives {X:mult,C:white} X1 {} Mult",
"Gain {X:mult,C:white} X1 {} Mult for each rank without",
"A duplicate in your {C:attention}full deck{}",
"{C:inactive}(Currently{} {X:red,C:white}X#1#{} {C:inactive}Mult){}"
}
},
atlas = 'MMM_Jokers',
unlocked = true,
discovered = true,
blueprint_compat = true,
rarity = 3,
cost = 8,
pos = { x = 4, y = 0 },
config = { extra = { xmult = 1 }```
not sure but id check the smod vanilla jokes for the invisible joke as a start
card:set_ability('j_modprefix_key')
hello am going to again ask of what is the problem with the atlas as i didn't managed to fix this
any help for what causes to crash the game will be very thankful
heres the error the game gives, the atlas table and the voucher file:
Im making a joker and want it to be able to copy more than 1 card in a similar way to blueprint. The SMODs API says merge_effects can be used to condense the returns of blueprint_effect. I am testing it and can not make it work. Below I have included the code for what I have so far. It currently should copy the effect of the joker to its left and the joker to its right.
calculate = function(self, card, context)
local left_joker = nil
local right_joker
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then left_joker = G.jokers.cards[i - 1] end
end
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then right_joker = G.jokers.cards[i + 1] end
end
return SMODS.merge_effects(SMODS.blueprint_effect(card, left_joker, context),SMODS.blueprint_effect(card, right_joker, context))
end,
}
Here is the vanillaremake blueprint code for reference
calculate = function(self, card, context)
local other_joker = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i + 1] end
end
return SMODS.blueprint_effect(card, other_joker, context)
end,
Could someone explain if I am using SMODS.merge_effects properly or if I am making a different error?
not sure what an atlas_table is, and the naming seems right, you sure the file structure is ok and the file isn't misnamed
removeing the atlas_table will still crash the game
local my_pos, effects = 1, {}
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then my_pos = i end
end
if G.jokers.cards[my_pos-1] then
effects[#effects+1] = SMODS.blueprint_effect(card, G.jokers.cards[my_pos-1], context)
end
if G.jokers.cards[my_pos+1] then
effects[#effects+1] = SMODS.blueprint_effect(card, G.jokers.cards[my_pos-1], context)
end
if next(effects) then return SMODS.merge_effects(effects) end
I see, thank you
Are you loading that file?
the voucher file? yes im loading the file
No, the one with the atlas.
yes am loading the file
Would it be feasible to change the background music if you're in the blind select screen and only if a specific boss blind is coming up? It's not super important, but I think it would be cool and I haven't had much luck finding anything about this
if G.STATE == G.STATES.BLIND_SELECT and G.GAME.round_resets.blind_choices.Boss == 'bl_modprefix_key'
Oh thank you, didn't realize it would be that easy
ok i can't for the life of me figure out why im not getting the current xmult in the text, ive tried from testing it updates just fine but isn't showing up in the text, ive tried removing the local from solo_tally but that doesn't change anything (have to send the actual code in next message bc character limit)
SMODS.Joker {
key = "solo",
loc_txt = {
name = 'The Solo',
text = {...,
"{C:inactive}(Currently{} {X:red,C:white}X#1#{} {C:inactive}Mult){}"
}
},
atlas = 'MMM_Jokers',
unlocked = true,
discovered = true,
blueprint_compat = true,
rarity = 3,
cost = 8,
pos = { x = 4, y = 0 },
config = { extra = { xmult = 1 } },
loc_vars = function(self, info_queue, card)
local solo_tally = 0
if G.playing_cards then
local ranks = {}
for k, v in pairs(G.playing_cards) do
ranks[v:get_id()] = (ranks[v:get_id()] or 0) + 1
end
for k, v in pairs(G.playing_cards) do
if ranks[v:get_id()] == 1 then
solo_tally = solo_tally +1
end
end
return {
xmult = 1 + card.ability.extra.xmult * solo_tally,
}
end
return { vars = { card.ability.extra.xmult, 1 + card.ability.extra.xmult * solo_tally } }
end,
calculate = function(self, card, context)
if context.joker_main then
local solo_tally = 0
local ranks = {}
for k, v in pairs(G.playing_cards) do
ranks[v:get_id()] = (ranks[v:get_id()] or 0) + 1
end
for k, v in pairs(G.playing_cards) do
if ranks[v:get_id()] == 1 then
solo_tally = solo_tally +1
end
end
return {
xmult = 1 + card.ability.extra.xmult * solo_tally,
}
end
end
}```
You don’t need
atlas_table nor :register
File should be under assets/1x
And assets/2x
https://github.com/Steamodded/examples/blob/d43316d97bc927f3de431dd84c0283d41e69761a/Mods/ExampleJokersMod/ModdedVanilla.lua#L17 here’s an example
already tried removing atlas_table and :regiter and it still crash
and the file is in both in 2x and 1x
i have officially given up, this will do
I can’t really the row numbers in the initial post, not sure it matters tho, bu
repost/bump from last night. strangely disabling the boss blind worked?
also oops works so idk what is causing the crash actually im assuming its my code
like everything seems to work its just this crash when going into the shop
looks like this crash happens regardless of the blind is disabled or not
Crash seems to talk about bl_gros_horizon, which isn't the one you posted here. Am I misunderstanding the crash or is there something else going on?
also I'd use context.fix_probability instead of context.mod_probability but that's probably kind of a secondary thing
is there anything in the code that would cause that?
what's the difference /gen
is it playing_card.ability.wheel_flipped?
I'm not sure, but you should double check which one of your blinds is the one actually crashing
like this? would i need to reset it after the blind?
the return was fine, you only need to change the if statement context check
the blind.disabled or context.fix_probability?
you only need to change if not blind.disabled and context.mod_probability then -> if not blind.disabled and context.fix_probability then yes
yeah, but you also changed the return to include denominator, which it shouldn't
okay it must be the radian itself because its the same crash even with horizon commented out
and i did remove the enominator line so not sure what's causing it now
and i can comment every other one out
same error even if its the only one
so it MUST be itself that's crashing not any other blind which rules out this
thanks discord, very helpful
discord momento
Hmm, weird. I'd double check what line functions/common_events.lua:2668 is about in the lovely dump
whats the prefix for booster packs?
I think it's either k or p? Whatever it says in smods/src/game_object.lua
hmm
so it could be the boss = { min = 1 }, line
not sure why though since min = 1 is allowed and all the other blinds worked
Ah, interesting. I'm guessing you're changing the blinds present in your game while continuing the same run?
that could be why
thanks!
wait that might be why
shit that might be why
since i changed the blind from the long to the horizon
please don't be why
mainly because it would make me stupid
im shawmhawking rn
weeeee
So I have a consumable here that swaps your hands and discards during a blind, and if you end up with 0 hands this way you lose instantly. But for some reason after you lose this way, your playing card hand stays active and blocks everything underneath it until the game gets restarted. I've tried moving the 0 hands check pretty much everywhere, and it does the same thing. Does anyone know how to fix this?
again not the most original
it works kinda
it doesn't debuff if removed and if you add one it doesn't apply asap
it does take like a moment
not sure why
it's weird like it works and does update correctly but not fast enough and not sure why
reference a similar blind (e.g. the plant or one of the suit-debuffing ones) from vanillaremade to make sure you're catching everything maybe
those simply have a debuff table i am duplicating the oyster i made which debuffs enchanced cards
and the oyster debuffs immediately if enhancement status changes?
yup
might need to hook/patch somewhere to force the game to recalc debuff when a seal is applied (i figure it's already set up to do so when a center changes, because that's a situation that can be encountered in vanilla. like changing a card's suit during a suit-debuffing blind)
my best guess is either my code isn't optimised or well yeah that
i doubt it's code optimization
i mean how hard would it be to hook/patch the recalc debuff and honestly would it be worth it since it does update and the deck does update when going into the blind
how to make a booster in the consumable area that the players can open
immediately going into the blind
the reason it looks like unfinished art wise since im going to go ahead and work on the code so i can worry about art later
how to create booster packs in the consumable area
what do you think of this idea?
Killer blind
removing all does make it more compact
that's enough for tonight going to get ready for bed and play some new horizons
how would i go about patching a 4th blind into every ante?
ok so im learning joker forge a bit
trying to figure out how i'd have a joker create one of two different tags when a blind is skipped
i wanna make a joker that does something only when money is subtracted or taken away
is there a event for that?
difference between ease_background_colour and ease_background_colour_blind?
oh GOD WHAT DID I DO TO THE SCALING
seems fair probably
green stake on stereoids
literally impossible
i mean the stake is literally called "You're Fucked" 😭
Its mainly to prepare for a new rarity im making
Where basically if you get it on any other stake besides YF, you kinda just win
oh
does anyone know why the xmult from the voucher is showing the mult above the deck?
you need to set card first, i believe.
the grand reveal (dont mind the stake image its not done yet)
Lightwork for my singular joker that is longer than most book chapters
what does it do 😔
Lots of things
N{n} scailing off triggers and money, every cent is +1 for n and every trigger, like opening packs and really anything gives +1
^ mult on conditions
^^ chips and mult
Luck changes
Luck chances
Setting changes
^^^^^^^ mult if you have only this joker
Busted scailing
X mult
X chips
Joker creation
Consumable creation
+1 slots for everything, joker slots, consumable slots, and all that
Its own mini guys (like summons basically)
More stuff
Uhh
Yeah
What if I just make it so that the youre fucked stake immediately crashes the game upon getting that joker
what if I just get the collector voucher from betmma vouchers and then redeem 1 bajillion blank vouchers
Its a little worse but still good
the math is slightly off i think, unless you've already addressed this
ante 1 should be 301 and ante 2 should be 304 (since 300 + 1{1}1 = 300 + 1 and 300 + 2{2}2 = 300 + 2)
Also average hyperascendent clears
I made it truncate to rhe first two places
The rest get put as zeroes
So 301 -> 300
304 -> 300
As im relatively sure thats how the base game does it too
What is the if statement for the highest ranked card in a played hand?
there uh
isn't one
you need to loop through the played hand and find the highest rank that way
set a local highest_rank to 0 before the loop, loop through the played hand, and if the current card has a higher rank than the current highest rank you store that new rank in highest_rank. at the end of the loop you now have the highest rank
if you're in context.individual, you can now check if the current card (i.e. context.other_card) has the highest rank, and if it does do whatever (if you wanted to do something when the highest rank is scored)
set the local highest_rank to -math.huge instead because if someone makes a negative rank for some reason the code is exploded
I forgot how to do lua i do like 4 coding languages and have short term memory loss
if someone makes a negative rank for some reason i will kill them with hammers /j
Not very nice :c
it is justifiable
alright i understand the concept but you'll have to walk me through the coding part
try it on your own first :3
I'm gonna get gunned down because of my -4 card rank now
ok so there's local in the joker I'm working on, but it's under update = function
can i do local in calculate = function?
yea you can do local anywhere
it essentially just means that as soon as you leave the function, the variable ceases to exist
you don't want to leave stray variables lying around, if that makes sense
no but what if it was like the dungeons and degenerate gamblers negative cards
you ever think about that one mr bat man
ok how would i set up the loop?
actually better question, does card.rank exist as a variable
card.base.suit, card.base.value, card.base.id, card.base.nominal...
so value in this case would be the rank?
so I think i want rank
because i don't think the loop would be looking for a string
unless i am mistaken
ID is number.
but what if it was a table
alright, how would i loop through played cards
for index, value in ipairs(G.play.cards) do
best time to do this is during context.before or context.after
do before if you want it to affect scoring and after if you don't
well what I'm trying to do is find a card with the Cell edition, as well as the highest rank in the played hand, and retrigger that card twice
it's best you run value:get_id() to get the rank of the cards, that makes it compatible with modded effects that change ranks
returns an integer, aces are 14 it's aces high
for edition check if value.edition and value.edition.key == "e_modprefix_editionkey" then
the first part here checks value.edition exists, otherwise it'll crash if the card has no edition
I already have the edition checking set up
hey, im trying to make a joker similar to steel joker that counts the Ace of Spades in ur deck and idk where i went wrong but its only doing x1 no matter how many ace of spades i have
config = {
extra = {
x_mult = 0.1,
ace_tally = 1
}
},
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.x_mult, card.ability.extra.ace_tally } }
end,
calculate = function(self, card, context)
if context.before then
for k, v in pairs(G.playing_cards) do
if v:get_id() == Ace and v:is_suit('Spades', nil, true) then card.ability.ace_tally = card.ability.ace_tally + 1 end
end
end
if context.joker_main then
return {
Xmult_mod = 1 + card.ability.extra.x_mult * card.ability.ace_tally,
message = 'X' .. card.ability.extra.x_mult,
colour = G.C.MULT
}
end
end
}```
you're changing card.ability.ace_tally when the internal value is card.ability.extra.ace_tally
yeah
oh retriggers? in that case
after you check the rank and edition of the card in context.before, set a flag on the correct card
like value.modprefix_hit, something that won't be used by other mods
like how c dagger applied card.getting_sliced to mark stuff
then in if context.repetition and context.cardarea == G.play then
you can check if the card has the flag modprefix_hit and retrigger that card twice return { repetitions = 2}
and then in context.after go through all the cards in the played hand again and remove the flag from all of them
technically you could just run the iterate through cards in context.repetition and ... that is really unoptimised and will run the loop way too many times, since context.repetition already goes through all the played cards once
you know what
this coding stuff is too much work for my brain at 11:53 pm
I'll do this tomorrow
that's fair
I need sleep I'm hallucinating
There are multiple black figures outside my house
are you sure you're not just in [Hyperlink Blocked.]
Maybe
call that the hyperlink block
I'm in the dark fountain help
what context should i have the tally fire in? i had it in before but doing that it doesnt update when a card is added
during loc_vars and during context.before for the joker to give accurate benefits
all code inside the loc_vars block runs when you hover over the joker
that makes sure it always displays the right value
oh thats convenient ty
mhm
You need to do that in add_to_deck
I have to go now, didnt know the time
I will not understand wht that means but the time I get back home]
@stoic void
-- code here
end```
```remove_from_deck = function(self, card, from_debuff)
-- code to reverse effect here
end```
Also you need a context check in calculate
So calculate = function(self,
Card, from_debuff)
Code
end
what you already have for the calculate but just add a
-- return here
end```
can you export stuff from forge into lua?
If you mean JokerForge there's a export mod files button
On the sidebar
ok thx
is there a pool for every center in the game? (including Jokers, Tags, Consumables)
or do i have to loop over G.P_CENTERS and G.P_TAGS separately
Anything not in G.P_CENTERS is not a center.
Is there a mod to start with a custom deck? I need it for testing some stuff
i'm making stakes similar to Ortalab's, that only allow Vanilla and Phanta content, and only Phanta Jokers
so i need to hook their in_pools
Why do you need a pool of everything for that?
