#đ»ă»modding-dev
1 messages · Page 166 of 1
in that code snippet i replied to they probably meant to type context.other_card ~= card instead of ==
getting the game's current jokers is G.jokers right? or have i misremembered
is there a context to check if a joker already has repetitions?
G.jokers.cards
ahhh
i don't think so
damn, unfortunate
how often is in_pool on blinds called?
probably after beating the current blind + on blind reroll
i dont see why it would ever be called at any other times
just finished art and code for this joker, what do you guys think?
bump
to access the key of a joker can i just call G.jokers.cards[1].key for example? or is there something else i gotta do
what are you using it for?
i'm attempting to make it so my boss blind only shows up if you have a certain joker
pretty sure you can use SMODS.find_card() to check for a joker by key
lemme try
if next(SMODS.find_card([Joker key])) then
return true
else return false end
end,```
j_prefix_jokername
what's the best guide to figure out how G.game works? (And all the variables associated with it)
wait should this have gone in #âă»modding-general instead
open up game.lua and read it
I guess the whole game.lua is the best guide out there about G.GAME until further notice.
also, bump again
how would i mark my mod to depend on talisman along with steamodded?
Emphasize on this part:
hmm lemme try again, i tried before
might have just messed it up
yea i guess i just messed it up before, works great now
Bump
that is NOT uncommon đ
negative playing cards are overpowered
successfully reworked the Bunco joker system to better suit how I plan to develop my mods!
left: Bunco's Rarity system
right: my Rarity system
whats the key for the base edition, is it just e_base or something?
im trying to make a joker always the normal edition when spawned
is it possible to gave two copies of the game, one modded, one modded, both with different save files?
changed to rare
also i made the odds 1 in 0 to see what would happen and... lua does Not care about divide by zero errors
Yup! Its what I do
You need a copied Balatro folder in the steamapps folder (I call mine BalatroModded) and rename the exe to the same as the folder name
that way your saves are completely seperate and cant accidentally touch - it of course does mean steam doesn't automatically sync your game
ty, thats perfect
im still getting this issue..This is a joker btw, and the add to deck is within the joker's field; it happens regardless of where I place the add_to_deck
anyway, question of my own:
what's a good way to make a retrigger joker that's blueprint compat not retrigger itself (easy) or blueprints of itself (hard)?
How do I apply vanilla enhancement cards with new sprites?
You mean change the sprites of vanilla enhancements?
how can i make a consumable card negative?
check key of other_card (or blueprint/retrigger)
card:set_edition('e_negative') iirc
Yes. And I want it to be configurable.
What do you mean by configurable
Players have option to switch it back in mod config page.
thx it works
idk why they dont do it like jokers (JOKER.set_edition({negative = true}, true))
because it's the thunk's way and it's awful
Just use Malverk
That way works itâs just ugly and not mod compatible
Exactly what I was looking for. Thanks
what's the best way to save/load a card not in a CardArea (such as in a G.GAME variable)
I want my joker to create a single random joker at the end of round. So, naturally I copied Riff-Raff's code to use as a base.
But for some reason, it creates as many jokers as there are free slots and I can't figure out how to limit it to only one Joker. Could someone help me please?
you might want to use SMODS.add_card instead (it includes card:add_to_deck)
and the issue is the context check, by itself end_of_round triggers per each hard held in hand
try if context.end_of_round and not context.game_over and context.cardarea ~= G.hand then
That did the trick. Thank you.
but I do want to retrigger foil blueprints; just not when they're copying my retrigger joker
only checking other_card.<etc>.key (or whatev the path is) would stop retriggering foil blueprint completely
if scoring hand contains a face card, adds the product of the lowest card in hand from each suit not included in the scoring hand to mult
Does this make sense or should I reword it?
The idea is, based on this hand, the joker would give +28 mult. 2x2x7, the 6 is ignored because it's the same suit as the played king
It somewhat makes sense after reading it 3 times with the pic
If I use take_ownership, am I not able to assign "config" to an existing joker? My code looks like this
"j_greedy_joker",
{
loc_txt = {
name = "new joker",
text = {
"Gain 100 chips on the first hand",
"of a round but lose 50 for subsequent",
"hands"
}
},
atlas = "Jokers",
pos = {x = 0, y = 0},
config = {extra = {chips = 100}},
cost = 2,
calculate = function(self, card, context)
if context.joker_main then
return {
chip_mod = card.ability.extra.chips,
message = localize {type = "variable", key = "a_chips", vars = {card.ability.extra.chips}}
}
end
end
}
)
(I know it doesn't do what the text says right now)
that code crashes the game, but it runs if I hard encode the 100 value in the calculate function
oh sorry, that is from me editing the code on discord
I have it commented out in my current code
let me just triple check it still crashes with comma
yep
"functions/misc_functions.lua:1827: attempt to index local 'args' (a nil value)"
spawned a new copy?
what do you mean?
It crashes when I check the collection, but I imagine it would also crash encountering the joker in a game (I can check that quickly)
you cant use an existing save
the collection is because you havent given it loc vars
okay, it also crashes if encountered in the shop
I will add loc vars in, something like this right? loc_vars = function(self, info_queue, card) return { vars = { card.ability.extra.chips, card.ability.extra.chip_gain } }
(plus the "end")
same crash
send the crash
I know I'm in a very strange corner case (modding existing jokers so that I can use a set seed and have them show up where I want)
understood it right away but probably because of the pic helping too tho
If scoring hand has a face card, add the product of the lowest ranks of each suit in hand to Mult
this is my attempt but it's more or less just shuffling words around
nah hold on... your description doesn't specify the exclude played cards' suits part
Taking yours and adding back the "not in scored hand" gives me this
could maybe say "unscored suit"? So something like "... add the product of the lower ranks of each unscored suit held in hand to mult"
hmm
that sounds more consistent with Balatro phrasing
When I use take_ownership, do I have to re-define everything or just the variables I want to change?
just the ones you want to change
game seems to now just crash if i just click at the start up animation
im not sure if its a mod because ive not added any mods recently
for instance, this alone is perfeclty valid SMODS.Joker:take_ownership("j_lusty_joker", {})
though there's not usually likely to be a point in only taking ownership and changing nothing*
* except for weird seeded run stuff
okay, i just have to wait or it will crash
pov: smallest lobotomycorp asset
whats the quick way to check if a card has any enhancement? seals have card.seal, editions have card.edition but there isnt one for enhancements it seems
the card's enhancements is its center
So if I want to check if a card has any enhancement would this work?
card.config.center ~= G.P_CENTERS.c_base
it doesn't
you should just check the key instead
You can do card.config.center.set ~= âEnhancedâ
Works, ty
how does one get the current score in the round ? (not the blind score, even though I would like to know how to get that aswell) but what the amount the player actually scored so far in the round
ugh moveables are so ass
i've been trying to offset a Sprite children with a Card major to no avail
just having role.draw_major seems to always force the Sprite's position regardless of whether its role is Major or Minor
Right so I'm trying to make Played Face Cards turn into Steel Cards here
key = 'j_Helvi',
loc_txt = {
name = 'Queen(?) Helvi',
text = {
'All played {C:attention}face cards{} become',
'{C:attention}Steel cards{} when scored'
},
},
atlas = 'Jokers',
rarity = 3,
cost = 3,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
loc_vars = function(self, info_queue, card)
end,
pos = {x = 6, y = 0},
calculate = function(self, card, context)
if context.before and (context.other_card:get_id() == 11 or context.other_card:get_id() == 12 or context.other_card:get_id() == 13) then
for _, card in (context.other_card:get_id() == 11 or context.other_card:get_id() == 12 or context.other_card:get_id() == 13)[1] do
card_eval_status_text(card, 'extra', nil, nil, nil, {colour = G.C.UI.TEXT_INACTIVE, message = 'STEEL :D'})
card:set_enhancements('m_steel')
end
end
end
}```
you can also do context.other_card:is_face()
how do I give the player money?
@wintry solar poke because ui wizardry
return { dollars = 1 }
in joker calc should work
didn't work
right, ok
is there any other way? like can i edit the global variable (probably horrible but would probably work)
Trying to offset a layer of the card?
ok it still crashes
Before doesnât have other card
Depends what youâre trying to do
Kinda like Midas Mask but for Steel Cards?
basically
Just loops over context.scoring_hand within the before context then
soscoring_hand instead of other_card?
Yeah but itâs a table of cards
oh yeah howd you do that
soul sprite?
Would have to dig out the code, Iâll send it your way later today
swag
ok it didn't work
whats the code?
Whatâs your smods version?
hate to do this but, up
probably G.Game.chips no?
oh that would make sense
I was stuck on the fact that it was probably named "score" or something
i fixed it using ease_dollars
nice but returning dollars works too if you are using new_calc of smods
yeah i should probably update smods soonish
wtf this is peak
If I want my joker to do something if the player has a specific other joker, how would I phrase that in the description?
Haha, I might come back to balloons at some point
oh no. iâve gone too deep into this iâve made a texture pack that makes all cards look like face cards as in they have a picture and they all look like hamilton characters⊠not sure if that counts as a mod but umm its cool ive also added sound effects specific to each card
iâm keeping this to myself. iâm the only one that wants an alexander hamilton king that sings 3 seconds of my shot when played
this was not worth the month it took
I would want it
I love hamilton
well you donât deserve it
iâll consider it
would i even be allowed to release it because it contains copyrighted material?
is there a guide for making booster packs? I've looked at the docs but mine isn't working properly
is it green particles that won't go away?
yeah
set skip_materialize = true
Ok I figured out the function part, but it keeps giving me the messege "Steel!" Multiple times when scoring for some reason
if context.scoring_hand then
for k, v in ipairs(context.scoring_hand) do
if v:is_face() then
v:set_ability(G.P_CENTERS.m_steel, nil, true)
card_eval_status_text(card, 'extra', nil, nil, nil, {colour = G.C.DARK_EDITION, message = 'Steel!'})
end
end
end
end```
What exactly is new_calc?
Hey Balapalsâąïž.
I'm back.
~ Egg
Guess who just found out it's Two Pair instead of Two Pairs.
bcuz the message is steel
or do u mean like
2-3 times
instead of one
2-3 times instead of one
do you want it to happen before or after scoring
+$3
+$3
how do i edit the card textures
I want it to happen before the scoring
try adding context.before
okay so I got the pack working
but I can't emplace the card into my custom card area
there are probably some shenanigans I need to get up to
what kind of card are you trying to emplace
it's a consumable, technically
@crisp coral ```toml
Card:draw()
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = '''G.shared_seals[self.seal]:draw_shader('dissolve', nil, nil, nil, self.children.center)'''
position = 'at'
match_indent = true
payload = '''
if self.ability.floating_away then
self.ability.floating_away = self.ability.floating_away - 0.075
G.shared_seals[self.seal]:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod, self.T.w*-0.38 + 0.3math.cos(self.ability.floating_away), self.ability.floating_away + self.T.h-0.65)
else
if SMODS.Seals[self.seal] and SMODS.Seals[self.seal].balloon then
G.shared_seals[self.seal]:draw_shader('dissolve', nil, nil, nil, self.children.center, nil, nil, self.T.w*-0.38, self.T.h*-0.65)
else
G.shared_seals[self.seal]:draw_shader('dissolve', nil, nil, nil, self.children.center)
end
end
'''```
this is how I moved the sprite
how do i do it properly because i donât wanna mess anything up
if its custom you probably need a way to differentiate it from the other consumables
well it's in its own set
no
How can I get an arbitrary modded sticker from a Joker?
as in deck skin?
thats cool, here's a lovely patch I used for my own set and own cardarea
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = '''
elseif card.ability.set == 'Booster' then
'''
position = "before"
payload = '''
elseif card.ability.set == 'Alignment' then
card:add_to_deck()
G.cs_alignments:emplace(card)
play_sound('card1', 0.8, 0.6)
play_sound('generic1')
dont_dissolve = true
delay_fac = 0.2
'''
match_indent = true```
I was looking at that one clip of the reverie film pack and I noticed that the cine in that pack said "select" instead of "use", probably has something to do with that
I'll try this
hey so maybe stupid question, but I'm trying to figure out how to make a joker create a planet card when any tarot is used
if you respond, please piing me in the response as I am bad at checking back
no its because your consumable is not configured to be emplaced in that cardarea
you could try using event manager to create an event
when a tarot card is used
there's a context for that iirc
do you know the context?
context.using_consumeable
and use context.consumeable.ability.set == "Tarot"
the documentation for steamodded is great and all, just very vague and lacking a lot of things
tysm!
specifically, I want to test for a sticker's presence
that worked
thanks
Quick question: does a Full House contains a Two Pair?
yup
Then why does spare trousers code need to check both next(context.poker_hands['Two Pair']) and next(context.poker_hands['Full House'])?
Yes
hm
-- (context.poker_hands['Straight']) checks if the current hand is a 'Straight'.
-- The 'next()' part makes sure it goes over every option in the table, which the table is context.poker_hands.
Can I put poker hand type into info_queue?
idk what it is xd
context.poker_hands contains every valid hand type in a played hand
Another question now, how would I create the tarot card đ
oh there's a cat pic
never noticed that
figured it out
u can check example mods from smods in moddedvanilla
it has perkeo code, which creates consumables
đ
this is the snippet of its code, it gets the consumable from ur current ones
local card = copy_card(pseudorandom_element(G.consumeables.cards, pseudoseed('perkeo2')), nil)
-- Vanilla function, it's (edition, immediate, silent), so this is ({edition = 'e_negative'}, immediate = true, silent = nil)
card:set_edition('e_negative', true)
card:add_to_deck()
-- card:emplace puts a card in a cardarea, this one is G.consumeables, but G.jokers works, and custom card areas could also work.
-- I think playing cards use "create_playing_card()" and are separate.
G.consumeables:emplace(card)
return true
Idk, thunk moment probably
wait can u send the if statement?
bcuz full house is technically a two pair too
but its not maybe
I want to add specific jokers to a booster pack
is there a way to do that?
it's some of my modded ones
Show the create card function of your booster
well yh
the code is built to have every possible poker hand with ur hand
oh
so it checks if its two pair or full house
bcuz full house contains the two pair
thats why
So instead of G.consumeables, would specifics, like G.Tarot, work?
I haven't written that one yet
but I have this one
SMODS.Booster({
key = "basic_pack",
loc_txt = {
name = "Basic Pack",
group_name = "Basic Pack",
text = {
"Contains 5",
"Friends Vs. Friends cards",
}
},
config = {
extra = 5,
choose = 2
},
kind = "Weapon",
create_card = function(self, card, i)
return {
set = "Weapon",
skip_materialize = true,
}
end
})
I mean by the rule it is, but what about the code?
so with create card you can return a card as well, so you can just create your own pool and handle it within the function
what do u mean "about the code"
if u play a full house theres full house, three of a kind, two pair, pair
Riv it's just a thunkism, there's redundant stuff all over the palce if you look for it
the jokers usually say if the hand CONTAINS the played poker hand for it to trigger
the exception is check list or whatever its called
So let me ask this one more time:
Why Does Four Of A Kind NOT Contain A Two Pair???
bcuz two pair is 2 pairs that are different
afaik
big
prob
actually u should check this
https://github.com/Steamodded/smods/wiki/SMODS.Consumable
Because a two pair, by definition, is a hand with two pairs of differently-ranked cards. Otherwise, it'd be a 4oak
hand description specifically says two pairs with different ranks
it may be G.c.tarot or smth
yeah
no, G.consumeables refers to the area that consumables are held in
u can check examples mod deck skin template in smods example mods
Also, how do I put this pic into info_queue?
Does anyone know where the code for when cards are drawn from deck is in the game's source code?
I've been looking for it for a quite a while now
are you creating ur poker hand? if so u can put example = {
{ 'S_A', true },
{ 'S_K', true },
{ 'S_Q', true },
{ 'S_J', true },
{ 'S_T', true },
},
first letter is suit
second is rank
No, just vanilla hand type
oh idk sadly
alright, I think I've got it. Wish me luck!
I think it's this?
I think that's it. Thanks!
Was looking in the wrong file
I had a joker that was changing the Blind:stay_flipped code, so I just did a ctrl+shift+f for that and looked through the results for any that looked promising
how do i get the whole mult so i could alter it myself? im making a 3x+1 joker which divides by 2 if its even and multiplied by 3 and adds 1 if its odd and runs till it gets the biggest number from the algorythm
so how do you make your own pool đ
I'm clueless
I guess it might be SMODS.ObjectType?
check cryptid memepack
if they're equally weighted just use a table
istg G.mult better Not be a table
during the joker_main context you could add a check if mult % 2 == 0 then and then return the x3 mult and +1 mult
If you have talisman installed, it'll be a table
peak
so true
well i run 3x+1 algorithm until it reaches 4 mult(bcuz 4 will be stuck in a loop 4>2>1>4>... etc)
i based it on the math problem of same name
all i need is to modify the mult, i have everything else working
you pinged me by mistake
I know that someone in the Ortalab chat made a Colatz joker as the reverse of the Fibonacci joker, so I was looking at their thread to see if I could find it.
oh
Sorry lol
Dayum
So Full House check is unneeded.
I meant to ping to this
Thunkism. You can never expect the Two pair to Not be in the full House
While being in Full house
if mult % 2 == 0 then
return {
xmult = card.ability.extra.xmult
mult = card.ability.extra.mult
}
else
return {
mult = card.ability.extra.badxmult
}
end
end```
I think this would work for ya, smell
Edit: xmult is 3, mult is 1, badxmult is 0.5
yh they made it ig
although its different than what i have in mind
nah, they had someone who actually found what mult was at the time the joker calculated, then either multiplied it by 0.5 or 3 depending (they decided +1 was too trivial)
in here #1217704157574860810
it does it once, i run the collatz conjecture to find the biggest number in it
i cant see that message
My code is below. Sorry, I"m very new to lua and Balatro modding. I keep getting an error saying unexpected symbol near 'if'. It gives line 38 as the offending line, which I marked below.
SMODS.Joker {
key = 'ethereal_j',
loc_txt = {
name = 'Ethereal Joker',
text = {
"Each played Planet Card gives",
"a Tarot Card"
}
},
config = { extra = { money = 1} },
rarity = 1,
atlas = 'vopjs',
pos = {x = 1, y = 0 },
cost = 6,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.money} }
end,
if context.using_consumeable then
if context.consumeable.ability.set == Planet then ###THIS LINE###
return {
local card = copy_card(pseudorandom_element('Tarot', G.consumeables, pseudoseed('ethereal_j')), nil)
card:add_to_deck()
G.consumeables:emplace(card)
}
end
end
end
}
Again, please ping me if you answer
2 if statements and 3 ends
try removing 1 end
maybe its that?
Ok so
what if I want it to have a different effect for a different card?
Like. +1 Chip for J, and +2 Chips for Q
You check what the card is
if context.other_card:get_id() == 10 or context.other_card:get_id() == 4 then -- id refers to its rank
for ur purposes, J is 11
Q is 12
K is 13
A is 14 i think?
the context to check each card is individual btw
It would be sensible to, yes
But do I set it up like. this?
extra = {
chips = 1,
chips = 2,
chips = 3,
chips = 4
}```
Theyâd need different names
u would have to change all those names and then return { chips = sum of triggered ones }
I've seen some jokers that change their appearance so I know it's possible. I'm assuming that I can just change card.pos mid-game?
You need to use card:set_sprite_pos() iirc
how.....do I do that while also making it still be a chips thing
You can use whatever names you want in the config
js rename the chips to different things then u can do chips = the chips path
yeah, I've seen people use total and xmult both for the same thing
Oh huh
the name of the variable is only important to the person actually writing the code
the path would be smth like this - card.ability.extra.NameOfUrThing
Ohhhhh
i recomend u to check https://github.com/Steamodded/examples
it has runner, which is based on the mechanics of checking what cards are scored
walkie talkie*
sorry, I named the jimbos wrong
Oh Wow
Yeah thanks for this I really needed that
Ok it just doesn't add the chips now
extra = {
chips_11 = 1,
chips_12 = 2,
chips_13 = 3,
chips_14 = 4
}
},
loc_vars = function(self,info_queue,center)
return { vars = { center.ability.extra.chips_11, center.ability.extra.chips_12, center.ability.extra.chips_13, center.ability.extra.chips_14 } }
end,
calculate = function(self,card,context)
if context.individual and context.cardarea == G.play then
if context.other_card:get_id() == 11 or context.other_card:get_id() == 12 or context.other_card:get_id() == 13 or context.other_card:get_id() == 14 then
return {
chips_11 = card.ability.extra.chips_11,
chips_12 = card.ability.extra.chips_12,
chips_13 = card.ability.extra.chips_13,
chips_14 = card.ability.extra.chips_14,
card = context.other_card
}
end
end
end,
}```
bcuz ur supposed to add them to chips = sum of those things
and u can also get the id and subtract 10 from it to get the index of ur chips bonus table
and return {
chips = card.ability.extra["chips" .. index],
card = context.other_card
}
the index approach might work
actualyl wait
u can js do return {
chips = card.ability.extra["chips_" .. index],
card = context.other_card
} i tihnk
no need to change anything
since the table will only return if its a face card
dude it is so hard to read your code without code blocks
eh i understand his code
his problem is that he did chips_11 = whatever
and not chips = card.ability.extra["chips_"..index] -- the "chips__"..index" is the key to get the value of the table
editing mult is Pain
not his, yours
I am new to just. coding in general and it crashed and I am So Lost
it is notepad++ yes, I know
whats the error message
you haven't assigned anything to the index value you're using
u can replace index with context.other_card:getid()
or introduce the index to be equal the context.other_card:getid()
uhhhhh
Bro im SO CONFUSED WITH HOW THE MULT WORKS
just don't use talisman ezpz
ITS A TABLE THAT STORES TABLES YET WHEN I TRY TO ITERATE THROUGH ONE
IT BECOMES A NUMBER
THEN WHEN I DONT DO THAT IT BECOMES A TABLE
is this a talisman moment
chips = card.ability.extra["chips_" .. context.other_card:getid()],
card = context.other_card
}```
im kinda stupid is this ok
yh like that ig
yeah that crashed
error screen?
it was used in the walkie talkie 2 joker from example mods pack
-- Specifically returning to context.other_card is fine with multiple values in a single return value, chips/mult are different from chip_mod and mult_mod, and automatically come with a message which plays in order of return.
oh its bcuz its get_id()
I don't care what the example mod says, you don't need the card arg
don't I need the getid()?
i made a mistake
to get the id of the card u do get_id()
chips = card.ability.extra["chips_" .. context.other_card:get_id()],
card = context.other_card
}```
you or someone else with some more knowledge on the best practices on calc should maybe go through the example joker mod and make sure everything is still the best way
yeah I will do at some stage, I've also toyed with the idea of just making all the vanilla jokers đ€Ł
so the mult has 3 things
a table
a signtest 1???
and a numbervalue
im so Confused
man talisman is peak
you gotta use to_number(mult) i think
that makes it able to be used in equations and such
well mult stores 3 things i dont think u could do that
probably disable talsiman's bignum/omeganum for testing stuff
well that would corrupt it if its bigger than e308 tho?
hell yeah it worked thanks
I have a joker in my pack that uses it to do calculations with hand_chips and mult. I had to put this to_number thing there to make it compatible with tali
Eclipse, (Spectral): Destroy all cards in your full deck of a random suit.
Is this doable?
you can also stick your regular number into to_big() to compare with talisman numbers
yes
(to_big won't exist without talisman, but you can do a to_big = to_big or function(n) return n end)
you only need that for comparisons, math works with talsiman numbers and real numbers
Idk tbh
would it?
yeah
dayum
cus lua's number type is a float
lets normalise not using talisman instead
Oh okay
you can be compatible with it without requiring it
(see my message litteraly one message down)
u would be Handicapped by Ante 38
*39
I've never made it past ante like 12 and also I did make a mod to not be stuck there without talisman
I know it's just such a pain that every mod has to design around it's existance
but numbers would just be inifnity
well the issue is cryptid requires and it's also the most popular mod
although you can get talisman to use vanilla number for compat
ideally though talisman would be transparent and not matter whter it's installed or not
I think the issue is that Balatro itself was never intended to go after ante 38, apparently
but as far as I know not possible
it wasn't intended to go much higher than endless
but you can make future ante's all have infinity requirment and make inf score passable with a few simple lovely patches
Personally I just use tali for the absolute sick ass sounds it provides for emult, xchips and stuff like that. Whoever made those is a wizard
put a boss on ante 39 which kills u irl
Call it smth Like Super Joker Extra Pro max
If u beat it, it would kill u
if u dont u would lose
Simple Solution
im trying to get it to give 4x mult when a four of clubs is scored
what part of the code did i fuck up
well u have to
Error message
see the thing is that it doesnt crash the game, it just doesnt trigger
well uhh
change the context to individual
change context.main_scoring to context.individual
also does is_rank even exist
if it didnt exist then he would error i think
talisman comprehension update: the table STORES NOTHING so i think its used for numbers above e308
gotta fix that in the wiki
I think it's context.other_card:get_id()
thats not incorrect
so ill js ignore the values
it's not?
yh its taht
what does "modifiers to cards" mean
i think it means editions, enhancements prob
^
ok the context individual worked
which then made me find out that is rank infact does not exist
yh use get_id()
Do you guys know a way to make a button change color when pressed?
but then that means the code would be executed and their game would crash cus is_rank doesn't exist, so does it just never happen
and check if its 4
this is on a joker, not an enhancement or edition
so the joker's main_scoring is never in the G.play area
I can maybe clarify that a bit better on the wiki though
context.other_card:get_id("4")? (im sorry if im being a dumb fuck, im very new to this)
no js get_id() == 4
if context.other_card:get_id() == 4 then
and the individual context
so this?
replace get_id() with context.other_card:get_id()
it's bc ur calling a function that exists in context.other_card ig
get_id() will be the function that returns the corresponding rank
is there anything in this boss blind that's set up wrong?
does it Error out
yeah, getting to ante 8 in a run causes the game to crash
functions/common_events.lua:2689: attempt to compare number with boolean
what line?
2689
it's some lovely patch then
i think it has to do with in_pool?
since its the only one with boolean in it
or boss table
yea i just dont know what it would be, since my in_pool is just return true
why do you even have an in_pool?
try disabling all mods but this one and seeing if it works
that is the case
well, i have my mod, steamodded, talisman (dependency), and debugplus
i can try removing debugplus i guess?
boss: Marks this Blind as a Boss Blind and specifies on which Antes it can appear ({ min = 1, max = 10 }). max is an artifact and not functional. Use in_pool instead for advanced conditions.
boss.showdown: Marks this Blind as a Final Boss Blind that shows up on every multiple of the winning Ante. min is ignored, use in_pool to restrict spawning.
mhm i read the smods.blind page
i can try removing in_pool
ok this is interesting
the problem seems to be that i was returning true, i instead need to return
0?
that wasnt it
check the lua dump
you are missing a comma after "scaled up!"
OHHH
this isn't really talisman, this is lua syntax
how would i load other files for jokers? i would like to be able to organize jokers into their own files so that I don't just have all of them in the mod lua file (and also so I can have different rarities of jokers that can be turned off in config)
yh my fault gang
load multiple lua source files?
oh Fuck i struck it hard
what i do is i have a folder src, then this section at the top of your main lua file
for _,v in pairs(NFS.getDirectoryItems(path)) do
assert(SMODS.load_file('src/'..v))()
end```
works great
it is still not working.
it doesnt crash but it doesnt give Xmult when a four of clubs is scored
its bcuz i put a mult = mult
try Xmult_mod
ah i see
where exactly
what version of steamodded are you using @upper ibex
in return
mod structure looks like this in terms of lua files
update smods
Xmult_mod does not automatically show the x mult message
latest is 1406a
that version is months old!
message = localize { type = "variable", key = "a_xmult", vars = { variable_goes_here } },
also in the return
Xmult_mod was deprecated over a month ago
yeah but why do that when you can do x_mult = wahtever for the same effect
didnt work for me
are you in 1304a too
update steammodded
1326a
then it should work
is Xmult_mod going to be flat out removed at any point or is it just not recommended
No idea if it'll be removed, but it's not even mentioned in the wiki
It's used in the example jokers for steammodded
Their Cavendish implementation uses it
mhm
okay, do i need to do anything else? im planning on having multiple atlases so that I can:
A. use different images for each of their atlases, for example, all of the Legendaries and "Things" get their own image because they have to be able to have a 3D effect
B. turn them on and off using configs and lovely patches
multiple atlases is just multiple SMODS.Atlas objects
ah gothca
which are outdated too
and then multiple files for each
I'm just saying you're adding unnecessary work to it by using any _mod
do whatever you want tho I guess
I was afraid you'd say that đ
does lovely have a way to dump the patched file from memory?
i feel like that was mentioned here but i do Not remember it
aha found it
ok my joker finally works
if eligible_bosses[k] > min_use then is the offending line??
oh god i think i created a monster
this jimbo makes ur mult skyrocket im gonna nerf him LMAO
if u put smth like 50 mult it will turn it into 88 mult and if u put 530 it will make it 9k mult
ok ive found the issue but i dont understand how its breaking
ok so i updated steammodded and it works but wrong
it triggers on all fours and not just four of clubs
this for loop is the problem, eligible_bosses[k] on my finisher blind results in true not 0 like the other boss blinds?
in the code right above it sets eligible_bosses[k] to a number
yea im looking now
are you using save states to test
no
do you have debugplus
Yes
is it easy to make a balatro mod
if u know lua then its semi-easy
lua isnt too hard to pick up either
personally i recommend checking https://github.com/Steamodded/examples for examples of jokers
and then checking the api reference
surely ur boss isn't in G.GAME.banned_keys
other than that i cannot see why your blind wouldn't work
there are banned_keys?
maybe it's a glitch in the version of steamodded u are using
actually what it could be
the run i was testing on i beat the blind on ante 1 to make sure it worked
lemme make a new one
yeah that was it??
so you were clicking continue instead of new game
how hard is it to say
make a new consumable type
kind of basically a save state
im trying to make a joker that adds +1 to the mult for every additional copy of that joker you have. I assume i should use a variable to check how many I have at once (im sure im doing it all wrong lol)
not hard at all
just copy this and replace the info with your consumable type's info
SMODS.ConsumableType{
key = 'Drugs', --consumable type key
collection_rows = {4,5}, --amount of cards in one page
primary_colour = G.C.PURPLE, --first color
secondary_colour = G.C.DARK_EDITION, --second color
loc_txt = {
collection = 'Drugs', --name displayed in collection
name = 'Drugs', --name displayed in badge
undiscovered = {
name = 'Hidden Drugs', --undiscovered name
text = {'Check under', 'the couch'} --undiscovered text
}
},
shop_rate = 2, --rate in shop out of 100
}
theres a text version
to copy
you also need this
SMODS.UndiscoveredSprite{
key = 'Drugs', --must be the same key as the consumabletype
atlas = 'Jokers',
pos = {x = 0, y = 0}
}
so if u have 2 jokers u would have 2 jokers with 2 mult
maybe u could do a global value
where in he code woould i puut it
i obviously need some sort of jumping off point
when the joker is added to deck u can add +1 to the global one
so how do i start making a mod
do u have steammodded and lovely installed?
do u know lua?
maybe�
i just need to know where to declare the global varialble ( i assume i have to declare it towards teh start)
im stilll learning lua
idrc though
prob when u declared ur joker
https://github.com/Steamodded/smods/wiki/Your-First-Mod start from here
and check the example mods of steammodded
so in the smods.joker section?
yh
the joker gets created then the global value gets created
then u can add this, which will trigger when u buy/get that joker
add_to_deck = function(self, card, from_debuff)
-- part where u add to that global value
end,
im gonna hate creating sprites because i have to make a 1x and 2x version of them
i put it in here, is this how i declare it?
after the declaration
got it
put a comma after 0
what i do is draw everything at 2x
then export at 50% scale for 1x
I just set the scale to 200% after making the x1 version
i have a problem
so i was able to get the first effect to work with a lovely patch
but i have no idea how to go about coding the second effect
does anyone have any advice
do you care about compatibility with other mods? or just base game is fine
i mean rn im playing with cryptid so i think mod compatability would be nice
@broken cliff any idea why it still doesnt work?
the ultimate flush enabler
why is there no space between joker and {
i think it might be that
its always been that way
missing a bracket at the end
see if the current boss blind has any suit parameter in debuff, like debuff = { suit = 'Hearts' } for the Head
then just
play_sound('timpani')
card_eval_status_text(self, 'extra', nil, nil, nil, {message = localize('ph_boss_disabled')})```
(stolen chicot handling code)
could honestly just check if debuff.suit exists
where doe sthe bracket go?
at the very end
this was so much work for very little effect in the actual scoring
if i just do an ending one it closes the rest of the joker code beneath it
and a front and back doesnt fix it
u have to put } not {}
at the end of the joker
then show the whole code
oh
you have a trailing comma
delete that gorb_count line
remove the comma from the last end
it can't go there
this doesnt matter
where do i put gorb coujnt then
it needs to be before the setting blind part i think
im used to my programming languages executing me if i have a trailing comma
what is the gorb count?
most programming languages let you have trailing commas in tables
none of the ones i learned
he wants to have a joker that scales with how many jokers of same kind are in the hand
then it needs to be in add to deck
counts how many gorb jokers i have, for each gorbh joker it increases the gorb joker's mult by 1
so if thers 2 jokers of same kind then it would be 4 mult(2 per joker)
this is the joker that spawns gorb jokers
yep
i have the thing that adds to it but i need ot declaere it first
i like writing mod idea things down in my notes app
wouldnt that only be possible with showman
1 joker 1 mult
2 joker 4 mult(2 per joker)
3 joker 9 mult(3 per joker)
and something else probably
not if you have a joker that creates them
@smoky talon 's joker creates a negative copy of itself
what languages did you learn?
Nice
java at first (sadly), then swift, then objc a bit as well
i dont use objc nearly as much as swift though because objc is Ass
the self destruct seal does what you think it does
doofershmertz ahh card
Jimbo-inator
if i dont declare it it gives this when setting bling which makes sense
i just need to find where to declare the count for the first time
maybe declare it at the start of ur mod?
cards with the self destruct seal give x2 chips and add x2 mult but self destruct after being played
couldnt you put it in card.ability
would i be able to get the last played hand at context.end_of_round
no atleast i dont think so
u can check how many played hands there were
subject to change btw
and if only 1 hand remains then do the ability
it works but the count isnt incrementing for each additional one and the joker just says xnil
kaif
prob bc this is what i have for setting the xmult to gorbcount, it prob doesnt work lol
did u put g.gorb_count = 1 anywhere
or js declared it
i delcared it and it stays at 1 even when adding multiple m,ore
i put that at the top like u said
actually i might bump up the amout of mult the seal applies
2.5?
so either the gorb count isnt incrementing or the xmult isnt tied to it
whats that debug command that lets me check a variable's count again?
did u add add_to_deck to increment
print would work i think
no as in print(G.gorb_count) in the joker
ah
gorb count is going up
just not linked top mult
which is what i predicted
so the linking code needs fixing
java arrays can, not sure if java really has an equivelent for a table, swift arrays let you, but structs don't, objc c arrays let you, NSArray doesn't seem to let you
do you increase it when the joker is added to deck
yep that works fine, just need to fix the mult in the gorb joker
i just need to find out how to tie the gorb joker xmult to the gorb_counter variable
i assumed Xmult = G.gorb_count would work but it didnt
ill try that
i think xmult means that when scored it would be x3 instead of +3 instead of being tied to incrementing it
but i can try it
ok i kinda fixed it
i changed the scoring code to pull from gorb count instead fo xmult but the only issue is that the card still says xnil mult
WAIT
IDEA
nevermind my idea dont work
rip
hihi, what does this portion of Stella Mortis do?
if Incantation then
quota = planet_to_destroy:getEvalQty()
end```
{X:mult,C:white} X#1# {} is actually confusing line of strings
The X means the color of the background text basically, C is color of the text (in the {})
it is
same way chips is for blue
and attention for orangish
ok and what does X#1# do
does #1 pull from config.extra.mult?
it pulls from loc_vars
Oh
side note if I return a loc_vars like { vars = { test = 1 } } and do #test# does that work?
(bump)
i dont know what stella mortis is
prob not
it's an Exotic joker from Cryptid
i'm looking at its code to see how to destroy a random Tarot card
Its probably compatibility with another mod called Incantation, not relevant to what you're trying to do
wait i have anothe rproblem now lo;
i thought it meant Incantation, the Spectral, but that didn't make any sense â your explanation feels obvious now =w=
the description isnt updating with the card
i assume it onluy activates when the game starts and doesnt update
how do i fix that?
it does not, but it'd be fairly easy to make it work iirc
I don't have any use for it but it may be neat
https://github.com/Steamodded/smods/pull/330 there's this rejected PR that did that along with default loc_vars using those string keys. I think I said it'd be best to stick to vanilla conventions to not make things more confusing
Adds a default loc_vars function and allows for returned args from loc_vars to use not just number keys but also string keys. Alters the localization function directly so the string key change can ...
i guess it's debatable if that should also generally disallow string keys
I know that vanilla uses the colours key from vars for whatever the {V:1} thing means
yeah that's a special case
hmm, so hovering over one of my jokers in the collection crashed the game
those ones should let you pass strings for custom colouyrs though, right?
i know why, but i've no idea how to fix it
it was this line:
return { vars = { count_planets(), card.ability.extra.out_of_odds, card.ability.extra.x_mult } }
it tried to count the number of planets when i was on the title screen
aha wait no i can fix this. maybe.
i've seen some or 0s around some people's code, and now i know why :}
i fixed it
hmm, no, still bugged. it tried to index consumeables which was nil
but my count_planets() function checks if it's nil first:
if G.consumeables.cards then
...ah wait, nevermind. it counts indexing as the .cards bit right?
Remove the .cards from that if
hokai
if you need to index something that doesn't exist the standard behaviour is G and G.consumables and G.consumeables.cards instead of G.consumeables.cards (although you can proably skip the G part for this one as it should always be defined in balatro)]
there we go, cheers :D
Love seeing well written descriptions
Yeah
Hi, apologies for this likely easy to solve issue, but I'm starting to lose my mind a little;
Updating my own deck skin series to work with the new DeckSkin API, but try as I might I cannot get the cards to show up in-game. I've been following the Cardsauce Experimental Skins formatting, but in messing around with the key and atlas variables (switching which one references FoLK and which one points to the deck) I've only gotten a crash, the original cards showing up, or, for this current iteration, the 4, 3, and 2 of Hearts. Would anyone be able to point out the area I'm going wrong in?
you will need your prefix on the atlas keys
Ahhhh. I... never set one. That would explain a lot.
it's just for the reference not the defijitoon
how exactly is that an in-game action that happens?
you know what that's a fair question
iirc cloud 9 counts them on the update function
it does but that's inefficient and not really needed
in the case of cloud 9, calc_dollar_bonus and loc_vars would suffice
or more generally, before any calculation that uses the value and in loc_vars
I need help regarding custom palettes: I'm trying to add an alternate high contrast option to the default suits and the existing collabs (green clubs and blue diamonds). This is my current code, and while the option appears, the atlas are not applied (the cards use the default low contrast atlas). The atlas work fine if I just override the High Contrast Colors option, by using the cards_2 key and prefix_option.key = false. Any ideas on what is wrong?
SMODS.Atlas{ key = 'cards_2Alt', path = '8BitDeckAlt_opt2.png', px = 71, py = 95 }
SMODS.Atlas{ key = 'icons_2Alt', path = 'ui_assetsAlt_opt2.png', px = 71, py = 95 }
SMODS.DeckSkin:take_ownership('default_Clubs', {
palettes = {
{
key = 'lc',
ranks = {'Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', '6', '5', '4', '3', '2'},
display_ranks = {'King', 'Queen', 'Jack'},
atlas = 'cards_1',
pos_style = 'deck'
},
{
key = 'hc',
ranks = {'Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', '6', '5', '4', '3', '2'},
display_ranks = {'King', 'Queen', 'Jack'},
atlas = 'cards_2',
pos_style = 'deck'
},
{
key = 'hc_alt',
loc_txt = 'High Contrast Alternate',
ranks = {'Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', '6', '5', '4', '3', '2'},
display_ranks = {'King', 'Queen', 'Jack'},
atlas = 'althico_cards_2Alt',
pos_style = 'deck',
suit_icon = {
atlas = 'althico_icons_2Alt',
pos = 1,
},
},
}
})
-- Repeated code for Diamonds
gyuys pleasehelp
i need to know why im getting this error when i open collectible types (ill show the error and the code)
im trying to add a collectible type, but smth is def wrong
Do vouchers have a shader associated with them?
yes
as far as i can see the error isnt saying anything about my mod file, but ik its the mod as it only happens when the uno stuff is not commented
damn, i was gonna try to make it have the negative shader
you can change what it uses
nice
Might be overthinking this but how do I Count (in this case) 8's I have in the full deck?
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult_gain, card.ability.extra.mult } }
end,
calculate = function(self, card, context)
if context.cardarea and context.cardarea == G.jokers then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
card_eval_status_text(card, 'extra', nil, nil, nil, {colour = G.C.RED, message = localize('k_upgrade_ex')})
end
if context.joker_main then
local mult_to_add = card.ability.extra.mult
return {
mult = card.ability.extra.mult
}
end```
Loop thru G.playing_cards which is your full deck
maybe i did the loc_txt on the consumable wrong?
chicot's soul is lowkey better than chicot
i think i realized why the error is happening
id guess the colours
it just doesnt tell me how youre supposed to do them
in the wiki
ajhhhhhh i got it
its supposed to be a hex code
when using take_ownership, how to reference the default behavior of the object you're overriding?
make a local reference to what you're modifying before the take_ownership call
Do vouchers also use the 71x95 per voucher like how jokers do
yes
okay thanks
Found the solution: I was suppoed to use the add_palette function, not redefine the object manually. Here is the working code:
SMODS.Atlas{ key = 'cards_2_alt', path = '8BitDeckAlt_opt2.png', px = 71, py = 95 }
SMODS.Atlas{ key = 'ui_2_alt', path = 'ui_assetsAlt_opt2.png', px = 18, py = 18 }
SMODS.DeckSkin:take_ownership('default_Clubs', {}):add_palette{
key = 'hc_alt',
loc_txt = 'High Contrast Alternate',
ranks = {'Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', '6', '5', '4', '3', '2'},
display_ranks = {'King', 'Queen', 'Jack'},
atlas = 'althico_cards_2_alt',
pos_style = 'deck',
suit_icon = {
atlas = 'althico_icons_2_alt',
pos = 1,
},
}
nvm I WAS SUPPOSED TO DO A G.C
MY DUMBASSSSSSSS đ
I GOT IT WORKING LETS GO
i havent come up with a mechanic so just take this pluh
Now its time to make a booster
yippee!!!!
pluh!
remember to set skip_materialize = true
thx for the tip
is there a way to make it so theres only a more chance of a negative without upping the other chances of holos and that stuff
check cryptid wormhole deck
okay
okay, i found it calls for cry_negative_rate = 20, now i gotta find where cry_negative_rate is made
okay i found these and i dont understand at all
if self.effect.config.cry_negative_rate then
G.GAME.modifiers.cry_negative_rate = self.effect.config.cry_negative_rate
SMODS.Edition:take_ownership("negative", {
get_weight = function(self)
return self.weight * (G.GAME.modifiers.cry_negative_rate or 1)
end,
}, true)
Haha, is there a way to check if Wheel of Fortune fails?
do boosters use 71x95 like jokers and vouchers
I think the order you've written them in is a good order to make them in lol
yes
im assuming they meant they should get to work on what theyve concepted
thx
the sprites are scaled up by x1.3 or so in-game
1.27
ty
well first i have to actually create the self-destruct seal
yea, ive been looking all over and i dont understand at all
idk specifically what the first part does, i assume it'll update itself when you get the voucher
but the 2nd part takes ownership of negative edition so it can modify it using smods
it then multiplies the odds
it's actually on the wiki
cryptid has a joker about it, you can look at it's code
do it anyways so it's not bundled with the rest?
is there a card area specific to booster packs
G.pack_cards
i think i'll have to create both the alabell card and the seal at the same time
big
so i should create the seal first then the alabell card
which is how the seal example mod does it
but i also have to create the consumable type
thereâs a lot i have to doâŠ..
how do i make a custom joker rarity?
With SMODS.Rarity
Here's an example from my mod:
key = "spc",
loc_txt = {
name = localize('k_buf_spc')
},
badge_colour = HEX('ee8f8d'),
pools = {["Joker"] = false},
get_weight = function(self, weight, object_type)
return weight
end,
}```
but in my case, the rarity doesn't show up in game. You gotta edit the `pools` part and add a `rate`. Check out the wiki above
okay, time to make the cards, and the seal, and the consumables.
Does anyone know how to force an UI update on these buttons? I'm trying (and failing miserably) to make the "Auto" button change colors dynamically as it's pressed
so the rarity is there just not in the shop?
thats what i want
i just want to spawn them in
through a new skip tag
look at how the play and discard buttons update
i made the rarity but the joker jus says common and still shows up in the shop
now that i have my metadata set up...... its time to code
you gotta set the joker's rarity to pfx_rarity where pfx is your mod's prefix and "rarity" is the rarity's key.
ah
Will do. Thanks!
what does the error say?
the jkoker rarity is just ERROR
But it's there?
yeash
That's probably bc you dont have a localization for the rarity's name
or did you just use like a string?
Try using name = "ultrameganice"
see if it shows up
Take the cat outta the localize
also you can change the HEX to whatever you want the badge color to be
lol
how do i make a function thats ran when the voucher is bought
or when a specific voucher is bought
redeem
thanks
now how do i actually start making the mod once i'm done with the metadata
sorry if this sounds like a stupid question i just don't really understand that much about actually creating a mod
check out the example mods
If there was an example sticker mod I would be able to make a sticker đ '
just to check, am i doing this right
note, i did already make an atlas, its just not included
im trying to make a booster
id just like to know how to make it only include consumables of a specific consumable type
any advice cuz the wiki isnt very helpful so far
I just went through the booster trials
in the create_card function, you can return a table with a set key that's the set of the consumable type
ok
SMODS.Booster({
key = "basic_pack",
loc_txt = {
name = "Basic Pack",
group_name = "Basic Pack",
text = {
"Contains 5",
"Friends Vs. Friends cards",
}
},
config = {
extra = 5,
choose = 2
},
kind = "Weapon",
create_card = function(self, card, i)
return {
set = "fvb_cards",
skip_materialize = true,
}
end
})
like so
thanks!
also you should also put skip_materialize or your cards will be haunted by green particles
LOL