#💻・modding-dev
1 messages · Page 602 of 1
and where would I wanna do this at, because I have multiple Jokers that destroy playing cards
in the place you showed earlier? if you don't understand the concept of what I said I don't think I can help much
I mean would I need to make the list for each Joker, or would 1 time in the code for all the jokers work and I can call on the list whenever
you need to make it for each joker unless you don't want any of them to pick the same card in which case what i said doesn't work
None could hit the same
then you can add a flag when you pick to the cards (i think destroy_cards might already add getting_sliced idk) and make a list of the cards in hand without that flag. then do the part that i said with table.remove for the second destruction
Sorry about all the questions but how would I go about making a flag? LUA code is new to me so I have little idea what I'm doing honestly...
playing_card.this_is_a_flag = true
this will persist until you reload the game but because you're destroying them immediately after it doesn't matter
got it
would you make it where every new instance of a joker says that variable to false then
or would it not persist
i have no idea how lua works
if you mean at the beginning then no, fields in a table start as nil which is the only other falsy value alongside false so they don't need to be initialized
would I wanna put this in my Joker's config or is it something I can just call whenever and it'll work?
ah right mb
you can do that whenever yes
and I'm assuming i can change 'this_is_a_flag' to anything
yes
well, anything the game or other mods don't use
so i would recommend adding the mod prefix
check what grabber does
card.ability.perma_x_mult = (card.ability.perma_x_mult or 1) * 2
why doesn't this work?
I'd understand if this was an enhancement... but if this is triggered from a Joker, context.other_card.ability.perma_x_mult.
the card is from
_, card in ipairs(G.playing_cards)
🤔
it is a for loop
card.ability.perma_x_mult starts at 0
ok thanks
This might be a bit of an arbitrary question, but how difficult would it be to make a mod that only edits numbers and text?
would be pretty simple
localization files from mods override vanilla localization by default so thats pretty easy
and for editing the numbers of stuff you can use take_ownership https://github.com/Steamodded/smods/wiki/API-Documentation#taking-ownership
how to add an effect that happens after scoring and I mean a permanent effect that happens after scoring
Do said effect addition with context.after.
I mean that it happens automatically no jokers no nothing
Use the mod calculate.
what's wrong with my code? i want this consumable to convert all selected cards into the suit of the rightmost, but it's not the rightmost sometimes
death does it like this
wait no uhm
no that should be fine — there's a #G.hand.highlighted in there but it's not causing it
table.sort(G.hand.highlighted, function(a,b) return a.T.x < b.T.x end)
ah, thanks ^^
is it possible to display multiple images (souls) on a joker?
yes, using SMODS.DrawStep
@daring fern game crashed, complaining about hand_sorted being nil
No, it sorts G.hand.highlighted directly.
@maiden phoenix ik you did xBlindSize but is there a way to do hyperBlindSize
Is it a mod or a function?
It's a function.
Just change the math formula ig, never did hyper stuff
okie
Ok thanks
Hello, i keep carshing when i try applying a seal to a playing card with a spectral card.
Code?
SMODS.Consumable{
key = "spec_aegis",
set = "Spectral",
atlas = "v3",
pos = {x = 0, y = 1},
unlocked = true,
discovered = false,
cost = 4,
config = {
extra = { maxselect = 1 }
},
loc_txt = {
name = "Aegis",
text = {
"Gives the selected card",
"the {C:spectral}Silver Seal{}"
}
},
loc_vars = function(self, info_queue, card)
info_queue[#1116390750314307698_queue + 1] = { key = "sl_silver_seal", set = "Other", vars = {} }
return { vars = {
colours = { HEX("bec6d5") },
card.ability.extra.maxselect
}}
end,
can_use = function(self, card)
return #G.hand.highlighted == card.ability.extra.maxselect
end,
use = function(self, card, area, copier)
for i = 1, #G.hand.highlighted do
local highlighted = G.hand.highlighted[i]
play_sound("tarot1")
highlighted:juice_up(0.3, 0.5)
highlighted:set_seal("sl_silver_seal")
end
end
}
Remove _seal from the key when setting the seal.
Okay, trying now.
Work perfectly, I was adding the _seal as I needed to add it everywhere else. Thx a lot.
so it turns out I have no idea what I am doing so can I have an example?
SMODS.current_mod.calculate = function(self, context)
if context.after then
-- Code
end
end
thanks alot
I want to make a deck that starts you off with every vanilla combination of seal, enhancement, and edition (and then another deck for modded ones too), but I haven’t made a deck before. What does the code to set this up even look like?
I have a feeling five nested for loops (rank, suit, enhancement, edition, seal) will be pretty unoptimal
Yes, there would be 6656 cards.
i imagine it would probably not be great for your pc
aikoyori's shenanigans has a challenge that starts you off with 20X the normal cards and it already freezes for a bit when opening the deck preview
i dont think that would be a problem
JAS.calculate = function (self, context)
if context.after then
if not G.GAME.big_num_mult then
return{}
else
return{
xmult = G.GAME.big_num_mult
}
end
print(G.GAME.big_num_mult)
end
end
it is not even going through the after context
you should use context.final_scoring_step
for scoring
also make sure the value is actually set
the print is not going to do anything after a return also
oh I’ve done the math. I might have to call them the refrigerator and freezer decks lmao
how to set the joker slots to infinite?
G.jokers:change_size(math.huge)
thanks
I would like to make it so when you redeem the voucher a joker "evolves" into a different one, could someone please help
for k, v in pairs(SMODS.find_card('j_modprefix_key1')) do
v:set_ability('j_modprefix_key2')
end
could you explain a bit more, I'm really new to modding
SMODS.find card -> list of cards with matching key, used in the pairs loop here
v:set_ability -> turns the current card in the loop into the card with the specified key
alright thank you
How do you check if you have a specific mod on
next(SMODS.find_mod("<mod id>"))
if you just want to make specific objects not load you can also add a dependencies field to the object
which is a table of mod ids
no I want to make a consumable not load if you have talisman because it crashes otherwise
basically anti-crossmod
if not Talisman
okay I got it to work
How can I add a picture to the little round thing next to my mod in the mod manager?
make an atlas with the key modicon
whats the size?
32x32
thank you
does it also need a 2x version or do I just put it in the 1x?
you also need a 2x version
thank you
How can I make a joker not show up in the collection screen?
I did thi sbut it still showed up
Move it outside of the config.
ahh
another question I've had is how to make the tooltips, I tried making it with the {T:}, but it never seemed to work
{T:} is only for hover tooltips on deck descriptions
for anything else you should use info_queue in the card's loc_vars like so:
info_queue[#info_queue+1] = G.P_CENTERS[<some key>]
you can also use G.P_SEALS or G.P_TAGS, or just make it a table to be passed into localize (i think)
so in the key section I would put the key of the thing I want to describe in the tooltip?
Or do I need to make a new thing that defines what the tooltip says?
My joker I want to be described in the tooltip is called Ye
that would work yes
It doesn't though
is the key of the joker Ye?
this is the Ye joker so far
is your mod prefix also exactly YZY
yes
omg hai sadcube ^^
heyaa! what would be a check when card is drawn? im making enchancement that does stuff on being drawn!
ooooooo
i don't know but that sounds awesome
i was thinking hand_drawn maybe?
but that's for all the cards
if you need it to be individual that won't work
When I open up my modded pack, I have to use the cards and can't hold them for later.
add select_card = <cardarea> to the pack definition
where?
SMODS.Booster
and what replaces <cardarea>
thank you
hello i dont understnad why it happens, can someone help ?
its supposed to create 2 epic jokers and remove 1 joker slot (ping me pls)
It's Joker not Jokers also it's G.jokers:change_size(-1)
woops thanks
How do i check how many times I have a specific card type in my full deck?
enhanced card type
have you checked stone joker
I dont know where the jokers are in the game files
I already have the game files extracted
or can I not view them there?
you can but vanilla joker code is wierd because its all in one hardcoded function that handles every joker
plus vanillaremade also highlights best practices and such
rather than being a complete 1:1 recreation, its remade in a way thats how mods should do it
alright thanks
how do I actually code it so my starting deck is every combination of vanilla ranks, suits, seals, enhancements, and editions? Because I think I would rather die than hardcode this 11'700 times in Joker Forge
My goal is to not have to use JF. That’s why I asked here
oh
but didnt you already said what you need to do before?
thats why im confused
just do some nested loops
I know it’s some sort of nested for loop, but I don’t know how to set up the variables and stuff. I know the destination and the road but not which exits to take
i would recommend asking step by step then, just saying that makes it seem like you want the whole code made for you
i have a deck that applies an enhancement to all cards if you need some basics https://github.com/nh6574/JoyousSpring/blob/main/src/others/Decks.lua
I do know how to do that, yes. Thanks
fair enough
are the vanilla enhancements and stuff already in a list or table somewhere with Smods or do I have to define that manually?
G.P_CENTER_POOLS.Enhanced
hihi :3 i'd like my booster to do something special for the first card it summons, and something different for the second, and something different for the third
is there any way to do that?
^ you need to check if the enhancement doesnt have .original_mod
yes, create_card has an index argument
ah great! thanks ^u^
whats that prefix thing for enhancements? like the j_ thing
And Smods has a version of the same that’s the modded enhancements, right? Or do I misremember
Hi, folks! Question: how do I make it so the highlighted part of the code triggers 2nd (after the upper part of code)? Currently its vice-versa:
No.
Im not very familiar with code structure rules
damn. Ok
put the destroy_cards call inside the second event i think
kk
Nope!
nvm, YES!
but it seems like even though card is drawn to the hand, it doesnt get destroyed
hmmmmm
that table is all enhancements
Here's what I mean:
oh you need to put the code that creates the destroyed_hands table in the event too, my bad
because you draw the extra card(s) in an event, so they aren't actually drawn until after that event runs (which is after the calculate finishes)
okak
ic ic
ok i had to go afk before i could get an answer to this last night but. why does no sound play here. this is in the calculate function of an edition and value is not 1 because it's returning xmult that itn't 1
think you need play_sound, no?
returning a sound works too
no, you can return sounds and it should work like that
it could just be editions being wierd but idk
yea I tried that and for me it didn't work either
like this?
yes
returning a sound only works on a custom message iirc
What could be the issue?
try using SMODS.draw_cards(number) instead
I don't think it will make a difference but it might
👌
alternatively, put the draw code outside of an event
Didn't help :(
even with the destruction part either in or out of the event as well
that too didnt matter
how it looks rn:
but draw always happens first before destruction for some reason
wierd stuff
why are my consumables so sparkly 😭
I’ll have to just manually do the vanilla ones, thanks
skip_materialize = true
for the booster?
yes, in create_card
may i see the code
this is one of the functions that creates specific kinds of Hanafuda
ah
wait no i see
;u;
wrong position
silly billy
:3 hehe
i also don't get why this isn't working properly
i tried it with and without the second line, but no luck
it's being called like so
the particles are fixed btw :D
What is not working about it?
the wrong cards are being spawned
i expected chaff, ribbon_animal, bright in a normal pack, but got all animals
hold on actually lemme test this a bit further
ah no wait this works ^^; sorry to bother
please use the smods functions 😭
what functions -3-?
SMODS.create_card
ah ;u; ya true
loc_vars should be a function
return { vars = {...} }
thank you
I want the card ability to trigger when it's played
It's dollars and xchips
so they always have to be called that?
No, in the return.
yea I meant those
whats the difference between xmult and Xmult?
nothing
oh
its just different names for the same effect for convenience
hmmm
how to hyperop blind requirement...
ok so. return {x_mult = value, sound = sound, message = "X"..value} DOES make the sound play. however it also shows the X message 2 times, one for the actual xmult and one for the added message. so i still do not have a solution
remove_default_message = true
in the return
ok cool
now to figureo ut how i make the colour accurate
i cant tell if thats the purple colour or the dark_edition colour
probably dark_edition because. yeah
yeah editions usually use dark_edition
you dont have to though
i mean i want it to be consistent
Hi Doraccoon Team,
I’m a big fan of RACCOIN: Coin Pusher Roguelike. I was wondering if there are any plans to release a mobile version (iOS/Android) in the future. I would love to play it on my phone. Thank you for your time!
what
hello it's me again coming with a another question or problem:
how can i make it not playing the animation and not sounding like that?
wrong server pal, this is balatro
Use Card:remove()
didn't resolve the problem
how do i get a table containing the keys of every joker in my mod?
Say I want to play a sound whenever a certain amount of Joker slots are taken up out of a specific amount available.
If I have my stuff in components, which one should I put that code in?
"card" on line 38 is not a defined var
you want "Card"
they should be using SMODS.destroy_cards no?
I wanted without the destroy animation and loud sound
That and it's happening during apply so it's not super necessary
still didn't work
No, put temp_hand[i]:remove() in the for loop.
it worked, thanks
is there any way to make a msesage sound being returned in a calculate function be louder? im not sure if just adding vol to the return works
volume = number
awesome thx
-# 
Hook CardArea:emplace
a man walks into a poker table and asks about coins instead of chips
what sets the name at the bottom when opening a booster pack?
looking through vanillaremade rn for reference and i dont see anything related to it might just be blind
vanillaremade uses group_key and the localization file
why doesn't this work to make a booster pack that only has jokers from my mod? ```local mymodjokers = {}
for k, v in pairs(G.P_CENTERS) do
if v.set == "Joker" and v.mod and v.mod.id == "omegatro" then
table.insert(mymodjokers, v.key)
end
end
local omega_pack = SMODS.Booster{
key = "omega_pack",
loc_txt = {
name = "Omega Pack",
text = {
"stuffs"
},
group_name = "oh mah gowd"
},
atlas = "omega_pack",
pools = mymodjokers
}```
where do i make pool
i wanna make a pool of certain jokers
but like which file do i put it in?
<@&1133519078540185692>
aww shit here we go again
i missed what i can only assume to be the scammer but it seems really funny to assume that question is what the mods were called for
SMODS.ObjectType({
key = "j8bit_waterproof_banned_jokers", -- The prefix is not added automatically so it's recommended to add it yourself
default = "j_splash",
cards = {
j_splash = true,
j_erosion = true,
j_seltzer = true,
},
})
anyway you can do it like this
is there anyway to do custom context?
you can calculate a context with SMODS.calculate_context
that will calculate all cards with the given table as the context table
whar?
Ok but what file
Like the main one
may you provide an example please
The jokers?
Jokers it is then
SMODS.calculate_context { foo = true, bar = 4 } will calculate all cards with context.foo being true and context.bar being 4
ah alright
also usually its best practice to add your mod prefix to your own custom contexts to not potentially interfere with other mods adding a context of the same name
ah algiht
why is my game crashing?
i know this code is causing it:
local _colors = G.C
-- create proxy
G.C = {}
local function is_color_table(table)
if type(table) == "table" then
for _, v in pairs(table) do
if type(v) == "table" then return true end
end
end
return false
end
local function replace_green_color(color)
if type(color) == "table" and next(color) then
local newcolor = copy_table(color)
newcolor[1] = 0
newcolor[2] = (color[1] + color[2] + color[3])/3
newcolor[3] = 0
return newcolor
end
return color
end
local function replace_green_table(table)
local newtable = {}
for k, v in pairs(table) do
if not is_color_table(v) then
newtable[k] = replace_green_color(v)
else
newtable[k] = replace_green_table(v)
end
end
return newtable
end
-- create metatable
local mt = {
__index = function (t,k)
if not PSI.config.green then
return _colors[k]
end
if type(_colors[k]) == "table" then
if k == "UI" or k == "WHITE" then return _colors[k] end
if is_color_table(_colors[k]) then return replace_green_table(table) end
return replace_green_color(_colors[k])
end
return _colors[k]
end,
__newindex = function (t,k,v)
_colors[k] = v -- update original table
end
}
setmetatable(G.C, mt)
hi again, question:
where can i find these lines of code?
is it in the smods folders?
lovely dump
Hey all! For the steam modded framework what’s the snippet of code to make a joker that adds Xmult like the lucky cat? Can someone post a screenshot or walk me through how to basically have exactly the lucky cats Xmult effect trigger whenever ever say any 3 card is played? Thanks!
I figured out how to do both adding mult and adding chips but can’t figure out how to do scaling of any kind!
the example mod does it
basically, do something like this (dont copypaste this this is psuedocode)
card scored
{
if card.rank = 3
{
xmultvar +0.75
}
}
hand played
{
apply_xmult(xmultvar)
}
Is there a good / simple way of looping trough all my added Content?
-# Jokers, Decks, Blinds, Tags, maybe even Sleeves
Ay, I figured it out ^w^
SMODS.Consumable {
key = "lithium",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 16, y = 0 },
unlocked = true,
discovered = true,
can_use = function(self, card)
return true
end,
use = function(self, card, area, copier)
G.GAME.xiferp_alkimetal_chips = (G.GAME.xiferp_alkimetal_chips or 0) + 5
local alki_card = SMODS.add_card { set = "Base" }
G.GAME.blind:debuff_card(alki_card)
G.hand:sort()
SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
end,
loc_txt = {
name = 'Lithium',
text = {
'Adds +5 chips for the hand',
'after this is used, and adds one',
'new card to the deck',
},
},
}```
Where's the break in this code that causes the game to up and crash without a log?
(not upon use, but upon buying from the shop)
SMODS.Consumable {
key = "cerium",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 1, y = 7 },
unlocked = true,
discovered = true,
config = { extra = { yes_is_no = false } },
keep_on_use = function(self, card)
return true
end,
can_use = function(self, card)
if card.ability.extra.yes_is_no == false then
return true
end
end,
use = function(self, card, area)
card.ability.extra.yes_is_no = true
end,
loc_txt = {
name = 'Cerium',
text = {
'Adds +20 mult per odd card for',
'the hand after this is used',
},
},
calculate = function(self, card, context)
if card.ability.extra.yes_is_no == true then
if context.individual and context.cardarea == G.play then
if context.other_card:get_id() == 3 or context.other_card:get_id() == 5 or context.other_card:get_id() == 7 or context.other_card:get_id() == 9 or context.other_card:get_id() == 14 then
G.GAME.lanthanide_mult = (G.GAME.lanthanide_mult or 0) + 20
SMODS.destroy_cards(card, nil, nil, true)
end
end
end
end
}```
And while I'm here, apparently this is an eternal buff.
anyone know what colors this menu uses?
The text?
More accurately, this just buffs every card after that specific hand.
fixed it, forgot to set lanthanide mult to 0 after
now for this one...
Nope, still broken, just you have to use two lanthanide cards and not one.
<@&1133519078540185692>
<@&1133519078540185692>
Good.
Anyway,
SMODS.Consumable {
key = "cerium",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 1, y = 7 },
unlocked = true,
discovered = true,
config = { extra = { yes_is_no = false } },
keep_on_use = function(self, card)
return true
end,
can_use = function(self, card)
if card.ability.extra.yes_is_no == false then
return true
end
end,
use = function(self, card, area)
card.ability.extra.yes_is_no = true
end,
loc_txt = {
name = 'Cerium',
text = {
'Adds +20 mult per odd card for',
'the hand after this is used',
},
},
calculate = function(self, card, context)
if card.ability.extra.yes_is_no == true then
if context.individual and context.cardarea == G.play and context.other_card:get_id() == 3 or context.other_card:get_id() == 5 or context.other_card:get_id() == 7 or context.other_card:get_id() == 9 or context.other_card:get_id() == 14 then
G.GAME.lanthanide_mult = (G.GAME.lanthanide_mult or 0) + 20
SMODS.destroy_cards(card, nil, nil, true)
end
end
if context.after then
G.GAME.lanthanide_mult = 0
end
end
}```
My fix to my cards seems to break it worse
Is there a way I can destroy a playing card in a specific position (leftmost, for instance)? Its currently random but think a fixed position would be MUCH easier to code
local card_ = pseudorandom_element(G.hand.cards, 'seed')
SMODS.destroy_cards(card_, nil, true)
chat how do i make the challenge ui work
What part?
the rules and banned items
The banned items are easy: restrictions: 'keys of the stuff you don't want'.
As for the rules...
ive already done that, its just that the banned items arent showing up in the challenge menu
...?
Hello I have 2 jokers:
Uro Bound that has this: yes_pool_flag = "uro_bound_destroyed"
and another that has this:
in_pool = function (self, args)
return not G.GAME.pool_flags.uro_bound_destroyed
end
When Uro Bound is destroyed, the uro_bound_destroyed is set to false. However when I disable all other jokers using banner none of the jokers appear in the shop. Any idea why?
put v_ in front of the vouchers
oh, ty lmao
And any specific boss you wanna ban?
i have a hook on get_next_boss() that makes every boss blind the same
Ah.
is there a prefix for skip tags btw?
tag_
thx
thx
yw!
how do i make the rules display in the menu
That I don't know.
thx for the help nonetheless
Sry, do u have any idea on this?
hey just curios how do you change the base "balatro" image on the menu (like how yahimice made it "balala")
Create an atlas with the key balatro, iirc
do i make a sperate file for this or make in my main.lua
You can do it wherever
and what does the function look like for actually applying the atlas
well in a joker you use the atlas to apply it to that joker
then i get this error
considering youre asking that probably not
because i just took the atlast i have for jokers and changed it to balatro and balatro.png
Do you have a balatro.png in your assets folder
yes its in 1x rn
SMODS.Atlas {
key = "Balatro",
path = "this_is_my_logo.png",
px = pixel_x,
py = pixel_y
}
You'd need to get the pixel size for the x and y and fill those in as they are
with 2x my game doesnt crash anymore but the background doesnt change either (both in 1x and 2x not one or the other)
Okay, so are you trying to change the "Balatro" text? I think I may see what to do but this is just a random shot rn
yes i just want to update the text
the colors are for latrer i have college tomorrow XD
I think then we're looking for a 'splash,' just looking at a mod that uses a custom logo so again, guesswork 😅
oh really?
i didnt expect it to be on there so i didnt bother looking because why would it be
Im pretty sure its near the mod icon thing on the wiki so just search for mod icon on the wiki
wait wiki?
theres a wiki for this?
not yet sadly
Huho
I think I have something then
this is directly under that
Oh
okay well after a little expirementing
Try this maybe? I see its called splash in a mod with a custom logo
SMODS.Atlas {
key = "splash",
path = "image_here.png",
px = size,
py = size,
}
progress I guess lmao
what i did for that result is shamelessy copy it from another mod
which uses this
which tbh i have no clue in the world why youd use logo
like this
Very good question
it also doesnt matter i think
because removing logo and just making it the balatro.png gives the same result
sorry :p
lol dont apologize
youve helped me out tons
wait
theres progress
its here but in the wrong size lmao
@next timber real quick could you elaborate on how you suggest setting context.blueprint for jokers that retrigger other jokers
astro said that they were retriggering the scaling which implies whatever method of retriggering you're using ignores context.blueprint, which it really should not do
unless i'm stupid, it
doesn't
How can i make the thing that Misprint have where you can see the next card in deck ?
hm
y'know what maybe it's just an issue on magolor's end
wtf
yea i'm fuckin stupid i never check for blueprint with magolor
although it's still retriggering
hm
how on earth do i center it lmao
ok i switched it to use scale_card and it works
for reference, retrigger doesn't interact with context.blueprint at all. if the joker returns something in the calculate function, it can and will be retriggered. using SMODS.calculate_effect on the card instead of returning a message will disable the joker from being able to be retriggered in that scenario (and scale_card calls calculate_effect)
That one I have no clue on 😅
its so confusing
its related to pos
but i dont really see the issue
because pos dictates size (apparently)
Maybe size up the logo? Use 2x for the 1x and double it again for the 2x? Unsure
you might be onto something
okay so i got it to kinda work
the issue is that the center is different because iam adding a letter
Damnnn
i also figured out it has to do with the friend i asked to make the art making it the wrong size lol
Ohhh lol
anyone have examples of collab art mods?
specifically, one mod that adds multiple suit changes
how can i change this so it verifies if the card is a custom rank ?
context.other_card.base.value == "key"
just dropping this off here, currently i have this as the main menu and iam wondering how to make the image bigger while still having the little needle (orwhatever normally pierces the ace) on the center
i know this is probably difficult considering the defealt pos for the image is set but its worth asking maybe someone knows
(here is the image iam using btw which iam aware is a little clunky but im not that good at art )
thanks!
after adding a second suit to the atlas, the original broke
should look like this
now looks like this
oh, can u show the deckskin code
sure
local atlas_key = 'ror' -- Format: PREFIX_KEY
-- See end of file for notes
local atlas_path = atlas_key .. '_lc.png' -- Filename for the image in the asset folder
-- local atlas_path_hc = 'ror_hc.png' -- Filename for the high-contrast version of the texture, if existing
local suits = { 'hearts', 'clubs', 'diamonds', 'spades' } -- Which suits to replace
local ranks = { 'Jack', 'Queen', "King" } -- Which ranks to replace
local description = 'Risk of Rain' -- English-language description, also used as default
SMODS.Atlas {
key = atlas_key .. '_lc',
px = 71,
py = 95,
path = atlas_path,
prefix_config = {
key = false
} -- See end of file for notes
}
if atlas_path_hc then
SMODS.Atlas {
key = atlas_key .. '_hc',
px = 71,
py = 95,
path = atlas_path_hc,
prefix_config = {
key = false
} -- See end of file for notes
}
end
for _, suit in ipairs(suits) do
SMODS.DeckSkin {
key = suit .. "_skin",
suit = suit:gsub("^%l", string.upper),
ranks = ranks,
lc_atlas = atlas_key .. '_lc',
hc_atlas = (atlas_path_hc and atlas_key .. '_hc') or atlas_key .. '_lc',
loc_txt = {
['en-us'] = description
},
posStyle = 'deck'
}
end
and atlas
change pos style to ranks maybe? also why the atlas so big just limit it to the 3 cards
just did a collab thing myself if u wanna take a look at it
its nothin but the collabs so 👍
the mod I'm copying the code off of had an atlas that could hold the entire deck, so I just decided not to mess with it and do what it did
oh, fire
would I make two SMODS.Deckskins for the two separate suits?
yea
game crashed lol
for some reason this logic doesn't require room yet i feel like it should
for i = 1, math.min(card.ability.extra.create, G.consumeables.config.card_limit - #G.consumeables.cards) do
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.4,
func = function()
play_sound("timpani")
SMODS.add_card({ set = "Lenormand" })
card:juice_up(0.3, 0.5)
return true
end
}))
end
card.ability.extra.create = 1 btw
ok, now I'm confused. It's having trouble making an atlas
does anyone know why juice_up is crashing?
if #hearts >= card.ability.extra.count then
for k, v in ipairs(context.scoring_hand) do
v:change_suit("Hearts")
v:juice_up(0.3,0.4)
end
return {
message = "<3",
card = self
}
end```
show the code lol
oh, right
also bump for this bc i'm confuseddd
you did the atlas wrong
what 😭
deckskin doesnt add ur mod prefix to the atlas key automatically
so itd be modprefix .. atlas_key
you make a second atlas for the spades
nope
womp womp I guess lol
perhaps a basic question, but what is the proper way to "sequence" several events such that they occur one after the other without trying to play over or interfere with each other?
so turns out I can do it in one file, if I use the deck pos style
event manager
or if youre talking abt like, calculate returns, add "extra" table to ur return table
{
xmult = 2,
extra = {
message = "delayed message!"
}
}
I'm using the event manager, the events seem to be running into one another nevertheless.
show the code
sure
curt_Consumable {
key = "rev_chariot",
atlas = "rev_tarot",
pos = { x = 1, y = 1 },
calculate = function(self, card, context)
if context.buying_card and context.card.ability.set == "Voucher" then
local voucher_key = get_next_voucher_key(true)
local _card = Card(G.shop_vouchers.T.x + G.shop_vouchers.T.w/2,
G.shop_vouchers.T.y, G.CARD_W, G.CARD_H, G.P_CARDS.empty,
G.P_CENTERS[voucher_key],{bypass_discovery_center = true,
bypass_discovery_ui = true})
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
create_shop_card_ui(_card, 'Voucher', G.shop_vouchers)
_card:start_materialize()
G.shop_vouchers:emplace(_card)
return true end }))
curt_queue_juice_use_dissolve(card)
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 1.4, func = function()
if _card.area then _card.area:remove_card(_card) end
draw_card(G.hand, G.play, 1, 'up', true, _card, nil, true)
G.GAME.round_scores.cards_purchased.amt = G.GAME.round_scores.cards_purchased.amt + 1
_card:redeem()
return true end }))
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 1.4, func = function()
_card:start_dissolve()
return true end }))
end
end
}
and elsewhere:
function curt_queue_juice_use_dissolve(card, from_rev_fool)
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.6, func = function()
card:juice_up(0.6, 0.1)
card:use_consumeable(G.consumeables)
SMODS.calculate_context({using_consumeable = true, consumeable = card, area = card.from_area, from_rev_fool = from_rev_fool})
card:start_dissolve()
return true end }))
end
Observed behavior: https://youtu.be/Fqjh6IUFK-0
The intended effect - When purchasing a voucher, another is spawned and immediately purchased
This occurs, but the visuals are buggy because the events are not being sequenced properly and so events are starting before the previous one finishes.
@jolly shadow ^ the code and so forth as requested. Thanks in advance! I appreciate the assistance.
If need be, I can make a minimal example mod for you to test.
not quite sure why its not working as intended
maybe its the buying card context? perhaps should find a different context after the fact to do the visuals and redeeming
how do you use in_pool() correctly? Does it go in the calculate section of a Joker?
@sage crater you can check VanillaRemade (specifically Cavendish and Gros Michel) for an example
ah, true. Forgot that existed. thank you :]
No, you need to do _card.states.visible = false outside of the event.
bump
bump, here's the full joker code if wanted as well:
SMODS.Joker{
key = "bonsai",
name = "Bonsai",
config = {
extra = {
odds = 10,
create = 1
}
},
pos = { x = 3, y = 0 },
cost = 8,
rarity = 3,
blueprint_compat = true,
atlas = "joker",
loc_vars = function(self, info_queue, card)
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, "j_chm_bonsai")
return {
vars = {
numerator,
denominator,
card.ability.extra.create
}
}
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.hand and context.other_card:is_suit("Hearts") and SMODS.pseudorandom_probability(card, "j_chm_bonsai", 1, card.ability.extra.odds) then
for i = 1, math.min(card.ability.extra.create, G.consumeables.config.card_limit - #G.consumeables.cards) do
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.4,
func = function()
play_sound("timpani")
card:juice_up(0.3, 0.5)
SMODS.add_card({ set = "Lenormand" })
return true
end
}))
end
return {
message = "+" .. tostring(card.ability.extra.create) .. " Lenormand",
colour = G.C.SECONDARY_SET.Lenormand
}
end
end
}
bump
did my guy really just bump his message twice in a minute 💔
Is there a way to directly reference jokers in your joker roster that are perishable and modify them? Curious about this
error, thought it didn't
The idea is to have a joker do something to one of your perishable jokers (picked at random) but I'm struggling to find a way to reference currently owned jokers that are perishable or debuffed or both
You just need to iterate over G.jokers, manually check each, and add them to a list.
Gotcha
It might be G.jokers.cards, or some other slight variation
Any obvious way to check if a joker is perishable? I see SMODS.is_eternal exists but not an equivalent
I feel like there should something like if context.joker = perishable, but don't take me as gospel.
i don't believe so
if anything it would probably be something utilizing likeSMODS.find_card()
And that's why I'm a frequent here
how do you change vanilla content from being in one category in your collection to another?
I'm trying to make a new category of card modifier called material, and move glass, steel, stone, gold, and lucky into that category (instead of being an enhancement)
I think you take ownership of it.
is that going to be using this function?
I don't know that part, I never took ownership of anything in a mod so far
ok
do you know where I could find it on the wiki? It doesn't seem like it's in the side bar
but I have seen it before, I just don't remember in what page
ah, found it. It's in API Documentation
I see that card.perishable exists, is that something that could be referred to?
like G.jokers.cards[i].perishable or something
I'm now realizing that I wouldn't just need to make a handful of new enhancements, but instead a new tier to put the old enhancements. I think this is out of my depth 😅
You're telling me, some cards I've made just crash the game.
No, it's card.ability.perishable
No, that's for boosters.
Interesting, but is there a way I can utilize that to iterate through your joker roster and place perishable jokers into a list?
card.ability.perishable would just refer to the joker itself in this instance right
local perishables = {}
for k, v in pairs(G.jokers.cards) do
if v.ability.perishable then
table.insert(perishables, v)
end
end
What's k's job in this
Nothing.
It's necessary to have?
how do I go about making a new card modifier?
I assume I'll need
- new logic for the card to recognize it needs to do stuff
- a new button in the collection + all the logic that goes along with showcasing the new stuff
anything else/do I have it completely wrong?
yes; you're iterating over pairs, so you need two variables even if you don't use the first
also iirc, k basically is just an integer representing the joker's index
Do you want it to be able to stack with other enhancements?
yes. The end goal is to move all the enhancements that change the card into another material into a new modifier tier called "material" and make them usable with other enhancements
.
Yes, you would probably hook Card:set_ability and Card:calculate_enhancement
time to learn about hooking
i'm still not sure why this joker is ignoring consumable slots entirely
You can replace it with an _
I see
But ipairs and pairs return both a key and value
The joker worked without a hitch surprisingly, I'm almost suspicious
I've yet to have one work on the first run
It picks a random debuffed or perishable (or both) joker and brings it back to life
If it had/has the perishable tag, it removes that tag
Made it in honor of all the heartbreaking perishable blueprint/brainstorms I've seen in high stake runs
is there a way to do something when a card is first created and never again?
set_ability function
is this inline with the calculate function?
...
smods/the game handles that automatically
if all you're doing is setting those initial values, you don't need the set_ability function at all
Anyone know a way to return a message but have it return to a different joker than the one being currently called on?
message_card = target
then yes the function itself is where it should be
it does also take two more arguments, initial and delay_sprites, but the game won't die if you don't include them
I'll have to play around with that
the coding is scuffed, but the idea is there lol
message_card is equal to the joker I want the message to come from?
and returning a message afterwards would return the message from that location?
Basically I'm trying to return a message from a joker, and then return a message from another joker that gets affected by this joker
return { message = "the balls", extra = { message = "harden", message_card = G.jokers.cards[1] } }
should make "the balls" appear on the triggering Joker and "harden" on the first Joker held, as example...
Worked like a charm, thanks
getting an error on my for loop. Could someone enlighten me on why?
for _, v in pairs(G.jokers or {}) do
if v.key == "florble" then
toGain[1] = v.ability.extra.var1 or 0 -- chips
toGain[2] = v.ability.extra.var2 or 1 -- xchips
toGain[3] = v.ability.extra.var3 or 0 -- mult
toGain[4] = v.ability.extra.var4 or 1 -- xmult
total = total + 1
end
end
G.jokers and G.jokers.cards or {}
ah, ok
game is crashing when I play a hand with this new joker. Anything look like the problem?
It's v.config.center.key also it's j_modprefix_key
ah, thanks
replacing these parts?
bro why does alt+f5 not work sometimes
and pressing R after getting an error
it just decides to break and I have to go the slow way around and hit play in steam again
i just added the exe to my task bar
I'm sure I could find a workaround, but I'm on a steam deck, so I need to run exe programs through steam's proton
sad
still getting crashes, but now it's a new error with slightly different code
Firstly, move the if context.joker_main check to the top, Secondly, the second input of pseudorandom_element should be a string, Thirdly, remove the florble_list = before table.insert
ah, so it should be a string
it was complaining that I put in a string instead of an integer and I was confused by that
blarg, it's complaining about the string again
Your SMODS version is very old.
only 6 months old am i right
it appears I've made a fork bomb in my balatro
when time to score:
make a new copy of yourself
score as intended
``` seems to also run this on the copied version before it has existed for a round...
first question: how do I stop this?
second question: how do I limit the cards created per hand scored to 1?
I'm imagining I'll need to set a global var or something, but idk how I'd do that in lua
Code?
No, move everything into the if context.joker_main check, also put the copying of the joker in an event.
is this good?
No, put the copy_card into the event.
ok
ok, so...
it no longer crashes...
which I guess is good
if not for the fact that now my memory is being inhaled
You need to return true in the event.
Finalized version of my reworked achievement menu
gump
Anyone know how to get the amount of chips each card’s rank grants?
I want to make a joker that adds the chips of each card held in hand.
what's the context for on score effects on enhancements?
card:get_chip_bonus()
Thx
context.main_scoring
so if i did like (pseudocode) if context.main_scoring then return 3 xmult it would give 3 xmult every time it scores?
or do i need an additional context or something
context.cardarea == G.play
ah okay thank you
getting the error attempt to compare number with table
Log?
You need to add talisman support
ah
is that done in the json file, or do I actually need to code something?
like do I just need to add it to the dependencies, or is there something I need to add to my lua file/s
you need to wrap numbers / values that are numbers with to_big()
so if you have
if silly < 10 then
you'd make it
if to_big(silly) < to_big(10) then
only if theyre going to be bignums
also this crash is in a base balatro file, are you doing any patches there, or setting any variables used outside of the joker?
you probably want to use add_to_deck rather than set_ability unless you have a reason im unaware of
ah ok
no clue if that's causing the issue but
best to use the function youre meant to use even if set_ability works
could it possibly be that my talisman version is out of date and I need to get the newst version?
Yes.
ah yep, that fixed it lol
How do you get the level, chips and mult of a certain poker hand?
Yes, don't use the second or third inputs.
ah, cool
G.GAME.hands['modprefix_key'].level, G.GAME.hands['modprefix_key'].chips and G.GAME.hands['modprefix_key'].mult
Thx
hello i try to destory card, but it dosen't work, may someone help me with it ? It should destroy the card at the if context.destroy_card but it dosen't destroy anything ?
Also, how can i localize the message on only one playing card ?
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
if SMODS.pseudorandom_probability(card, 'sl_trooper', 1, card.ability.extra.odds) then
if context.destroy_card and context.cardarea == G.play and context.destroying_card == card then
return{
chips = card.ability.extra.chips
delay = 0.2
SMODS.calculate_effect({message = localize('sl_kia'), colour = G.C.MULT}, card)
remove = true
}
end
else
return{
chips = card.ability.extra.chips
SMODS.calculate_effect({message = localize('sl_nkia'), colour = G.C.GREEN}, card)
}
end
end
end
context.individual and context.destroy_card don't happen at the same time.
can someone help meee im trying to make a joker that turns hearts into spades but its not working out, any advice?
ahhhhhh
if context.before then
for k, v in pairs(context.full_hand) do
if v:is_suit('Hearts') then
SMODS.change_base(v, 'Spades')
end
end
end
omg thank u , ill try this now
may anyone show an example of how i could use G.UIT.O in a sense to create a button during the main part of the game
with sprites and such
How can i do that a custom rarity shows only if i use a custom deck ?
get_weight = function(self, weight) return G.GAME.selected_back.effect.center.key == 'b_modprefix_key' and weight or -math.huge end
in the deck code or the rarity code ?
In the SMODS.Rarity
and how can i make all jokers (excepts these ones) never spawn with this deck ?
in SMODS.Back ?
what's the effect called that made the soul do its little boucy thingy ?
and what does it do ?
SMODS.DrawStep
for k, v in pairs(G.P_CENTERS) do
if v.set == "Joker" and not (k == 'j_modprefix_key1' or k == 'j_modprefix_key2') then
G.GAME.banned_keys[k] = true
end
end
SMODS.Back ?
Yes.
how do i make the blinds harder like how plasma deck does, do i need patching
Is this for a deck?
nah for the entire mod
i make the chips stay over from the previous blind, so i need to really ramp up the difficulty
G.GAME.starting_params.ante_scaling = number
should i place this in reset_game_globals
what should i add instead of j_modprefix_key1 and j_modprefix_key2
The keys of the jokers you only want to appear.
so i can add more ?
Yes.
hm, after testing the joker becoming extinct from copying gros michel/ cavendish is a problem and singing machine destroying another copy of singing machine is a problem
is this normal ?
that has to be in an actual function
i dont think gros michel/cavendish self destruction can be blueprinted
what function ?
well idk what kinda object this is
or what youre trying to do
but you cant just drop random code in the table
singing machine completely steals all abilities from jokers basically
i see
well if its not blueprinting then the gros michel/cavendish would probably just get destroyed in whatever invisible cardarea theyre in
assuming thats how youre doing it
the joker itself has the abilities
it extincts itself and is in a state of dead and alive
somehow
singing machine is the line joker
you cannot select it, but its abilities still works
and it counts for a joker slot
i want that when you play with a custom deck, the only jokers you can have are from a custon rarity
calculate = function(self, card, context)
if context.setting_blind and G.GAME.blind.boss and not context.blueprint then
local jokers = {}
for _, j in pairs(G.jokers.cards) do
if j ~= card then
if SMODS.pseudorandom_probability(card, 'group_0_e2e11086', 1, card.ability.extra.odds, 'j_fox_singing') then
table.insert(card.ability.extra.currentJoker, j.config.center.key)
SMODS.destroy_cards(j)
end
end
end
end
if card.ability.extra.currentJoker then
local mergetable = {}
for i, j in ipairs(card.ability.extra.currentJoker) do
local key = j
G.fox_savedjokercards = G.fox_savedjokercards or {}
G.fox_savedjokercards[card.sort_id] = G.fox_savedjokercards[card.sort_id] or {}
if not G.fox_savedjokercards[card.sort_id][key] then
local old_ability = copy_table(card.ability)
local old_center = card.config.center
local old_center_key = card.config.center_key
card:set_ability(key, nil, 'quantum')
card:update(0.016)
G.fox_savedjokercards[card.sort_id][key] = SMODS.shallow_copy(card)
G.fox_savedjokercards[card.sort_id][key].ability = copy_table(G.fox_savedjokercards[card.sort_id][key].ability)
for k, v in ipairs({"T", "VT", "CT"}) do
G.fox_savedjokercards[card.sort_id][key][v] = copy_table(G.fox_savedjokercards[card.sort_id][key][v])
end
G.fox_savedjokercards[card.sort_id][key].config = SMODS.shallow_copy(G.fox_savedjokercards[card.sort_id][key].config)
card.ability = old_ability
card.config.center = old_center
card.config.center_key = old_center_key
end
local effect = G.fox_savedjokercards[card.sort_id][key]:calculate_joker(context)
if effect then
table.insert(mergetable, effect)
end
end
return SMODS.merge_effects(mergetable)
end
end
can i have 2 apply ?
if it destroys another version of singing machine the game crashes
You're missing some of the code.

