#💻・modding-dev
1 messages · Page 136 of 1
As long as it’s a table, yeah
If you want to add the deck and discard to contexts, just hook them into calculate context
Have tested this card, and it works really well with Crescent
Getting a High Priestess gives four free sells :D
I like it ^^
Deffo more fun than Campfire imo
I don't think that will work because then it will compute existing contexts in those areas
So effects that shouldn't trigger will trigger because they don't test what area the card is in
does sound in edition support keys?
If you just want your new context for your new area you can just replicate the code instead
context api....
i think if you're calling it statically like that you dont use the colon
oh oops, thanks!
ur basically giving it the class of SMODS.Booster as self
which i assume has a great many reasons why it doesn't work
In my mind it would need a CardArea, a list of object types, a number, and
I think the final one was the context?
we have context api at home
yes, it was a symbol to identify which of the existing loops it's attached to
the number gives the order
Anybody available to help me with some coding I'm way out of my league for?
what's the issue?
I'll try and help, also learning but getting a hang
hmm, if it's wildly out of the realm of vanilla then maybe
I'm trying to get a gameboy emulator running inside Balatro
bruh
I saw someone post that a vid of them running an entire episode of family guy in a pop up in balatro not long ago
That was me lmao
I most certainly am out of my league
This is the released version of that
made a wobbly shader and mista four hand
some ran mario? Donkey Kong?
Yeah someone had Super Balatrio Bros
But I don't want it running on the card
I want to attempt to put it on the UIBox but I don't know if that part is possible
interesting
if you play it you instantly die
no that's killer death card does
no that's a special hand
damnit
you have to play with mista four cards or any 4 cards with rank 4 and mista edition
(you can mix it too)
hello! does anybody know how to do this? my coding knowledge is very limited as of yet, so any help is appreciated!
use extra
how do i get the boss blind? (so i can increase the boss blind)
G.GAME.blind
Hey, maybe an already answered question but does SMODS currently support adding a seal or enhancement that always scores (like stone card)? The code for it in github appears to be commented out but the patch still exists so I wasn't sure if it works
How do I replace the music when a Joker is owned? I'm looking at the code for Jimball but I'm not seeing what I need
always_scores = true
SMODS.Consumable{
key = 'towel',
set = 'Tarot',
atlas = 'towel',
pos = {x = 0, y = 0},
loc_txt = {
name = 'The Towel',
text = {
'Dries {C:attention}#1#{} cards,',
'makes them {C.attention}DRY{}.'
}
},
config = {
extra = {
cards = 3
}
},
loc_vars = function(self,info_queue, card)
info_queue[#info_queue+1] = G.P_CENTERS.m_440_dry
return {vars = {card.ability.extra.cards}}
end,
(whenever i hover over the fool after using this tarot card the game crashes from the return vars in loc.vars = function for whatever reason just wondering if there was a way to fix this?)
c.
😭
i should really check code hold up
yeah it still crashes
c is not the problem
Ability to animate shaders on the fly
insane???
how do i get the boss blind
is there a place that i can loop throught to get the current boss blind
i think the seal should render behind card face
What do you mean on the fly?
I know how to increase it during the Blind
I decided I didn’t want to mess with changing it before
To reroll you can just call the function that rerolls
i think i would just need the blind objectt for the boss blind
but i dont know how to get that
But you need to set a random table value to make it not cost money
Not really I think
Because the UI wouldn’t update either
I think someone else has changed the Blind value but I forget who
you use a consumable and the consumable does this
i think thats what number_format is for?
Yes I’m telling you how to do it
I don’t think so
why would it cost money?
i just want to increase the blind by 1.1X 😭 why is this so hard
Anyone know how to change the background music using a Joker?
to the person that was asking for boss blind i found this
idk if it helps but
its there
Maybe see if L Corp or Cryptid’s
do it
jimball?
I'll check L Corp
I checked Jimball and couldn't figure out how to do it from that
Also I recall there being an example mod that modded sounds
No idea what it did with them
bet
They were removed from Steamodded and into their own repo for some reason
yeah I have them
I have no clue how to apply this to a Joker
Under what conditions should the music play
I want it to replace the background music as soon as you have the Joker
filesize iirc? cloning the entire thing would take way longer if they were in the base repo
I have multiple files that I want to play one after another
If that's not possible, I can edit them into one song
check cryptid's jimball
read chat
i'm blind...
That explains the glasses
Anyways
I don’t know how music works
But my instinct is to try add_to_deck
I'm honestly sure Jimball has the code I need but I have no clue how to do it, I'm new to this
the check is on the smods sound object
SMODS.Sound({
key = "music_jimball",
path = "music_jimball.ogg",
sync = false,
pitch = 1,
select_music_track = function()
return next(find_joker("cry-Jimball")) and Cryptid_config.Cryptid.jimball_music and 1.57e308
end,
})
that's how cryptid does it
the and 1.57e308 is for priority purposes probably
Cool card
Also another Temporary implementation
I’m gonna update mine to new calc
having a bit of trouble with this how do i get it so that the joker converts to the enhancement ive added tried a bunch of different variations and nothing has seemed to work
ive tried without centers
ive tried with set_ability
What does the Cryptid_config.Cryptid.jimball_music part do?
["Cryptid"] = { ["jimball_music"] = true, ["code_music"] = true, ["exotic_music"] = true, ["big_music"] = true }
Is what it says in config.lua
@nocturne garnet do your temporary cards work in new calc already
huh
whar
Try to poll enhancement
that's so you can turn it off in the mod's settings
its not like i made a sticker for them or anything
I originally didn’t have a Sticker but I’m converting to it
Do I change something there for my mod or do I just ignore that/take it out
3 more runes! 3 more runes!
you could just take it out
I think I’m mostly curious about the timing to remove them to avoid nil cards. Also, if you have an animation
nono i didnt do anything special
its just cards that are destroyed at end of round
i didnt want my joker to say "that is destoyed at end of round" because i didnt want the joker to have like 6 lines of text
Myself, I added it because tying the effect to the Joker made it not work when the game was reloaded
Also I think it’s a neat mechanic
Do you have a graphic?
I repurposed the debuff sticker for mine
As a placeholder
What is missing from this to trigger the sound
been looking through several examples people have given of how they destroy cards. the whole destroyed cards appearing in hand as empty is still where i'm at if it's what i had from before, i feel like i'm missing something extraordinarily obvious at this point for as many times as i've seen this implemented
shiit
atp
i might aswell just make it a sticker
I’m probably gonna make it later after I’m done with chores
It depends on the timing
I'm not too sure how to change the z-order of rendering within the Seal:draw api
oh those are seals?
Did you use the draw method?
I’ve never seen anyone use it except maybe keku so I don’t know how it works, but I believe the only way to change the z-order is to change the order of love.draw calls
yeah I did
What does it look like
card.scale = card.scale or 1
card.speed = card.speed or 1
local timer = G.TIMERS.REAL * card.speed
local scale_mod = (card.scale * 0.1) +
0.2 *
(0.07 + 0.02 * math.sin(1.8 * timer) + 0.00 * math.sin((timer - math.floor(timer)) * math.pi * 14) * (1 - (timer - math.floor(timer))) ^ 3)
local rotate_mod = 0.05 * timer
if card.seal and card.seal == 'btp_mechanical_seal' then
G.shared_seals[card.seal].role.draw_major = card
G.shared_seals[card.seal]:draw_shader('dissolve', nil, nil, nil, card.children.center)
card.children.center:draw_shader('hologram', nil, card.ARGS.send_to_shader, nil, card.children.center, 0, 0)
G.shared_seals[card.seal]:draw_shader('hologram', nil, card.ARGS.send_to_shader, nil, card.children.center,
0 * scale_mod, 80 * rotate_mod)
G.shared_seals[card.seal]:draw_shader('played', nil, card.ARGS.send_to_shader, nil, card.children.center,
1 * scale_mod, 10 * rotate_mod)
G.shared_seals[card.seal]:draw_shader('hologram', nil, card.ARGS.send_to_shader, nil, card.children.center,
1 * scale_mod, 40 * rotate_mod)
G.shared_seals[card.seal]:draw_shader('played', nil, card.ARGS.send_to_shader, nil, card.children.center,
2 * scale_mod, 10 * rotate_mod)
G.shared_seals[card.seal]:draw_shader('hologram', nil, card.ARGS.send_to_shader, nil, card.children.center,
2 * scale_mod, 20 * rotate_mod)
G.shared_seals[card.seal]:draw_shader('voucher', nil, card.ARGS.send_to_shader, nil, card.children.center,
2 * scale_mod, 10 * rotate_mod)
G.shared_seals[card.seal]:draw_shader('hologram', nil, card.ARGS.send_to_shader, nil, card.children.center,
3 * scale_mod, 10 * rotate_mod)
end
end,```
rotate_mod is an endless spinner based on the global timer value
then the shaders are modified by the card.scale and card.speed values I've set
...
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0,
func = function()
destroyed_card.speed = base_card_speed
destroyed_card.scale = base_card_scale
ease_value(played_card, 'speed', inc_speed, nil, nil, nil, ease_speed, 'quad')
ease_value(played_card, 'scale', inc_scale, nil, nil, nil, ease_speed, 'quad')
play_sound('whoosh1', 0.94, 0.3)
ease_value(destroyed_card, 'speed', inc_speed, nil, nil, nil, ease_speed, 'quad')
ease_value(destroyed_card, 'scale', inc_scale, nil, nil, nil, ease_speed, 'quad')
return true
end
}))
...
I've done it both ways
Here is the original way patching the draw method
but both work
I do with a patch too but that’s not love.draw
Ah I see what you mean now
what are the default rarity weights for vanilla
Should be .70 .25 and .05
damn its really 5% for rare cards?
okay, if i create a new rarity will there be issues with the weighting going over 1?
(adding to joker pool)
extra?
calculate = function (self,card,context)
if G.GAME.blind.boss then
if context.end_of_round then
for i = 1, #G.jokers.cards do
G.jokers.cards[i]:set_edition({negative = true} ,true)
end
end
end
end
how would i make this not happen alot of times and not slow down the game
yes
Probably do it in the right context
See if the wiki helps
im not sure i know what you mean, sorry
extra dictionary in the Joker definition
You save if you found any Queens or not, then you can remember it later
Then at some point you clear it and forget
how does it work ive given this ago and it does not work
I don’t think that’s how poll enhancement is used but I can’t check right now
if it works anything like poll_seal then you don't need the G.P_CENTERS
It creates a negative of..... playing cards? I don't really get it
hmmm let me give it a whirl
But seems really interesting
just do what you have without G.P_CENTERS - you'll have to look at the arguments afterwards I don't know if theya re right
is "e_mldg_moldge" a custom edition of yours?
playing cards can be negative
custom enhancement, i have iterated through various permutations of the string but cant seem to get it to work
I'm not sure why you are using poll_enhancement then, isn't that for choosing a random enhancement in the pool?
ive tried without and was suggested to use the poll enhancement
basically all i want is to set played cards to my enhancement
through the joker
is set_enhancement even a function? Have you made your own because I can't find it in the source or the smods
don't confuse enhancements and editions they don't fall under the same parameters
another thing i was told to use by someone else before i was trying to use set ability
you've used "e_..." to reference your enhancement but the game uses "m_...'
if it is an edition you can use set edition
but I don't know how it would work for enhancements
poll_enhancement is for random enhancement
ah right I just found it
I think @frosty dock will know a bit more about this than me lol
if you're trying to set a card to one specific enhancement, you'd use v:set_ability(G.P_CENTERS['m_mldg_moldge']) if that's the key of your enhancement
ah perfect thank you
I mean you can poll from a table with a single option
that's not what poll_enhancement's key argument does though
it's a seed
worked perfectly thanks for the help
Hi, I just joined the Discord. I'm making a mod that is really just for myself and a group of friends, for fun. I've successfully modded all the cards and stuff that I want to do, but I'd like to make changes to the Balatro logo on the main menu as you load in. I have a couple questions if anyone happens to know from previous experience.
Is the Balatro logo a font that exists? Or if I were to add letters/change the wording would I have to approximate those new letters from scratch? I noticed a lot of mods have done it and even matched the gradient, 3D effect, and outer glow. I'm no artist, but I will give it a shot.
Do you know if the card that pops up on that screen goes to the center of the image? (ie, if I add 100 pixels to either side of the .png, would it still work?)
The card on the center of the screen is a card
If you set the size right it should still work
What do I do if my patch has the same target as steamodded's patch and it doesn't apply because of that? It did apply before and steamodded's patch isn't using at, so I have no idea what to do besides relocation
change priority?
Patch the Steamodded code?
I believe lovely can't do that yet?
I wonder if that'll break other patches oof, but I'll try
I thought it could with priority
is there a way to force a joker to trigger after scoring and every other joker? i want to set chips to 1 without letting other jokers override it
yes changed priority and the patch works
any ideas what to add here
what is the code for no edition
bruhs
brush
maybe even a card getting polished
spray lines
possibly make it larger, and tilted?
oh also, does anyone have a link to the context documentation?
ah i think i found- yep, that's the one, thanks!! :D
oh ya one more question
how do i check the name of a Joker?
(i want to check through the list of jokers, and find the ones which are both not editioned and not Dimere)
i still do not understand, im really sorry
Try using find_joker
Also check for key not name
thanks ^^
Getting this error when starting a blind with my Joker. Any ideas?
You're missing context.individual
I think what they are saying is that you need to make another variable in your loc_vars extra table. One that is a boolean check for at least a queen present in your hand during context.before. If it is, then you can continue into the context.individual stage and operate on each of the kings using the get_id check (it is 13 for kings).
On 203 or 209
209
It still crashed it.
AH, the loc_vars, okay, that makes more sense
thank you!
First if checks for context.individual, second if checks for other_card
does anyone know where the music speed is defined in the code? it seems slowed down from the original sound files
edit: my guess seems to be about 70%?
@tight thistle call it something like queen_check, then have a process during context.before to scan your hand for a queen and return true to queen_check
Alright, here's the code I'm testing, Will report.
put context.individual and context.other_card:get_id() == 14
That's incorrect, put the check of other_card inside an if context.individual
short circuit evaluation moment
So this? Or do they need to be in seperate checks?
And it worked
if card.edition == nil iirc
if context.other_card.config.center ~= G.P_CENTERS.c_base may be a good bet.
wouldnt it be ==?
not ~=
Lua is a dumb programming language that uses ~= as its != (Java).
In my experience, this has worked.
But YMMV.
but we are looking for if the joker has no edition
they're saying that base means no edition, though?
That's going after enhancements, not editions. nvm.
Editions are a whole new ball game.
how do you play said ball game? is it as fun as cage batting? :D
If the pitching machine keeps pelting you in the head, then sure.
i just realized i made wheel of misfortune 😭
3 in 4 chance to remove an edition from a joker
1/4 chance actually
I have an idea.
the four winds!!
guys im basically done
these three most specifically
sorry to keep bothering, but how do i do seeded probability, again?
i'd like to randomly select an index in the applicable jokers
You could use Pseudorandom_element() to select a random Joker
does that work with seeds, though?
It does from my experience
okay, i'll try that :D
pseudorandom_element(G.jokers.cards, pseudoseed('seed'))
schweet, thanks!
whats the context for scoring a card?
Whats the joker's effect?
mult when a 3 is scored
and ONLY 3s
actually, no wait
ok im checking again
if it contains a 3, give mult
not score a 3
ill look around for examples
Just pushed my first public release 
I concur
Did you create a thread?
Yess
im gonna remake my thread once I release my mod
changed this from every glass card in scored hand to every glass card discarded, which I think is a nicer change
(note: use {C:mult} and not {C:white,X:mult})
Yes that should be used for xmult
ah
(actually there are a few changes, lemme note those)
makes sense
Unless it's a stylistic choice
Thread made 
I did make it like that to make it stand out
but it is on its own row, so it's probably unnecessary
All discarded Glass cards break, gains double their ranks as Mult (Currently +0 Mult)
seems a bit weak for Rare?
oh yeah I haven't really messed w/ the rarites in a bit
it's a little unfortunate that I have to keep restarting the game whenever I change anything,
esp. when it's something as small as text descriptions
jonh DebugPkus saves me yet again
dont do the bonus please if you want true mahjong
also question, can consumable detect if you have specific vouchers and then apply effect depending on it?
probably
Hey there. So if I'm interested in creating Balatro mods, what's the go-to set up? There doesn't seem to be anything specific listed in the pins.
Thanks, appreciate it.
also, are vouchers only possible as tier 1 and tier 2 or can there be more?
Other mods have added higher teirs but I'm not sure if they need patches to work
trying to figure out how to fill the empty space
i dont remeber 🇵🇱 tarrot card
paint brush, card dripping with polish or something
is there more options to the ease in event manager
well, i need to learn how to apply consumables to cards
quick question: the watch center command's example for a joker doesn't use SMODS.Joker, does it work with that too?
wdym
its my first mod i am doing so i need to learn stuff
like how to use consumable to apply permanent +10 mult
as an edition/enhancement?
you don't call SMODS.joker (smods isn't made for that) but it can update the values created by SMODS.joker jokers
can anything go outside of the calculate function in SMODS.Joker? I think that the game stores certain parameters after a single complete call of 'calculate' but I want something to update globally without having to consult calculate at all
I get it
does anything need to be to_big()itized?
I tried putting it in loc_vars but of course that will only update when you hover over the joker
vouchers can depend on each other in whatever way you want
you can even have vouchers that require a bunch of different vouchers to be redeemed first
i got a voucher #1
"when Blind is selected"```
and voucher #2
```"Create a random {C:attention}Lv2{} {C:green}Potion Pack{}",
"when Blind is selected instead of {C:attention}Lv1{}"```
may change it to tag, depending how i can do it
can you be more specific about what you're trying to achieve?
so basicly, i think it will have function in Lv 1 voucher, and checks if voucher Lv 2 is redeemed, if yes, make Lv 2 pack, if not, make Lv 1 pack
@rough furnace @frosty dock Are either of you available to assist me in crafting a new Joker
I'm trying to emulate Gameboy in Balatro
so NES wasnt enough? 💀
Well... No
not rn, sorry. I'll lyk when I'm free
that works
@frosty dock when I use context.using_consumeable the G.GAME.last_tarot_planet doesn't update until the full call of 'calculate' is complete. EG if my backlog is empty then trying to access what the last consumeable that has just been used to trigger the branch returns nil instead. I know that there is context.consumeable which is that card but when I ask for the name/key of it can only give me the table signature rather than the ACTUAL name string of the consumeable - it is that name string that I want.
context.consumeable.config.center_key should give you the key
so looking at example
this is seal code?
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function()
for i = 1, card.ability.max_highlighted do
local highlighted = G.hand.highlighted[i]
if highlighted then
highlighted:set_seal('s_seel_blu')
else
break
end
end
return true
end
}))
end```
wouldn't have caught that at all, thanks!
how to spawn a consumable from the debugplus?
same as Jokers
i am first time useing it, i dont know how any of those
holding tab will show you the menu
3/3 textured 
what are these silly goobers?
loc_txt = {
name = "White Potion",
text = {
"Add {green}Green Seal{}",
"to {C:attention}1{} selected card"
}
},
unlocked = true,
discovered = true,
atlas = "PotionUP",
set = "Potions",
key = "whitepotion",
pos = {x = 2, y = 1},
cost = 2,
order = 7,
max_highlighted = 1,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function()
for i = 1, card.ability.max_highlighted do
local highlighted = G.hand.highlighted[i]
if highlighted then
highlighted:set_seal('s_potionup_potseal')
else
break
end
end
return true
end
}))
end
}```
this shit aint letting my consumable be used
what i done wrong?
add a can_use function
ofc theres no can_use in example...
Not wrong per se but I would probably remove the check if highlighted exists and actually loop the highlighted cards instead of max_highlighted
make it return true when #G.hand.highlighted is less than max_highlighted
i need only 1 highlighted, not multiple
I saw, but, generally speaking
i am just so confused
also you mean less or equal?
<=
return --insert here
end,```
Is there anybody that knows coding outside of Balatro that can help me with my project?
I'm trying to run a gameboy emulator inside Balatro
excuse me, where would the queen check go here? ive tried a lot of things but nothing is working
if #G.hand.highlighted <= max_highlighted then
return true
else
return false
end,```
this?
"you can simplyfy" man you sound like my math teacher 😭
Is there a way to have a keybind select a card?
there is a mod that does it for gamepad support
i clicked on a card after adding
return #G.hand.highlighted <= max_highlighted
end,```
and game crashed lmao
card.ability.max_highlighted
not max highlighted
@tight thistle you need to add a new boolean variable (call it queen_check or something like that do whatever you like) in vars and default it false. Then you need a context.before check and scan for queens and then if there are any change the boolean to true. Then run what you have with 'if queen_check then...'
i have a quick question. what does this crash mean and how do i fix it? is it a mod crashing or is it smth else?
return #G.hand.highlighted = card.ability.max_highlighted
end,```
i be going insane by the end of this
you showing us just the mod list, not the issue 😭
the crash is up top but i can zoom in on it
its below the mod list
Hey so I'm getting an error related to the json metadata. Does anything stick out about this?
gimme a sec
needs a version
remove dependencies if you have none
thats first-round-joker
oooga booga shit crash
return #G.hand.highlighted <= card.ability.max_highlighted
end,```
i am stupid lmao
not blind editions
Ah thanks. Seems like it's recognizing it. Any way to avoid the unlock requirement? And easily test it?
debugplus
install debugplus, hover over card in collection, hit 2 to discover, hit 3 while ingame (again while hovering over the joker) to spawn it
@karmic totem uninstall first round joker btw
thats whats crashing
That's a mod I assue?
Alright then
ya
kk I'll take a look then
@tight thistle I mean it's one way to do it. In the queen scan portion I think you need to have it during context.individual AND context.before and then loop through the cards in the played hand, have the loop break as well once it finds a queen
@weary jungle, i did everything you asked and it still dont work
can you send your code?
loc_txt = {
name = "White Potion",
text = {
"Add {green}Green Seal{}",
"to {C:attention}1{} selected card"
}
},
unlocked = true,
discovered = true,
atlas = "PotionUP",
set = "Potions",
key = "whitepotion",
pos = {x = 2, y = 1},
cost = 2,
order = 7,
max_highlighted = 1,
can_use = function(self, card)
return #G.hand.highlighted <= card.ability.max_highlighted
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function()
for i = 1, card.ability.max_highlighted do
local highlighted = G.hand.highlighted[i]
if highlighted then
highlighted:set_seal('s_potionup_potseal')
else
break
end
end
return true
end
}))
end
}```
it says it trying to compare number with nil
what line is the error on/
the one added
return #G.hand.highlighted <= card.ability.max_highlighted
card.ability.max_highlighted is nil becuase you dont have it set in your config (you dont have a config at all)
Is there any way to get intellisense?
people said config is just for fucking description
add ```
config = {
extra = {
max_highlighted = 5 --any number
}
},
that works but now when i move to page 3 of my decks this happens :/
people is wrong
loc_txt = {
name = "White Potion",
text = {
"Add {green}Green Seal{}",
"to {C:attention}1{} selected card"
}
},
unlocked = true,
discovered = true,
atlas = "PotionUP",
set = "Potions",
key = "whitepotion",
pos = {x = 2, y = 1},
cost = 2,
order = 7,
max_highlighted = 1,
config = {
extra = {
max_highlighted = 5 --any number
}},
can_use = function(self, card)
return #G.hand.highlighted <= card.ability.max_highlighted
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function()
for i = 1, card.ability.max_highlighted do
local highlighted = G.hand.highlighted[i]
if highlighted then
highlighted:set_seal('s_potionup_potseal')
else
break
end
end
return true
end
}))
end
}```
still broken
anyone able to help me here?
anybody here know how to fix this??
card.ability.extra.max_highlighted instead of card.ability.max_highlighted
you said earlier that card.ability.max_highlighted???
make sure to replace all instances of card.ability.max_highlighted
even in the use function
you might have forgotten to change the one in use consumable
What do you mean lua i dont even have Lua installed 😭
loc_txt = {
name = "White Potion",
text = {
"Add {green}Green Seal{}",
"to {C:attention}1{} selected card"
}
},
unlocked = true,
discovered = true,
atlas = "PotionUP",
set = "Potions",
key = "whitepotion",
pos = {x = 2, y = 1},
cost = 2,
order = 7,
max_highlighted = 1,
config = {
extra = {
max_highlighted = 1
}},
can_use = function(self, card)
return #G.hand.highlighted == card.ability.extra.max_highlighted
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function()
for i = 1, card.ability.extra.max_highlighted do
local highlighted = G.hand.highlighted[i]
if highlighted then
highlighted:set_seal('s_potionup_potseal')
else
break
end
end
return true
end
}))
end
}```
lua is the laungague used to make this
you have it, you just dont know it
but anyway, your problem is an atlas
i dont understand, im sorry
is it working now?
oh. well how do i either make the atlas work or delete it?
i keep trying but the result is always either the effect doesnt work at all, or it works regardless of queens
no... it crashes when clicking "use" to apply it
what is the crash?
atlas is used to make textures correct
I will give you a mock up code and try to explain
do you have an atlas?
i assume so
i am like takeing one hour to make one fucking make one consumable, i am going insane
do you have an image of the joker? or is there no art yet
how do i figure out what the atlas is trying to show?
are you making a mod?
atleast i think its that
no but i was told in modding chat that i ask questions here. i dont remember who said that tho.
this is more of a #⚙・modding-general then
modding dev is for when you are developing mods
its ok
why the fuck my game, crashes when seal is being made, idfk
what is the crash
@tight thistle
something like that
you may have to tweak your 'if' branch structures but that's the idea
Hey guys, I have a problem... after updating lovely to newest version for some reason my override of Card:calculate_joker(context) and subsequently all my jokers that modified it completely stopped working
for example I have a joker that converts joker to the left to xmult by capturing the return message from calculate_joker and turning some fields to xmult
according to debug console the message actually changed
@tight thistle
but the joker returned its old value anyways. This did not happen before and the conversion joker worked properly but now stopped
this is a bit more thorough
@tight thistle Do note that you can't just blindly copy paste what I wrote there its just a skeleton for the idea that I am suggesting, you will need to figure out how your bits and pieces fit together
did lovely change the way function overrides work in newest version or something completely different is at fault here?
i need to check something, whats the code for applying golden seal?
card:set_seal('Gold', true) should work
that contredicts whole shit
Alright this is kind of strange. The joker sort of looks as you'd expect when you bring the settings menu up. But in normal gameplay it gets dark.
Anyone know why?
Is there a way to select a card with the code
possibily? there is boss blind that forces a card to be selected every time
im aware but im trying to figure out how to do it, lol
G.hand:add_to_highlighted()
Ya can't find anything about the Joker appearing super dark in gameplay. The sprite atlas is a png like the base game.
the shaders of CRT may be the thing
try to turn it off
and see what happens
anyway, i am going insane by how the fuck the seal not working properly
much appreciated, sorry for the bother!
@tight thistle does it make some sense now after my picture?
Nah it didn't fix it. This test texture seems to be working fine. How strange.
i havent looked yet, had to get up, i will take a look now
goofy
Im unsure what is causing this crash
SMODS.Keybind{
key = 'FirstCard',
key_pressed = '1',
-- Initialize the toggle state
toggle_state = false,
action = function(self)
if G.hand then
-- Toggle the state
self.toggle_state = not self.toggle_state
-- Use the toggled state in your function
G.hand:add_to_highlighted(G.hand.cards[0], self.toggle_state)
end
end
}
i am giving up with the seal for today
okay, it now selects it, but it no longer deslects it, even if the card is discarded
well you have _add_to_highlighted
How do i play a hand, i see G.play but im sure thats most likely not all thats needed
Does formatting not work for the unlock condition?
It's always attention and not important 🙄
lmao
nope, sorry
what stack
How can I trigger scoring for a certain card?
As in: Is there a function that lets me do something like this?
some_card:score()
Hello, I am new to Balatro modding (and modding in general), I've been creating a few mods by looking at other ones and trying to understand how they do what they do. I want to create a mod that replaces the texture and name of specific things (Jokers, playing cards, tarots, etc.) without replacing the entire file. For example, I want to rename and retexture the Lucky Cat Joker to be Turbo Granny from DanDaDan, but I don't want to replace the entire en-us and Jokers files. Can anyone tell me how that's done or show me a mod that does it so I can learn? Thanks
Try Malverk
Check out Legendere for referece
Great, thanks! If I have any other questions I'll be sure to come back
question
if my prefix is " potionup "
my seal key is " potseal "
then the correct code to apply it to a card is " s_potionup_potseal "?
or i fucked up?
thats right
context.after? sounds about right looking at the context Ice Cream is used in
then why this shit fucking crashes when seal suppose to be applied
how are you applying the seal
(also i like to look at mods that add stuff when adding smth (like cryptid))
SMODS.Consumable{
loc_txt = {
name = "White Potion",
text = {
"Add {green}Green Seal{}",
"to {C:attention}1{} selected card"
}
},
unlocked = true,
discovered = true,
atlas = "PotionUP",
set = "Potions",
key = "whitepotion",
pos = {x = 2, y = 1},
cost = 2,
order = 7,
max_highlighted = 1,
config = {
extra = {
max_highlighted = 1
}},
can_use = function(self, card)
return #G.hand.highlighted == card.ability.extra.max_highlighted
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function()
for i = 1, card.ability.extra.max_highlighted do
local highlighted = G.hand.highlighted[i]
if highlighted then
highlighted:set_seal('s_potionup_potseal')
else
break
end
end
return true
end
}))
end
}
by consumable
"attempt to index a nil value"
i think wrong channel bud
me?
No I am a mod dev trust
maybe you are, but how this releated 😭
yeah
i am loseing myself trying to make seal work properly
Yall I wanted to make a mod named after a spectral card but that cryptid guy has, like, all of them already 😭😭😭
seals don't have a s_ prefix last I checked?
just pull a reverie and make your own spectral to name your mod after
name it after a cryptid spectral 😭
...it works now...
PLEASE SOMEONE FOR THE LORD OF CHRIST UPDATE THE EXAMPLE
wtf that example is so fucking old
and then i have to ask about everything how to do when example is outdated 😭
that's a solid 5+ months old example
the date of its creation is literally closer to the release of steamodded 0.9.8 than it is to today
💀💀💀
someone really needs to update it...
new devs like me have hard time learning 😭
and it doesnt help me that some devs are also oblivvious
like these 2 were wrong apparently
well, gn
It would be "potionup_potseal_seal"
Smods adds "_seal" automatically
Also, I feel you
I guess that was already discussed above though
hey this is probs a really basic question but if I wanna edit the texture of a single joker do i just edit the jokers.png file in resources/textures/2x (or 1x idk what the difference is)?
@tight thistle Then I'm afriad I'm going to have to be brutally honest and suggest you go away and get the hang of some programming fundamentals and seriously consider if this is what you want to spend your time on. Only then should you try and make some sense of Balatro's source code and the steamodded API.
the _seal should only be there when referring to seal badges and descriptions iirc - it's due to how the game handles seals differently in different places and I can't really make it consistent
Oh yeah thats true
k
on it boss
That was brutal alright...
Any ideas?
I want to score a certain card under some condition while the regular scoring happens
Do you mean like how lusty joker adds +3 to Heart cards?
Nope; more like red seal retriggers except it's not the same card gets scored again
they want to just be able to score a card even if its not a part of the poker hand
Someone was asking about it earlier
By the way, is there a way to score the hand again (including spending a Hand)?
Wtf, do I just use this whole thing???
I had code for it which I need to update
feels great
better calc is not better enough to be able to consistently use the same function across all scoring contexts
Im planning to make a consumable that brings back a random joker that you’ve sold or destroyed. Is this possible without some sorta patching? If so, how would I patch something in to let me do this
i could try to see if there's anything similar enough to be merged into a single function, but i think main joker/card scoring is just a bit too unique
I mean you either need to save the card keys or exact copies of the cards
Then select one of them
IIRC myst had a graveyard
@frosty dock I asked earlier, but now that I'm trying to do it, I'm a bit confused what's the best way to iterate over the deck and discard pile to calculate a new context
sorry if that sounded off-handed, it wan't meant to be. I'm not going to beat about the bush though, you need to sit down and really work out how variables and checks on those variables are processed before you can approach stuff like this yourself.
Every language has its quirks but the fundamental rules are pretty much the same across languages
nice!
I'm mostly trying to decide if it should be SMODS.trigger_effects or what
that doesn't seem to receive a full context table, so maybe eval_card?
something along the lines of
local context = {something}
context.cardarea = G.deck
for i=1, #G.deck.cards do
local effects = {eval_card(G.deck.cards[i], context)}
SMODS.calculate_quantum_enhancements(G.deck.cards[i], effects, context)
SMODS.trigger_effects(effects, G.deck.cards[i])
end
context.cardarea = G.discard
for i=1, #G.discard.cards do
local effects = {eval_card(G.discard.cards[i], context)}
SMODS.calculate_quantum_enhancements(G.discard.cards[i], effects, context)
SMODS.trigger_effects(effects, G.discard.cards[i])
end
Does this work for non-Enhancements?
wdym non-enhancements? calculate_quantum_enhancements just evaluates additional effects from additional enhancements if they exist
this is basically what calculate_context does minus the return_table part
I want a Sticker to apply its effects right now
not sure if this is something that should be added into steamodded for all viable contexts, seems like a lot of overhead
works, that will happen inside of eval_card
"this" what?
calculation on deck and discard
Ah, while I do think having it by default might be too much, I think it would be a nice option mods could be able to activate
without needing to reimplement it
because each mod iterating on their own is even more overhead
besides the fact I'm sure some mods won't do it properly and cause side effects 🤔
(with other mods)
So if a mod could request that some context be applied to some area would be useful
If this is in terms of patching, where could i save the keys at? I barely know how to do patching really but im gonna atleast try if its needed for this idea
You can create a global dictionary for your mod per run and save there
The Castle example does something similar
okay what if I check any loaded files for containing context.cardarea == G.discard or context.cardarea == G.deck and use that to activate the contexts 🤔
when the context.cardarea ~= G.play
This might be the most complicated thing I tried
I'm trying to have a Joker retrigger the Joker to the left for X repetitions, and while it's working for non-scoring contexts, xmult, mult and chips dont apply at all
Suggestions?
if #G.jokers.cards > 1 then
local self_index
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then self_index = i end
end
if G.jokers.cards[self_index - 1] then
for i = 1, card.ability.repeats do
local effects = eval_card(G.jokers.cards[self_index - 1], context)
if effects.jokers then
card_eval_status_text(G.jokers.cards[self_index - 1], 'extra', nil, nil, nil, {message = localize('cs_fall_again'), colour = G.C.YELLOW})
end
end
end
end
end```
you should be using context.retrigger_joker_check for your retriggers (assuming better calc)
you assumed correctly, lemme try
it's literally easier to just have a mod ask SMODS to do it than to write a parser that doesn't even cover all cases 😭
fair enough
I'm working on a mod, and just about to get onto making the jokers. I've currently got old calc (I think before better calc even released?)
should I upgrade immediately or hold off?
I think you should upgrade
I upgraded and for the most part I didn't have do change anything
I think I had one or two broken patches
Upgrade, bttercalc is better and mods will probably start using it from now on
bettercalc doesnt even change that much if you arent doing certain things
(mostly enhancements, and jokers need to return mult instead of mult_mod)
oh yeah
also I have a question
that makes sense
what's the proper way to destroy a card or multiple and send it as context
like, playing cards? I was wondering the same thing
I was thinking everything
But mainly playing cards
i think pcards and other cards have different destruction contexts
Currently trying this out which doesn't quite work with Canio
local vic_destroy_card = function(card)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.2,
func = function()
if card and not card.removed then
if card.ability.name == 'Glass Card' then
card:shatter()
else
card:start_dissolve(nil, i == #G.hand.highlighted)
end
end
if card.playing_card and G.jokers then
for j = 1, #G.jokers.cards do
eval_card(G.jokers.cards[j], {
cardarea = G.jokers,
remove_playing_cards = true,
removed = {card}
})
end
end
return true
end
}))
end
To be fair, I don't think there are destruction contexts for non-playing cards
I'm working on a Porcelain Card enhancement and Canio is also the issue
are there any tips for figuring out why an atlas isn't being loaded?
alright seals mod is updated
seals mod
daily reminder, for everyone who wants their mod on the Balatro Mod Manager:
https://github.com/skyline69/balatro-mod-index
@wintry solar thoughts on this?
also this
I see a lot of loc_vars being done incorrectly and not working with tooltips as a result
Out of curiosity, any ideas for how to handle card destruction besides asking thunk to fix it in vanilla
I’d considered having deck cards in calc context, but thought it would add too many unnecessary calculations, a toggle could be worthwhile though
thinking we could have something like a mod.optional_features function that can enable access to things like this that are too expensive to have always on
Actually I do have a suggestion
See if a Joker still exists before calculating it or displaying a message on it
I'm getting popups on thin air when I destroy Canio alongside cards
I'm trying to make an enhancement that breaks similarly to Glass Cards, but for some reason when the card is destroyed it "goes back" into the deck. the deck card count becomes "52/51" and sometimes the "ghost card" is drawn and sits in hand
What am I doing wrong?
There's some timing issues regarding when the card is destroyed
If the timing for destruction is the same as Glass, there's a variable you can set so that it is automatically destroyed
I couldn't find the glass card code inside card.lua
what variable? I don't think it's the same timing, though. Because my enhancement doesn't break along with the glass cards
It's a part of the scoring step
not a property of the card
Not sure on this one, what scenarios don’t currently have a card anyway? Is it just info queue stuff?
yeah
Oh the fake card would be the card it would normally be right?
it's not a lot of effort to handle correctly, maybe we just need it to be documented better
Or would it be a one size fits all dummy card to stop the card indexing crash?
I think that’s probably a good idea then
Did you ever find out? I have the same issue
have their been changes in the way that SMOD handles custom enhancements, following the wiki i added the calculate function for x_mult as listed but my effect is always nil
Yes the wiki is outdated, enhancements follow all other calculation principles now
Can you ss your destruction code?
thanks
This is inside the calculate
On an enhancement?
oooh, makes sense now
so theres a whole context for card destruction inside enhancements
Thanks a lot!
In fact, these contexts need the area adding
I shall have to remember that for another time
is there a way to disable the shop's reroll button
So, in this case, G.play?
is the G.P_CENTER_POOLS.Planet.config.softlock variable what the game uses to check if the secret planets are now discoverable? if not I assume there's a boolean somewhere that flips once they are
Eh I’ll just do it now on mobile
If you update, it’ll be context.cardarea == G.play yeah
using context.cardarea == G.play my shit went off like 5 times each
is it triggering because there is more than one card with the enhancement played in the hand
adding context.individual it ended up not adding any mult at all
would anyone know what the context is so that the enhanced card only triggers the once during scoring?
Add context.main_scoring to the area check
ah thanks
are there any examples of custom consumables?
is there a reason for repetition checks with calculate_repetitions being different between G.hand and G.play calc? play calls it once with a nil ref as card_effects, while hand calls it inside the loop with existing card_effects based on effects.calculated?
I think that was just how it was in vanilla
uh alright
Maybe due to not needing reps on cards that don’t have effects?
Every played card should have an effect so I guess they can be calced first?
this does have the slight downside of the first card played when converted doesnt apply the effect but all other ones after do wether they are converted in that hand or not
i think that maybe unavoidable though
oh infact the first card doesnt trigger the ability at all even if it was enhanced before or not
is there a function that is called when a joker is destroyed by any means (selling, other cards, etc.)
and if that card is played on its own then the ability doesnt trigger either
as in how would i listen for an event and call something on that
It didn't work 😢
still ghost cards in deck when card is destroyed
I'm on the latest steamodded
Get rid of the old bit
oh its setting the initial value of my cards to have nil instead of 1 when it converts to the enhancement
card's not destroyed without the old part
maybe something with card:remove?
who is this responding to
ah
icic
At line 248 here
Can you throw a print in the destroying context?
Ive got a few questions for a consumable im making. Its a spectral card thats supposed to create a negative copy of a random destroyed joker. I think ive got the things i need correct, however for one: I dont know how to make the card negative. Two: i dont know how to actually add destroyed jokers to the table i made. Id assume patches? but im not sure where to patch and last time i tried to make a patch it was absolutely terrible
It displays the message
I added print("message") just below the destroying_card context
oh and i also am not sure what color to put for the negative text so its just default text color instead of the cool negative text color
But it doesn’t destroy?
the joker's calculate function isn't being called when it's destroyed by something like the dagger
Nope, doesn't do anything
what do i have to do to run something in a card's code when it's about to be destroyed
I am baffled
So am I
anyone able to help me with this?
Can you send me the state events lovely dump?
How do I do that?
mods/lovely/dumps/functions
Try updating again now
is there a way to make a custom joker have the same visual size as the square joker basically making another square joker but with different ability and art
Yes
are there some properties i can change for the card like the width and height directly?
Yes
would you happen to know what those are or any general way i can find it
very helpful
It's something likethis but it feels very jank
You can check vanilla code and it's very similar
I believe smods supports it in object definition now
but I feel like this doesn't always work
ohhh
but probably not offsetting right?
Works perfectly now
Some pixelsize or something
wasn't able to figure this out yet
anyone have any idea?
I didn’t read the pr fully
Thank you once more
Was merged the other day though
the problem i'm trying to solve is setting/unsetting a flag while a joker is held
.
No thanks for spotting, was just a missing line in a function
You want add_to_deck and remove from deck
- Search the wiki for
set_edition; - Saving a card is complicated; saving a key should just be saving the string somewhere where it's actually saved
Keep in mind the Joker isn't yet in the deck when added and isn't yet out when removed
You could save the destroyed jokers' keys inside a table inside the spectral card's abilities . I don't know how you'd get the keys for the jokers that were destroyed before you got the spectral, though
And then you'd use something like create_card to create the jokers once you use the spectral and set_edition to make em negative
i cant seem to find a wiki thing for set_edition but i found an example without any explanations on it. idk what the last two arguments are but they're set to true in the example
Is there a way to add or remove a card from a pool when playing a specific deck?
im also not sure why its an object and not just a string for the edition
this is how it is in vanilla
It’s on the edition page in the wiki
Does smods doc include codes about side description?
??
Blame GitHub search I guess
not sure why or how, but i went with the way held cards do it, and now repetitions from jokers on played cards don't work anymore
That’s odd, got a screenshot I can look at?
nothing too interesting, it just doesn't retrigger. red seals and mime work fine
pushed what i have so far to a branch
Pls ss mobile toml browsing is hard
hold on lemme try something
okay so ive got this
the first one i mean
i think
but now im not sure how to save the keys of destroyed jokers
im assuming i gotta do some sorta patch
(Which i havent figured out really how to do well)
i already have my thing setting up a global table thingy to hold the keys
the saving to it is what i dont know how to do
i already have it creating a table for destroyed jokers
i just need to figure out how to save to it
not what i mean
i mean like
Detecting when a joker is destroyed and then saving its key
ah
ive used lua before, and so im not having too many issues with that stuff like tables, but what i havent used before is whatever the patch stuff is
okay nvm
i am confusion
I stole that one guy's idea and started making music album Jokers
you should make it in/jokers fr fr
The first one works
unrelated(related) question: Is it possible to give chips or mult a decimal value?
wait dumb question, i've done it before
Nevermind
anyone know how this could be done? im assuming patches but id need some help with how to actually do that. Idk where you're supposed to put patch files or how they're formatted.
Yeah I don’t see why this wouldn’t work, I can take a look tomorrow if you have sorted it by then
my jokers feel oddly common whenever i playtest, like appearing way more than other jokers in their rarity bracket, does anyone know whats up with that?
(also, ive seen dupes appear without showman)
did you create the jokers with debugplus
I meant in-game
does it boost modded jokers or something?
by opening the collection and pressing 3
i did
It allows duplicates to appear
mhm
still doesnt answer the too common problem
You need to generate it either in the shop or through Judgement, etc. for it to not be duplicated
though that might just be me
confirmation bias
yeah
how might i access "shop_final_pass" (the place where tags are triggered) in a joker context?
alr i think ive changed my mind about this card idea, its to hard to make. Im just gonna make it like a better Fool.
maybe do something when card:remove is triggered?
check that it got removed from the jokers cardarea, then add it to your list
you don't need patches
hold on, I've got a similar joker implemented to your idea
oh wait destroyed? 🤔
its alright, im gonna change it
i also realised its sorta unuseful because its not super often that a joker gets destroyed
I mean should be doable if joker destruction triggers [JOKER]:calculate_joker({destroying_card = [CARD], full_hand = G.play.cards})
EDIT: it does not. You'd probably have to hook start_dissolve? And make sure it's not being sold
fair enough lol
gonna change it to be like a better fool card
can't seem to figure this one out
i looked at the code for the "cash out" button and it sets the state to G.STATE.SHOP
and i can see where it actually populates the jokers and stuff
figured it out, i just needed to keep context.other_card around
Does anyone have any ideas on how to add my language to the ui?
How do you pass the context of a Joker being destroying to other Jokers 🤔
I misread! Woop. I have a joker that works on sold jokers instead.
An actual implementation would be to hook :start_dissolve, check if the card is a Joker and make sure it's not being sold by checking G.CONTROLLER.locks.selling_card
That's at least less jank than how Betmma did it
(checking the colors passed to start_dissolve)
also I guess it doesn't require calling calculate each time
Unlike the vanilla implementation
what function should i use if i am only trying to change between 2 different textures if the config option is enabled?
Is there any way I can get the actual name here instead of the key? It works fine for vanilla jokers. G.GAME.current_round.zombie_target just holds a joker object
Anyone up to be guinea pigs for a complex simulation mod? I tried to make DV's sim mod work with any mods, but haven't tested it much
G.localization.descriptions.Joker[key].name
Cool, ty
this may be a bit complex but would anyone understand how to sort your hand to find the highest valued card (as in its rank, a King)
ig do what raised fist does but inverse
oh good call
still need help with this ^
smods at cardareas?
Oh it's the branch
still need to test the actual feature added here, being calculation for deck and discard areas
Earlier Eremel gave me code which worked for me
...this may be a stupid question, how do i get ready to make a mod? i have vscode and i have a folder for the mod but i'm not sure what exactly i need to do
unless if thats all and i can get to coding
mostly what i did was extract more things into util functions where you just have to pass the cardarea for it to work
do you have steamodded (and thus lovely)
then that should be it
oh cool lol, ty
Which file is localize function code stored?
localization/default.lua
which lua file has the consumables?
can anyone help? still ttrying to fix this
I can't find it.
de.lua is german.
default.lua is just the language the game defaults to if none is found
en-us.lua is the exact same
Would anyone happen to know where the code for the Tarot cards is stored?
card.lua
i feel like im doing this wrong.. also, my config doesn't update when i reload the game. both options are always ticked off
i just want it to use the top one by default and if i check the option in config, it uses the bottom one
top part does work but changing the option does nothing.
should use if-else instead
if config.hc_Neon then
Atlas HighContrastNeon
else
Atlas HighContrast
end
youre awesome thank you so mcuh
How does Talisman calculate final hand size? Could it be optimized to prevent crashes on stupid mods?
Like does it just use whatever built in math functions Lua has
Any incite on why my config options don't work? they show, but when i toggle on and go back, then look again and its toggled off.
Ah crap, sorry.
The Atlas is loaded when the game is booted
still can't get my joker to work how i want to
be so fr with me, is balatro modding a good place to start modding in general? like i know a little bit about coding, but i wanna know if im being too ambitious
Which means you have to load both atlas with different keys, and using if-else in smods.joker.
Make the joker itself decide which png it wanna load.
(Steamodded) I'm trying to make a Joker that multiplies every price in a shop by 0.7 when in deck, but it's not working. Mod prefix tiwmig and Joker key generic_brand. Here's the code (inside the Joker object) for its add_to_deck and remove_from_deck (based on Astronomer):
add_to_deck = function(self, card, from_debuff)
G.E_MANAGER:add_event(Event({func = function()
for k, v in pairs(G.I.CARD) do
if v.set_cost then v:set_cost() end
end
return true end }))
end,
remove_from_deck = function(self, card, from_debuff)
G.E_MANAGER:add_event(Event({func = function()
for k, v in pairs(G.I.CARD) do
if v.set_cost then v:set_cost() end
end
return true end }))
end
and then I also have a thing being injected into the set_cost function:
#Add discount for Generic Brand Joker
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if (self.ability.set == 'Planet' or (self.ability.set == 'Booster' and self.ability.name:find('Celestial'))) and #find_joker('Astronomer') > 0 then self.cost = 0 end"
position = "after"
payload = "if #SMODS.find_card('tiwmig_generic_brand') > 0 then self.cost = self.cost*(1-0.3) end"
match_indent = true
I'm not really sure what I'm doing wrong, input would be appreciated
I have a similar joker that also manipulates shop item price.
In the previous version of that joker,
I looked up the coupon tag.
How did you implement that Joker?
how to make variants of same card?
like the variant that changes no functionality but only design
I wrote:
if G.shop_jokers and G.shop_booster then
for k, v in pairs(G.shop_jokers.cards) do
v.cost = [Enter new cost]
end
for k, v in pairs(G.shop_booster.cards) do
v.cost = [Enter new cost]
end
end
I'll give that a try, thank you
Another question while I'm here, is there like a list of the properties that "G" has or whatever?
Look at the very start of game.lua
so it begins
how to make variants of same card?
like the variant that changes no functionality but only design
Ah, I see, thank you
Usually I'd just copy-paste.
Unless you just want to code one joker and have others sync up automatically.
no, i mean the real variant that changes card's design and points to same card structure
Heyo, I was able to learn how to adjust the texture per joker, but I'm still stumped on how to set the name per joker, without editing en-us as a whole. Can anyone elighten me? Thanks!
You said "design" as in, atlas/sprite?
yes
still thinking?
Just think of an idea
Let's say, write
return bamtris_calculate(self, card, context)
end```And define bamtris_calculate outside of SMODS.Joker but in the same file.
So it would like
end
SMODS.Joker{[Bamtris]}
SMODS.Joker{[looking]}
SMODS.Joker{[weirdo]}
...```
I keep getting this crash when winning a blind with a joker with this code
I'm trying to give $2 for the amount of cards left in deck at the end of a round
...uh, if you're doing it there, would it not be better to try and #G.playing_cards*2?
alright im trying to make a blueprint/brainstorm like joker, can i get a run down of what this stuff does so i know what im doing?
where did you find this code?
card.lua
i see
i was trying to find the code for midas mask earlier n couldn't find it in there
it was giving me no results but doing it again now it is
💔
i also want to look at strength bc it's important for what i'm doing too
ok i switched it, still crashes tho
i see what this is doing now, for blueprint
finds itself using the for loop, then finds the guy right after him
would there be anything id have to set up for this? like does other_joker need to be initialized or something?
Weird... is #G.playing_cards*2 becoming nil? What's the actual line in the lovely/dump/functions/state_events.lua that it errors out?
the line says add_round_eval_row({dollars = ret, bonus = true, name='joker'..i, pitch = pitch, card = G.jokers.cards[i]})