my apply already looks like this, and i'm not sure i know how to add other things
just... add more code after that?
for i, v in ipairs({'juice_up', 'start_dissolve', 'remove', 'flip'}) do
G.modprefix_savedjokercards[card.sort_id][key][v] = function(_, ...)
return card[v](card, ...)
end
end
because i don't know how to code and i litteraly use the code from another mod i found
also v.base.value is already the rank key so theres no point in looking into SMODS.Ranks
isnt this just SMODS.destroy_cards
what mod are you looking at
No.
what does it do then
It makes it so the real card gets destroyed if something tries to destroy the fake card.
okay looking at the fact that all the files are added via upload and there are no subfolders for the wall of files im going to guess that this isnt that well made
ah
also use vanillaremade for reference instead https://github.com/nh6574/VanillaRemade/tree/main/src
but i didn't find what i want
which is
at least i didn't understand
what were you looking for
to replace existing ranks to custom ones when i use a custom deck
and where do i put that code ?
you just wont find anything in vanilla decks because they have pre-made starting decks that are enabled with a modifier
but what i have works so for me it's good, that's not what i want now
well anyway
just add this to the apply ```lua
for _, rarity in pairs(SMODS.Rarities) do
if rarity ~= "<rarity key>" then
G.GAME[rarity:lower().."_mod"] = 0
end
end
i think
At the end of the if not G.fox_savedjokercards[card.sort_id][key]
what's in the "_mod" ?
wdym whats in that
you can just leave it if thats what youre asking
it comes from this
uhhhh
for _, rarity in pairs(SMODS.Rarities) do
if rarity.key ~= "<rarity key>" then
G.GAME[rarity.key:lower().."_mod"] = 0
end
end
```try this
i don't even know what "concatenate" means..
It means to merge 2 strings.
ooh okay
what are the keys for the vanilla rarities ?
Common, Uncommon, Rare and Legendary
does this fix extinct and singing machine crashing if it destroys another singing machine
Yes but no you would have to just tell it to not copy other jokers of the same key.
how can i change weight of a rarity ? (like Common for example) is it like this : G.GAME.Common = 0 ?
G.GAME.common_mod = 0
could i do smth like
in the if j ~= card then thingy, theres another if where if j.key == card.key then SMODS.destroy_cards(j) with the if in there originally being an else if instead
<@&1133519078540185692>
No, it's j.config.center.key ~= self.key
Because then it would only destroy jokers of the same key.
but if it does then it doesnt copy
hello people! i have been preping myself to make a balatro mod but before i start strugling coding with my own ideas i just wanted to make a test to learn what the very basics are. for this i mostly copied a tutorial, yet the joker doesn't load in... any clue what i did wrong? (this is my first time ever truely coding so it may be something stupid)
so like
if j ~= card then
if j.config.center.key ~= self.key then
SMODS.destroy_cards(j)
else if SMODS.pseudorandom_probability(card, 'group_0_e2e11086', 1, card.ability.extra.odds, 'j_fox_singing') then
table.insert(card.ability.extra.currentJoker, j.config.center.key)
SMODS.destroy_cards(j)
if j.config.center.key ~= self.key and SMODS.pseudorandom_probability(card, 'group_0_e2e11086', 1, card.ability.extra.odds, 'j_fox_singing') then
table.insert(card.ability.extra.currentJoker, j.config.center.key)
SMODS.destroy_cards(j)
end
Nvm, got it working
new issue... this apparently crashes the game?
Yes, it's key
oh, missed that. thx for spotting it!
next question. is there a context state for rerolling the shop?
if context.reroll_shop then
THX!
how do i check the suit of a flush?
context.scoring_hand[1]:is_suit('Suit')
thank you
okay so i have a joker that works simlar to bootstrap and chips but with Xmult
but when you dont have the required money amount it gives x0 mult instead of x1
any idea how to fix this?
<@&1133519078540185692>
👍
Xmult = card.ability.extra.Xmult * math.max(1, math.floor(((G.GAME.dollars or 0) + (G.GAME.dollar_buffer or 0)) / card.ability.extra.dollars))
when card.ability.extra.Xmult is 1 and the player has zero monies, 1 * 1 = 1
math.max(1, ...) constricts the following value to be at least 1
So I’m trying to make a joker create a copy of itself, but the current version exponentially increases (1 -> 2 -> 4 -> etc) and I’m trying to limit it to create only one copy regardless of how many of the jokers you have.
I know in Java, you’d probably use a static variable or something, but how would one go about doing that in lua?
G.GAME.modprefix_jokername_copy_made_this_round = true?
And then would I set it to false at the beginning of the next round or something?
i have a joker that removes a card, however at the end of the round i get this
and when i draw that card i deleted it just leaves a hole in my hand
like that
you aren’t deleting them in an event
this is what it looks like right now
should probably use SMODS.destroy_cards instead?
Use context.destroy_card
that context also works if the timing is right for you ^
where would you put that
im basicaly making a trading card but for hands instead of discards
if context.destroy_card and context.cardarea == G.play and #context.full_hand == 1 then
return {
remove = true,
dollars = card.ability.extra.dollars,
func = function()
G.E_MANAGER:add_event(Event({
func = function()
play_sound('YA_Slip')
return true
end
}))
end
}
end
^ that hopefully works
If not, use SMODS.destroy_cards instead of the start_dissolve. For the documentation see https://github.com/Steamodded/smods/wiki/Utility#smodsdestroy_cardscards and https://github.com/Steamodded/smods/blob/main/src/utils.lua#L2550
this deletes all cards on screen lol
the last ban appeal standing
i have a feeling that wont work
ok that works thank you mr seals
Oh
Hello! having a bit of trouble with a poker hand im doing. I'm trying to make a hand type out of an ace and two 5s (A55) but selecting the last card required for the hand crashes the game. I believe the crash comes from the evaluate function but I barely know how to do much stuff in this engine
It's card:get_id() not card.get_id()
this one?
Yes.
Sweet! thank you, I'll try that out
is this a syntax error or is card.get_id() a genuine thing used for other things?
No, it just would not work.
The function needs to know what card you're trying to get the id of.
Oh that makes sense
Good news! The game doesn't crash!
Bad news... When selecting an Ace and two 5s it counts it as a Pair
how do you check your current amount of jokers against the max amount of jokers?
this is what I currently have, but I'm sure this isn't going to work lol
ok yeah, it's not working
It's #G.jokers.cards
thank ya kindly
ok, it kinda works?
when I have four of this joker at 4/5, each individual one does the effect when I was hoping only one would
but the good news is, when it's 8/5 none of them do, so the check is going through correctly
is there a way to limit how many events can happen or something?
actually, I may have a way to fix it
fixed it
woohoo
they are plentiful
indeed
I've run into an issue where only the first of my jokers will proc, and all copies have the exact same stats (when they should have slightly different stats)
code
Hello everyone, total newbie here. For my mod, I'd like to add a deck that modifies the appearance of the cards (e.g. the "abandoned deck"). Any tips on how to do this?
like changing the starting deck? or do you mean like the collab face card skins
you're going to be using SMODS.Back. If you want to see some examples, check out VanillaRemade
the abandoned deck gives cards a yellowish color and a damaged look, i want to do something similar
oh is it only the back? oof my bad
i mean you could create a #1300851004186820690 texture pack that changes the base card texture
do yall think this is balanced
maybe
that's a direct upgrade, as long as you have no card modifiers
but it shuts down a bunch of jokers functionalities
also personally, I'd capitalize Debuff since it's the first word in the sentence, and also it's important
ah, good point
I forgor
nice resource, i'll try to use it
is there a context for when a probability triggers?
bump
pseudorandom_result https://github.com/Steamodded/smods/releases/tag/1.0.0-beta-0711a
thanka you
hello everyone sorry to bother you but i need help with the "delay()" thing , i want to flip a card after delaying it but it flip before and do the delay afterward , any advice ?
No, use events.
im trying to make a blueprint-esque joker that copies the effect of a random joker. idk how to use lua so i got smth like this. would this work?
im guessing "local" refers to it effecting this specific lua file only and non local being a global variable that affects everyone
No, you would return it.
idk what that means im dumb
return ret
oh hm
the goal i have rn is to have smth like:
when blind selected, copy a random joker
and have that number change constantly
bump since a bit of time's passed :p
i was thinking of having a variable that changes depending on the joker element
unsure how id code that in though LOL
Yes, it's card not self
ah
i thought it was a problem with the juice_up since that's what was in the error 😭
im pretty sure thats because the card in the return is also juiced up
ok did some fooling around on jokerforge and i made something that semi works?
there's a variable called random which changes per round
it is able to target a random joker's index value
any exemple of how i have to use them ?
ideally for copying a random joker you would save a specific sort id
so you dont just. move the joker
rn it looks like smth like this
oh true
G.jokers.cards[random] isn't returning with anything
so as a result it copies nothing (im guessing it returns with nil)
ah lol
hold on let me try and make smth with the sort id thing
okei
in the meantime im gonna look over the code
ok it looks like i migbht have to set target joker to mathrandom or something
smth like this?
i changed the variable name to amogus to make it easier for me to point out
im slowly understanding how the general code of jokers is laid out
calculate = function(self, card, context)
if (context.selling_card and context.card.sort_id == card.ability.extra.target or context.setting_blind) and not context.blueprint then
local compatible = {}
for _, c in ipairs(G.jokers.cards) do
if c.config.center.blueprint_compat then
compatible[#compatible+1] = c
end
end
local new_target = pseudorandom_element(compatible, "seed")
if new_target then card.ability.extra.target = c.sort_id end
end
for _, c in ipairs(G.jokers.cards) do
if c.sort_id == card.ability.extra.target then
return SMODS.blueprint_effect(c, context)
end
end
end
```this should work i think
ooh, ill give that a shot
actually wait i can make that shorter hold on
guys i'm tryna dig from ortalab's code how they implemented a new shop slot reserved for their mythos cards to make my own custom shop slot but i didn't find anything, any of you know how to do that
i'm minding the operator wtf is ||
concatenation
isnt concatention .. in lua...
yea it should be .. :3
where is it ||
okay what about my question
concatenation (purple) on a logarithmic graph against chips*mult (green) (chips = 50 and mult = x)
So are you just concatenating the chips and mult together or what?
ye
How do you check if two cards have the same suit?
its not a joker
its literally the calculating function
Still would be busted
1 Hanging Chad if it is a card enhancement
its a scoring calculation
it replaces the X between chips and mult
I know I can just do something like card.is_suit(other_card.suit) but wild cards and smeared exist
hello it's me again back with a another problem to solve:
why does it show "ERROR" in the booster pack message?
also a couple more on a double logarithmic graph
Also how do you make it so a joker can debuff cards?
:set_debuff(true)
and before the : you set the card youre debuffing
ah thx
e.g context.other_card:set_debuff(true)
Anyone know the best way to do this?
do you know how to access the suits?
card1:is_suit(card2.base.suit) or card2:is_suit(card1.base.suit)
Oh thx
I had second_card:is_suit(scored_card.suit)
no answer :(
scored_card.base.suit
.base basically access a bunch of info about the playing cards like the suit or rank
add a localization file with
misc = {
dictionary = {
modprefix_booster_type= "Text",
},
},
the "booster_type" is the group_key of the booster (i think)
that's what i do
do you know any method to make it apper without using a localization file?
no sorry
goddam, i should make that joker forge creates a localization folder with the "default" localization file then
Hello, I'm having a problem my code
It's supposed to destroy the heart cards I discard, so that's fine, but as soon as it encounters a heart card, it destroys all the cards that follow, even if they're not hearts, and I don't understand where that comes from.
if context.discard and context.other_card:is_suit("Hearts") then
card.ability.extra.xmult = card.ability.extra.xmult + 0.5
return { message = "Upgrade!", remove = true }
end
localize("k_upgrade_ex")
true
ohh ok ty
dont forget to change "Upgrade!" to this
oke i got this error