#💻・modding-dev
1 messages · Page 80 of 1
fair
how i can put the blind score scaling of gold stake?
i think challenger deep can help with that
set teh stake to gold stake as part of the challenge
I imagine you can set G.GAME.modifiers.scaling to 3 in your apply function
ok, thanks
i will do it rn
what lua extension you recommend for vs code?
luals with the love and nativefs extensions for luals
thats what i use
oh wait
theres no nativefs addon
what am i on about
config stuff in steamodded (since I cannot find any documentation on it):
Create a config.lua file in the top level directory of your mod. It can look as simple as:
return {
setting = true,
multivalue = 5
}
This file will be the "default" settings for anyone first installing your mod.
Steamodded will then automatically copy your default config to %AppData%/Balatro/config/[your mod id].jkr when any setting is changed from the defaults.
You don't need to worry about/deal with saving to or loading from this file, just thought I'd document it.
Now you need to give the user the ability to manipulate their config. The easiest way and most conventional way is to do so by using SMODS.current_mod.config_tab:
local your_mod = SMODS.current_mod
SMODS.current_mod.config_tab = function()
-- lots of UI stuff - you might want to check other mods for more elaborate examples
return {n=G.UIT.ROOT, config = {align = "cm", padding = 0.05, r = 0.1, colour = G.C.BLACK}, nodes = {
create_toggle{
-- making use of the base game function create_toggle by Thunk - look at its sourcecode to see the customization options
label = "label",
w = 0, -- hacky hack to force toggle to center when label length is less than 3
ref_table = your_mod.config,
ref_value = "setting"
},
create_option_cycle{
-- or use create_option_cycle for cycles - again, see sourcecode for extensive customization, and other mods for examples
label = "label2",
ref_table = your_mod.config,
ref_value = "multivalue",
opt_callback = function()
-- you will need to define this function otherwise the value will not be saved, see e.g. https://github.com/Eremel/Galdur/blob/master/galdur.lua#L808
end
}
}}
end
Finally, if you want to read from the config, it's as simple as:
if your_mod.config["setting"] or your_mod.config["multivalue"] > 3 then
...
end
All that should result in something like this:
What do you guys like better?
24 hands and 24 discards, hands and discards don't get reset at end of round
OR
6 hands and 6 discards, hands and discards get reset at end of ante
what is this for? a joker? a deck? a challenge?
The first one has no endless potential
So the second one
Gotcha
I also like the second more I think
is rthethere a way to just. draw text on screen. at all times
or like can i hoodk into love.draw in any way
I mean you can just... use love functions. Idk if it'll work right at all times I guess
okayyy so i need to traverse the ui tree to find a specific button
so i can call a function to simulate clicking that button
how would i access said ui tree
(i need specifically the Select Blind button)
(and the Skip Blind button but that's for later)
G.blind_select.UIRoot.children[1].children[1].config.object:get_UIE_by_ID('select_blind_button')
ah here we go (?)
Is there a way to have a joker loaded but not show up in the collection page?
Probably, but I'm kinda curious of the purpose
does anyone know how to do this? or is there a mod i can take example from
Like shaders?
Secret versions of jokers that do not spawn, but are given in specific situations/scenarios
Not my vibe, but makes sense
So there must be a cleaner way, but using a dummy edition would get it working
How do you apply a specific shader to a joker by default?
(To whoever knows)
In any case, jokers that don't down normally still usual show up on the collection
You could just have them locked/undiscovered by default and handle the pool seperately
I think the benefit to it still being in the collection is once people do manage to get it, they can look back at what it does later
And idk if people don't wanna play along and unlock them manually that's their prerogative. Still won't mean it actually spawns
you could just make them undiscovered
That's a good point, actually.
It's just a "better" version of a joker in the mod with similar sprite that you can only get from using a particular deck and sleeve combo
Yeah I figured it was something like that
That's why I wanted to hide it, to not have two similar sprites in the collection. But makes sense that people would want to look back at them to see the desc text
Maybe figure out the clicking thing that tarots dx does?
Though I don't think it's really nessacary
I'll take a look
Thanks!
Np :3
Oh I also noticed the legendary in the pack seems to say 'not yet made' in the description, effect though it spawns
If I'm thinkinh of the right pack
In yours I mean
It says "not yet created" after the card is created?
And in parethesis
Yeah lol. Nah, I actually think it's maybe a little ambiguous
Inactive and in parenthesis right below the line is referring to is standard formatting
So if it's that it's on me
But yes, it's the inactive text. It's supposed to say "already created" when it does create the joker, to let you know it won't create any more jokers
Yeah I understand the purpose now
I thought it was like dev text for some reason, lol
But that's perfectly in line with how joker descriptions work
lol I mean, it's a little unorthodox. But it works
It works exactly like dozens of other joker descriptions. I should really know this playing when over 1200 jokers, lmfao
But my brain did a thing I guess
Happens to the best of us
Unless the exporter just strips it. Maybe a line break between the two effects would help for clarity
And maybe 'not yet created' should be in an extra pair of parathesis
To group it as kinda a subclause
maybe remove the "not yet created" text and instead replace the "must have room" text with the "already created" text
once it's created
Oh good idea
do stone cards have a context.other_card:get_id()
given "must have room" is kinda redundant when the ability's no longer gonna work
yes
whats the id for them
why is it like that 😭
I take it that's so that the stone cards get sorted in a random order?
it's so they don't count as thier own rank
but why is it random in such a large range
sorting I'd assume
If not for the low memory allocation, balatro would be very scalable
so they almost never match ids
stone cards do have a preferred order when you have a lot of them. Even if you rearrange them, sorting them will snap them back to their original positions
I thought about the line break part, but it would get the joker into the 5 line territory and make the textbox look kinda weird in game. Would the parenthesis help in the exporter?
Yeah or just what the other guy said
Awesome idea
Next update it'll be fixed
thanks
wait so if on the off chance you got 2 stone cards with the same id would they play as a pair 😭
didnt know that thats kind of funny
are stone cards the only cards with a negative id
is it possible to change the description of playing cards when you hover over them?
im, making a card that would make the chips given by cards random and i want to do a misprint description on the cards whenever i have that joker
Pretty sure you can take ownership of any thing to change its loc text. Or do something more elegant I'd be unlikely to gravitate towards if I were to finally code a mod
ill,, just look into that later sjdhsdjh
But yeah is there any way to delete the blind circle
yes
am i right in saying xchips isnt implemented into steamodded by default
i cant get it to work in the slightest
yes
thats so annoying
y do u need XChips anyway?
It must be easy to implement, like 5 people have done it
All probably copying talisman for compat. Because I've had no issues mixing different implementations
you gotta make a lovely patch for xchips or emult or whatever
How?
don't know off the top of my head
I belive talisman implements it if you want to depend on it
Hmm ok
(not if reference to SMG's thing)
Yeah I understood that
You can inject the xchips code in these two blocks of code in the state_events.lua file from the base game. Just follow the same syntax and add a prefix before the xchips thing
Wait is Xchips not in base game at all?
it's not
like if effect.pfx_Xchips_mod then mult = mod_mult(hand_chips*effect.pfx_Xchips_mod);extras.hand_chips = true end
basically just copy the Xmult and change Xmult to Xchips and mult to hand_chips
I mean it's basically the same as Xmult. Xmult and Xchips have the same effect on the final score
i get it
such a hassle
I used it for the same reasons
is there no way i can individually just multiply the chips amount for one specfic joker or do i have to fully implement it
cus its so much work to use it for one joker 😭
Let's say it's X4 Chips. Maybe you could do like
hand_chips = hand_chips * 4
end```
I'm not sure that'd work though
is it possible to declare multiple atlases in the same script
my game shits bricks when i try
Can we see your code?
sure thing
all i want to do is add an icon damn it
the crash specifically complains about line 28 which is so random
my brain is gonna explode its 6am
I think you need register {} or similar after each atlas definition
Look at how pokermon does it
does that include SMODS.Joker
The smods.joker objects are in a different file
But yes do exist
Yeah I think so
But that's just for organization
still throwing out this error
INFO - [G] 2024-10-23 06:00:03 :: ERROR :: StackTrace :: Oops! The game crashed
[SMODS _ "core/game_object.lua"]:28: Missing required parameter for Atlas declaration: py
Stack Traceback
):<
WAIT
i hate my life
i put py instead of px
or rather
px instead of py
😭
look at lines 22 and 23 thats so embarrassing 😭
Lol very easy to do
Catter :3
Nice
how do i refer to the cards in the played hand
i thought it was context.played but doesnt seem to work
G.play.cards
Modding help: How do I check if a card in my played hand has a specific Enhancement?
ty
It's for this card:
Library Card (uncommon joker)
Gains X0.1 Mult if played hand contains a Flush and a Wild Card
or context_full_hand (which is the same) and context.scoring_hand (which is scored cards only)
i don't know what i'm looking at but thank you for helping 
i'm sure it tells me how to apply a shader somewhere
would this only appear if you have a wild card like how glass joker / lucky cat etc. appear?
oh yeah context.scoring_hand is what im looking for thanks
is context.scoring_hand:get_id() == the correct way to search for a specific card id out of scoring cards
Steamodded's Example Jokers don't tell me how to do that sadly 😔
But good idea
if card.ability==[enhancement]?
that;s what I come up with trying to read the code
👍
https://github.com/Steamopollys/Steamodded/blob/main/core/game_object.lua
here's the relevent file
strange question, if i remove card from card.ability does it become global across all values that use it?
i'm trying to make an enchantment ability that stacks, for each of this enchantment that's discarded next played hand get's plus 20 chips. i'm using the extra value so if you exit the game doesn't forget.
maybe look at betmma's voucher that lets enhancements of the same kind stack?
if context.joker_main and next(context.poker_hands['High Card']) and not context.blueprint then
mult_mod = card.ability.extra.mult,
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
end```
Does this wording work?
Sword Swallower (common)
+4 Mult if played hand is exactly a High Card. If it's the first High Card this round, +1 Hand.
I would also like to ask about how I can add a "once per round" counter to a Joker that resets after each Blind.
Thanks!
you can probably use a boolean that sets to true when you trigger the joker, and reset it back to false once the blind ends
That's the plan, though I have no idea how to do that
very cool :)
SMODS.Joker {
key = 'swordSwallower',
loc_txt = {
name = 'Sword Swallower',
text = {
"+4 {C:mult}+#1#{} Mult if played hand is,",
"{C:attention}exactly{} a {C:attention}High Card{}",
"If it's the first {C:attention}High Card{}",
"this round, {C:chips}+1{} Hand"
}
},
config = { extra = { mult = 4, swallowed = false } },
rarity = 1,
atlas = 'MASS',
pos = { x = 1, y = 0 },
cost = 4,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult, card.ability.extra.mult_gain } }
end,
calculate = function(self, card, context)
if context.joker_main and next(context.poker_hands['High Card']) and not context.blueprint then
mult_mod = card.ability.extra.mult,
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
if swallowed == false then
ease_hands_played(1),
swallowed = true
end
end
if context.setting_blind and not (context.blueprint_card or card).getting_sliced then
swallowed = false
end
end
}```
Here's the tentative code for Sword Swallower
looking at the game's code and other mods can help teach you in what to do, epically context, there's a whole context deicated to first hand i think
🎉
i completely forgot there's a mod with several enchantments that do exactly what i'm looking for
YES I DID IT AND I FEEL LIKE A GENIUS
not without your code, you just have a syntax error somewhere
also may I suggest context.scoring_name == 'High Card', your current version is for "contains a High Card"
Found it
thanks!
so right now i don't know how to add the chips the throwing card yields, i don't even know if i can just simply put context.before becuase i think it's expecting my enchantment to be involved
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }```
Which "=" has the problem?
-- :get_id tests for the rank of the card. Other than 2-10, Jack is 11, Queen is 12, King is 13, and Ace is 14.
if context.other_card:get_id() == 10 or context.other_card:get_id() == 4 then
calculate = function(self, card, context)
if context.joker_main and next(context.poker_hands['High Card']) and not context.blueprint then
mult_mod = card.ability.extra.mult,
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
if G.GAME.current_round.hands_played == 0 then
ease_hands_played(1)
end
end
end```
what exactly does other_card refer to
idk if this is a discord moment but it looks like everything inside ur if is double indented
but i think discord is maybe formatting it funny
The card being scored.
lua ignores whitespace
so it's irrelevent besides for readability
mult_mod and message should be within a return table
would it have to be if context.joker_main and context.other_card:get_id()
idk why it indented like that
if context.individual and context.cardarea == G.play then
is fine too, straight off of the example code for Walkie Talkie 2
all the same to luajit
but if i try and use only context.other_card:get_id() then it crashes when i play/discard
The "if combo == 3" isn't working, even though I am playing three or more cards that meet the condition.
calculate = function(self, card, context)
local combo = 0
if context.individual and context.cardarea == G.play then
if context.other_card:get_id() == 3 or context.other_card:get_id() == 6 or context.other_card:get_id() == 9 or context.other_card:get_id() == 12 then
combo = combo + 1
if combo == 3 then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
return {
message = 'Upgraded!',
colour = G.C.RED,
card = card
}
end
return {
chips = card.ability.extra.chips,
mult = card.ability.extra.mult,
card = context.other_card
}
end
end
end
Combo gets reset on every call to the function
Nooooooooooo...
Made the combo thing work, but how do I make the first return table not "eat" the second one?
returning ends a function I think, not just a loop or if statement
so i'm not sure the second one is even seen
might be mistaken though
Thought so. How do I put two "messages" in one return table?
Like, I want to put a copy of the second one in the first.
not sure, gonna have to wait for someone who isn't just talking out of their ass like me and actually codes, lol
you can't, you'd have to use SMODS.eval_this (or card_eval_status_text directly) to display multiple messages
Tinkered with eval_this and it works! Thanks!
btw @wintry solar, I was just thinking, would it be nice if the cycle_update func was always defined?
aka integrated into steamodded, there's even existing code in steamodded that I think would be able to use it
G.FUNCS.cycle_update = function(args)
args = args or {}
if args.cycle_config and args.cycle_config.ref_table and args.cycle_config.ref_value then
args.cycle_config.ref_table[args.cycle_config.ref_value] = args.to_key
end
end
I already have it copied in my mod in case galdur isnt loaded
dont you need a then before the return .. end?
so:
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.plustone then
return{
--message stuff
}
end```
no
it's not an if statement, it's just... a statement
because card IDs usually aren't negative
ah, fair enough
you're effectively checking for stone cards
thats what they are doing 
Yeah I can see this being something that would be nice to have implemented as standard
yeah, exactly what im doing
when i play a stone card the message isnt displayed
upgrades the card tho
tested it without the ids condition as well so its not the fact that its a stone card
,,,hm
from a first glance, the message can't just directly be the string, if i remember correctly
it has to be equal to a localize() function
try message = localize('k_upgrade_ex')
also, you dont need to check if it's id is negative to see if it's a stone card, context.other_card.ability.name == "Stone Card" in the if statement would do the same thing
no, that also just returns a string
oh I see, it's weirdness with individual context then
yeah i thought so but for the rest of the functionality of the card individual is needed
this is preferred because other rankless/suitless enhancements may exist
otherwise the upgrade itself is never applied
yeah no it's possible, it just works differently
yea
im guessing using individual it just never really gets told when to display so it just doesnt
return {
extra = { focus = card, message = 'Upgrade!' },
card = card,
colour = G.C.CHIPS,
}
,,,i remember having this problem before, but i dont know exactly what i did to fix it
no, return values from individual are just processed differently to everything else for some reason
yeah maybe try that-
it's a
ism
looks about right
ahhh
ill try it later thanks ^^
it's often useful to think about if there's a vanilla joker that does something similar
yeah i was trying to the closest one i could think of was steel
in this case, the first one I thought of was wee joker
the first i thought of was hiker
oh you're right xd
but yeah all similar
you guys got closer than me then aha
yeah hiker also has the same trigger condition, works just as well
idk why i didnt think of hiker tbh,,
tbh probably more useful to think of similar mod jokers
already being in smod format and all
i looked at steel and walkie talkie 😭
yea true
my main reference for vanilla jokers is just the logic behind them
how the context returns are handled is so strange to say it's a one man production
why are they all so different
There's also lucky cat and 8 ball that work the same way, but that's actually it
4/150 isn't great odds ngl
xd
yeahhh
I feel like thunk's style was evolving as he went
and who wants to recode already working shit?
Card:calculate_joker is a mess in and of itself too, it would have really used some refactoring
when i was thinking of similar modded jokers the first one that came to mind is the menu card from SDMs stuff(?)
good resource for modded objects
and vanillia ones too technically
there;s my site too made with the same exporter, but I think elbe downloaded my whole modpack, so he has everything I do and lots more
but yeah you can just find something there and then look up its code
iconic icon - and its just not the card i was looking at xd
saving that aha
cant find the card i was thinking of maybe its in cryptid or something
m
all the cryptid jokers are there too
what sort of thing are you looking for exactly, I have a fairly decent memory for mod jokers,
I could probably dig something up
Rate limit (
hmm?
Also images for blinds does not work
yeah that's athe exporter just not working right yet
elbe has been busy porting basically the entire backlog of old balatro mods to work on 1.0, lol
@dense jasper
I helped concept the exporter in the beggining, but it's all elbe's thing
https://github.com/lshtech/CardExporter
if you wanna see or contribute to the code, or use it yourself
yes the images aren't all working yet
useage is it adds a menu to the pause menu only if you're in a run (due to how it gets the card objects) to export all of the objects in your game to a website like that
export location is %appdata%/balatro/output
and you can just put everything it spits there right on a github.io or any other free hosting site
#1292331049883533322 here's the defacto thread for it
as I said, I helped with concepting in the begging and started trying to code, but elbe had the same idea earlier and beat me to it, so we just went with his version
can't take much credit, except for figuring out how to get the soul_pos sprites to overlay on the main sprites
it like added mult or something when you play either bonus or wild cards
it could be jens almanac or something??
i normally play with like sdms stuff and jens whole collection
there's these 2
not the same, but seem to have some of the same utility
seems to be a similar idea
this too
what's the idea of the joker?
oh yeah, its similar
could use it for reference
still wonder why enhancements cant have retriggers 😭
true
i might change copper card enhancement to give mult or smth, its a little less unique but it works 
you could probably implement it yourself but it would be a hassle
yea
i would have to use lovely, and nuh
what was it gonna be?
if you plat copper cards next to eachother, they’d all retrigger
cool idea but definitely needs lovely xd
well to code around retriggers apperently needing lovely, just add the effects of the adjecent cards
would accomplish the same thing
pretty sure checking for adjecency is part of smodded
might be a bit clunky i think he just wants to use xmult lol
well multiply then, lol, still should be simple lua math
from the little I understand
I don't think that needs lovely
yea i guess you could probably artificially multiply the mult
it's a fiarly straightforward check actually
i think xmult might be possible with steamodded but according to him he cant use retriggers based on enhancements
yea didnt think it would be aha
it doesn't need lovely though
i think he was saying he would need lovely if he wanted to manually implement an easier way to do it
it's not difficult though
im guessing its more long winded than difficult
I'm pretty sure you just have to set effect.seals.repetitions = X
and it should work
key = 'flowerTrick',
loc_txt = {
name = 'Flower Trick',
text = {
"Gains Mult whenever you",
"gain {C:money}${} from {C:attention}Interest",
"{C:inactive}(Currently {C:mult}+#1#{C:inactive} Mult)"
}
},
config = { extra = { mult = 0} },
rarity = 2,
atlas = 'MASS',
pos = { x = 3, y = 0 },
cost = 6,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult} }
end,
calculate = function(self, card, context)
-- end of round: gain mult based off of interest
if context.end_of_round and not context.blueprint then
card.ability.extra.mult = card.ability.extra.mult + G.GAME.interest_amount
return {
message = 'Upgraded!',
colour = G.C.RED,
card = card
}
end
if context.joker_main then
return {
mult_mod = card.ability.extra.mult,
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
}
end
end
}```
What is happening and how do I make this card work as intended?
what's at that line of state events?
--Check for hand doubling
--From Red seal
local eval = eval_card(G.hand.cards[i], {end_of_round = true,cardarea = G.hand, repetition = true, repetition_only = true})
if next(eval) and (next(effects[1]) or #effects > 1) then
for h = 1, eval.seals.repetitions do
reps[#reps+1] = eval
end
end
--from Jokers
for j=1, #G.jokers.cards do
--calculate the joker effects
local eval = eval_card(G.jokers.cards[j], {cardarea = G.hand, other_card = G.hand.cards[i], repetition = true, end_of_round = true, card_effects = effects})
if next(eval) then
for h = 1, eval.jokers.repetitions do
reps[#reps+1] = eval
end
end
end
end```
it's this part
end_of_round has multiple contexts that use it
need check not context.repetition and not context.individual i think
I swapped out a SMODS.eval_this for the return table because the Joker procced too much-
That must be it, thank you!
that should also fix it procing too much from the individual calls
if context.repetition_only and context.cardarea == G.play then
effect.seals = {
repetitions = 6,
card = card,
message = localize('k_again_ex')
}
end
something like this would work, it has no compatability with retriggering from seals right now, but I'll get that patched into smods at somepoint
When I finished a round with 10$, I only got +1 Mult. Any way to fix this?
Anyone know how I can make this not give Canio double the bonus when applied to a face card and Sock&Buskin is present 😐
SMODS.Seal({
name = "black_seal",
key = "black_seal",
badge_colour = HEX("000000"),
config = { },
loc_txt = {
label = 'Black Seal',
name = 'Black Seal',
text = {
"Destroy this card",
"after it is scored"
}
},
loc_vars = function(self, info_queue)
return { vars = { } }
end,
atlas = "seals",
pos = {x=0, y=0},
calculate = function(self, card, context)
if not context.repetition and not context.repetition_only and context.cardarea == G.play then
local destroyed_cards = {}
table.insert(destroyed_cards, card)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.2,
func = function()
card:start_dissolve(nil, true)
return true
end
}))
delay(0.3)
for i = 1, #G.jokers.cards do
G.jokers.cards[i]:calculate_joker({remove_playing_cards = true, removed = destroyed_cards})
end
end
end,
})
I presume you need to find where earned interest is and multiply it by the added mult, if that's what you're going for
Here, I am directly grabbing the interest amount variable, the same one used by To The Moon
I think that's the interest per 5 dollars
not the earned interest
pikachu funnily enough is the one joker I see that uses earned interest at all
though you could calculate it yourself, if you can get the money before cashout
Oops. Will take a look at Pikachu though,
isn't this just "always earn max interest"
just that? that’d make the enhancements retrigger?
yeah, for now
Nabbed the code bit and now Flower Trick works as intended, thanks!
pffft, why use the built in option cycle when you can build your own
having this cycle in smods would be cool..
looks nice
Imagine make a mod which has a collection of well-designed components
i just noticed the portrait for it is daddy pig thats so hard
whats the syntax for using talismans xchips on a joker in my mod
What is a center? What's "self"? What's the difference between center, self and card? These questions keep me up at night
is there a way to disable certain jokers if you dont have a specific dependant mod installed
Yeah. You can put the joker on a separate file from your main mod file and load the file under an if statement.
Use (SMODS.Mods['modkey'] or {}).can_load as a condition for the if statement
modkey is the mod ID
there's also a dependencies argument
A center is the terminology thunk used for an object, I imagine it’s because it’s the ‘center’ or the card rather than the front or back. In most cases in vanilla code, self refers to the individual card object, however in mods, it often refers to the original center definition, and card is used to refer to the card instead
though that's only useful if the only thing you're doing is creating a SMODS object
I see
I find it easier to understand if there’s some context provided, what is it you’re doing that’s getting you confused?
I'm still trying to hide a joker in the collection. I found G.P_CENTER_POOLS in the game files and discovered I could just say G.P_CENTER_POOLS[index] = nil to make the (index)th joker not appear in the collection. But then I thought this could have other unwanted consequences and wanted to better understand what's this center that i'm dealing with here
Also this only works with vanilla jokers, so from index = 1 to 150
You can overwrite the inject function on the SMODS.Joker object to not insert it in the center pools, though I imagine this will also have unintended consequences during a game
Where can I find the inject funtion?
I don’t recommend this though, I’m pretty sure your joker would never show up in game either if you do this
Unless you force spawn it
That's actually precisely what I'm doing. I had disabled the spawn with in_pool = false. It's an upgraded version of a Joker in my pack, or a "DX Joker", if you will, that doesn't spawn, but is given if you choose a certain deck or deck/sleeve combo
If the joker still works after being given, it's all good
I believe it should do
I think you can actually do something like this for the inject then,
inject = function(self)
SMODS.Joker.super.inject(self)
G.P_CENTER_POOLS.Joker[#G.P_CENTER_POOLS.Joker] = nil
end
Will try it rn. Thanks a lot
im getting started with modding and trying to change the text in the "en-us.lua" file to try something simple, but the text changes never seem to appear in game and im a bit confused as how to fix that? i tried looking up a solution but i couldnt really find anything on editing the text in balatro,
Worked flawlessly!
Are you editing the en-us.lua file inside the Balatro.exe file?
i am, opened it with 7zip
What are you trying to change?
Works here. Just saving the file in the text editor won't do. You gotta save the file and replace the original en-us.lua file inside the zip with the modified one.
^ that or use a proper steamodded mod
OOH shoot i see, thanks for the help! :0
That's certainly better
Modifying the .exe file could break things
depends on the specific program you use to look inside the exe
Any thoughts here 🥺
#💻・modding-dev message
check for the retrigger context
or, the better way is to make it happen after the hand is scored
the card should set a variable when getting destroyed (e.g. card.destroyed), you could check for that
Give it a value when it’s been destroyed once and check if it’s present or not
cryptid probably has a couple of examples
oh wait canio is doubling it because the card itself triggers jokers when it's destroyed
oh you'd be very right thanks!
so you don't need to iterate through G.jokers and calculate them
not that i like looking through cryptids code,, joker config is a bit all over the place
yeah it's a lot of code 😅
oh wait, you're right... can't you return something that destroys the card anyway? 🤔
You do because this isn’t a joker
also they seperated the jokers config like cost and stuff with the context and calculate sections
It just gets called twice because of sick and buskin retriggering
if you're so sure then check card:start_dissolve yourself 🤷♂️
Oh you're right. He didn't get the bonus before when I didn't 🤔 but that was before I had the dissolve in the function
already checks for retriggers tho
Wait no. He doesn't level up without the calculate_jokers call, he was just already at 2x -__-
There’s nothing in start dissolve
That’s a patch I’ve seen people do to try and get a destroyed context
the repetition check isn't checking for retriggers, that context is for returning repetitions to be carried out
you just need to add something like card.calculated = true at the end and then and and not card.calculated in your if statement
card destruction is a bit wonky rn
This did the trick. Thanks
I suppose I've been wary of modifying the values sent to the calculate functions
using calculated there will 100% cause an incompat with something
yea i went with
if not context.repetition and not context.repetition_only and context.cardarea == G.play and not card.dogmod_blackseal_calculated then
local destroyed_cards = {}
table.insert(destroyed_cards, card)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.2,
func = function()
card:start_dissolve(nil, true)
return true
end
}))
for i = 1, #G.jokers.cards do
G.jokers.cards[i]:calculate_joker({remove_playing_cards = true, removed = destroyed_cards})
end
card.dogmod_blackseal_calculated = true
end
🔥
Now to figure out the wonky animations 😄
Or the timing of them
Is there any information about the different triggers you can send to add_event? I'm not sure what 'after' actually means. It doesn't seem to behave different from sending 'before' in this context
#💻・modding-dev message thats just cus the timing is low
what isn't working as intended?
i fixed it its cus i was loading a save after modifying stuff so it went nuh uh
Xchip_mod = (value)
you have to make it use the chip colour though if you want that
it doesn't do that automatically
how do i get values from the current config?
is it just current_mod.config
edited the message to include it
that should be pinned imo
yeah it's basically SMODS.current_mod.config, but you need to make sure SMODS.current_mod is saved to a local variable because it will change once your mod has loaded
I might write it up as a markdown doc so it can be added to the steamodded wiki
I have one started already
Ah, perfect! Let me know if you need any help/feedback for it
it's very bare bones at the moment, I started it alongside this one for general UI docs
but then I stopped 🤣
I think the UI work is finished
Thats nice
Looks great
oooo
okay how do i update the label of a button
i'm changing the children[1].config.text but it's not updating visually
can you send the code?
function G.FUNCS.bind_key(e)
print("Current label:", e.children[1].config.text)
e.children[1].config.text = "..."
i found a reference to G.HUD:recalculate() earlier, do i need to call that?
wait
do e.children[1]:recalculate()
oh maybe e.UIBox:recalculate()
I've literally deleted my text update today to use dynatext instead
got it
e.children[1].UIBox:recalculate()
i should use dynatext but too lazy to figure out how it works
how does the game make a ui element only show when hovering?
trying to put an on-hover tooltip on a button
theres a function to generate them when hovered
?
iirc function Card:generate_UIBox_ability_table()
oh
Card has a hover prop that might be inherited by it's earlier parts
probably can just do the same thing as a card when hovered
there are tooltip values on most things
tooltip- adds a simple tooltip to your element that is shown on hover
- `tooltip = {title = "", text = {"", ""}, filler}detailed_tooltip- adds a detailed tooltip, like the ones frominfo_queueto your element that is shown on hover
can someone put me on the right lines as to what the context would be for creating blueprint-like jokers
basically just the contexts for copying abilities of other jokers
^^
You just don't check the context
I'm on mobile rn so I can't pull up the code but basically you get the other joker and you can check ig its blueprintabke and then call its calculate function
how do i add my own localization entries (for nothing in particular, juts some UI eleements)?
Hold on I had math guy recite some code for this for me earlier
yea i thought it was going to be something like this
Or you can use localization files (idk how they work)
arent modicons 34x34?
There whatever you specify them as
There is a code example for a half joker like?
is there any commands for testing modded jokers or do i have to just find them randomly in a run?
thanks!
nodes = {{
n = G.UIT.C,
config = {
align = "cm", colour = G.C.RED,
},
nodes = {{
n = G.UIT.T,
config = {
text = localize("vi_keybind_restart"),
colour = G.C.UI.TEXT_LIGHT,
shadow = true
}
}}
}}
why is the text not showing here
vi_keybind_restart is not empty
where did you define it?
localizations/default.lua .misc.dictionary
here's thefull thing:
mod.config_tab = function()
return {
n=G.UIT.ROOT,
config = {align = "cm", padding = 0.05, r = 0.1, minw=8, minh=6, colour = G.C.BLACK},
nodes = {
{
n = G.UIT.R,
config = {
align = "cm", colour = G.C.UI.CLEAR,
},
nodes = {{
n = G.UIT.C,
config = {
align = "cm", colour = G.C.RED,
},
nodes = {{
n = G.UIT.T,
config = {
text = localize("vi_keybind_restart"),
colour = G.C.UI.TEXT_LIGHT,
shadow = true
}
}}
}}
},
-- there's a ton after this, not pasting it all
I don't think so, no
huh, it looks like it does default to 1 but I've always experienced it being required
if context.before and next(context.poker_hands['Straight_Flush']) and not context.blueprint then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_gain
return {
message = "Charge!",
card = card
}
end
Is a straight flush referred to as Straight_Flush? It crashed on the next function
it's "Straight Flush" (no _ ) i think
That Worked, Thanks
hey chat
so will doing like
local func = Card.function_name
function Card:function_name()
-- my code
func(self)
end
break lovely patches
if I wanna iterate through cards in a pack how do I do that
I tried for k,v in ipairs(G.pack_cards) do and for k,v in ipairs(pack_cards) do and both gave the error table expected, got nil so i'm a little perplexed and would like a second opinion
how could it not exist yet if i'm checking it during the create card function in the code for a booster pack
when does it exist if not during that part specifically
that's where it puts a card into G.pack_cards
idk then
i'll do it the long way i guess
What are you trying to do exactly?
Maybe you can find something similar on else's site to reference
have you considered stopping
yes
wasn't worth it
what did I do that caused this
it's probably because of find_joker ig
gotta use smods find card
changing to that did not fix the issue uhhh
😭
https://discord.com/channels/1116389027176787968/1298849744864677948
can i get some feedback?
How do I give a Deck a passive "counter" that does something and resets when it reaches a specific number?
Do the same variable things that work on Jokers work on Decks too?
Might be wiser (and easier) to put the effect on a Joker...
The funniest thing has occured. Due to me forgetting to set the atlas for Alchemical Deck's sprite, its sprite was set... to the template for Gold cards.
Noooooooooooo... I tried to run Alchemical Deck and this happened.
Here's the code. I'm trying to spawn a specific card named Rebirth at the start of the game.
SMODS.Back{
name = "Alchemical Deck",
key = "alchemical",
pos = {x = 6, y = 0},
config = {},
atlas = 'MASS',
loc_txt = {
name = "Alchemical Deck",
text ={
"Start with an {C:tarot}Eternal {C:attention}Rebirth",
"{C:inactive}(Every time you sell {C:attention}2{C:inactive} Jokers,",
"{C:inactive}gain a {C:black}Negative Tag{C:inactive})"
},
},
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
if G.jokers then
local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "rebirth")
card:set_eternal(true)
card:add_to_deck()
card:start_materialize()
G.jokers:emplace(card)
return true
end
end
}))
end
}```
What's wrong here?
Also getting this error when trying to test just Rebirth.
Code here.
SMODS.Joker {
key = 'rebirth',
loc_txt = {
name = 'Rebirth',
text = {
"Every time you sell {C:attention}2{} Jokers,",
"gain a {C:black}Negative Tag",
"{C:inactive}(Currently {C:attention}+#1#{C:inactive}/2 Jokers sold)"
}
},
config = { extra = { counter = 0} },
rarity = 3,
atlas = 'MASS',
pos = { x = 5, y = 0 },
cost = 8,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.counter} }
end,
calculate = function(self, card, context)
-- two jokers sold -> one negative tag
if context.selling_card and context.card.ability.set == "Joker" then
card.ability.extra.counter = card.ability.extra.counter + 1
SMODS.eval_this(card, {message = card.ability.extra.counter .. '/2',
colour = G.C.MONEY})
-- create Negative tag!
if card.ability.extra.counter == 2 then
SMODS.eval_this(card, {message = 'Negative!',
colour = G.C.BLACK})
add_tag("Negative Tag")
card.ability.extra.counter = 0
end
end
end
}```
That's Library of Letourneau's pfp
there is documentation about shaders of card editions?
Some brief docs on the edition page, yes
Any help with these things?
Fixed it! Changed the target key for the card to this.
It's alive!
love the cardart
YK that game called skyjo
looks like one of those games Mattel makes to try to recapture the magic of Uno
Oh I love this game
huh, guess it's actually an indie thing
cryptid might have those?
No they have suit decks
I thought they also had edition decks and stuff, so it seemed possible
suit decks are also in something else now (forgot what) which is nice
No hey also have enhancement decks and edition decks
But not rank decks
fair
so yeah it is a good idea
though might be better to be a single configurable deck, which I think @wintry solar is cooking something for iirc
yea theres a six deck in crimson collection
Yeah that's where
which is a pretty unique idea surprisingly thats the only place ive seen a rank deck
compared to suit decks i think cryptid implements
tbh im surprised cryptid doesnt have rank decks yet aha
Yeah
new deck where you get every single possible combination of suit/rank/enhancement/edition/etc at the start of the game
only like 6000 ish cards from my approximations
if only the game wouldn't be running at about seconds per frame
if not minutes
it's not so bad when it's in deck
idk if it's modded optimizations but ive seen jen do some runs with that many cards in deck and it runs at a decent framerate
very fair
deck
but it probably won't keep running that good. in my experience, if there'a much oif anything going on in terms of card creation and deletion the game comes to a crawl at practically any deck size
hmm?
very fair deck
lmao
Does anyone have experience extending the ability of a vanilla jimbo? Most mods have the ability be a table for their jokers, but e.g. Baron only uses a single scalar value for its xmult as far as I can tell. Would you have to patch the game in order to take_ownership and expand upon a vanilla jimmy like Baron?
You can just take_ownership and then treat it as any modded joker
Internal brain cooking right now, but it’s something I’ve got a few ideas for, yeah
yeah I wasn't trying to say it was more than a concept currently
thought for a sec that "internal brain cooking" meant you had a high-ass fever, lmfaooo
Hahaha nooooo
pffft
I’m going to finish cooking textures first though, it’s getting closer
local func = Card.draw
function Card:draw()
func(self)
-- my code
end
there a bettwe way to do this? bc to me it feels like the cards are drawing twice
What are you trying to do?
Is there any way to make my custom flame shader actually work?
how? ;-;
how would i know you provided 0 details
if i changed some values from the original shader, how could i load it
you have to load it as a seperate shader, I know that much
idk how to apply it in context though
probably takes a lovely patch
you can probably load it akin to replacing base game atlases
how do you mean that?
i think i can see how the vortex is done right?
compare with the normal flame shader
cuz those 2 are the only ones (as far as i know) that are shaders that AREN"T on cards
someone who can help me with modding balatro? i cant play mods cause this
if can in spanish... betther
better*
use steamodded 1.0.0 instead of 0.9.8
okei, i try it
Does anyone know why the playing card sprite sheet is called "8bitcards"? Makes it sound like an external asset
or that non-pixel art playing cards were considered
I think the early version of the playing cards in Balatro was lower-res
And looked a bit like this https://the8bitdeck.com/
Or looked 8 bits like this ba dum tss
how do you debuff cards
like make a joker
debuff certain cards
when gotten
apparently this is a thing in the balatro code
works for me
oop
Works fine for me I guess
engine/ui.lua:693: attempt to index field 'colour' (a nil value)
so tired of seeing this Fucking error message
Isn't this usually tied to incorrect UIElement table depth?
JPFPSDJFLSKDFHS
Can anyone tell why this is crashing with
"functions/state_events.lua:998: attempt to perform arithmetic on field 'x_mult' (a table value)"
is it because it's trying to use the vanilla calculate function, where "config.extra" is just a number, whereas it's a table here..?
"Hello Baron" is never printed..
SMODS.Joker:take_ownership('baron', {
config = {
extra = {
tier = 1,
maxTier = 2,
canRankUp = true,
multmult = 1.5
}
},
loc_vars = function (self, info_queue, card)
return {key = "j_dogmod_baron_t" .. card.ability.extra.tier, vars = {card.ability.extra.multmult}}
end,
calculate = function (self, card, context)
print("Hello Baron")
if context.individual and context.cardarea == G.play and context.other_card:get_id() == 13 then
if context.other_card.debuff then
return {
message = localize('k_debuffed'),
colour = G.C.RED,
card = self,
}
else
return {
x_mult = 100, -- just as an example
card = self
}
end
end
end
})
chat is this real
that shortcircuits right
It's a bash command and wine wouldn't let it through. I don't think there's any way a shell that could understand it will see it
also balatro wouldbt be being ran with root permissions
also true
I meant that most programming languages don't evaluate the second operand if not needed
true or ... doesn't need to have the second part evaluated, because it will always be true
false and ... doesn't need to have the second part evaluated, because it will always be false
Oh yeah that'd just return true I think
Both
andandoruse short-cut evaluation, that is, they evaluate their second operand only when necessary.
Yup, Lua does as well
short circuiting is awesome
my brain does it all the time
i won the 50/50, i'm coming back soon :P more art for OS incoming!
yay!!
not like this would even do anything if it was ran
you're not specifying what to remove
only how to remove
Also true
rm rf with no argument deletes everything i believe
🤔
ugh, why do seals treat their atlas so differently to everything else
you mean the sprites taking up a full card space?
no the way they're referenced
they're hard coded in a different table and the seal objects themselves have no reference to the atlas or the position
oh I see
so whilst all your seal data is in G.P_SEALS or G.P_CENTER_POOLS.Seal, the images are saved in G.shared_seals
fun
but I think I've got it all working now :d
localization and badges? 👀
:O
judgement but seal
That's busted I think
Tbh it's no worse than Expansion Pack really
Wdym
The joker that makes a random modded joker at the start of a blind. Sure, it'll fill your joker slots with garbage sooner for some free econ, but that's not too busted
Maybe just only make it be made from a spectral and not nat spawn in standard packs, if it needs any adjustment at all
I presume the "must have room" is implied
should still add it, even if implied
just wondering, this mod isn't actually released yet right?
(the texture pack priority system)
it is if you have a sledgehammer and a screwdriver
I'll take that as a no then
i have no clue tbh
forgot to say that in the desc mb (yes it does need room)
(Must not have room)
omg i fucking love the idea of using jokers to enable/disable stuff-
anyone know why the shader thing needs it's name as a varible/
Not yet, it’s getting close though, I need to go through the other sprites I haven’t tested yet to ensure they’re working, then write up some docs on how to use it properly
Something in glsl requires variables that are declared to be used at least once, and the game uses the shader name to pass in a time variable (and something else I don’t remember off the top of my head)
Yeah
Luckily I found smods has a paych that lets it use a different name than the shader name
So I kinda just guess what the name of the variabke is and put it there
Yeah, ejwu sorted that one out
I think this shojkd cover most cases https://github.com/WilsontheWolf/DebugPlus/blob/dev/watcher.lua#L82
Still leads to the pointless if name.g > 0 || name.g < 0 part in the shader code
Why does it even need that?
Like could we just go and be like if smods shader don't pass that variable
Or does it cause some problems then?
It’s useful for effects that adapt over time
You think there would be a consistanntly named variable for time
Oh wait there is
Maybe it wasn’t time
I don’t remember what it passes 😂
Maybe it was card rotation?
Idk but why does it have to be named after the shader?

self.ARGS.send_to_shader[1] = math.min(self.VT.r*3, 1) + G.TIMERS.REAL/(28) + (self.juice and self.juice.r*20 or 0) + self.tilt_var.amt
self.ARGS.send_to_shader[2] = G.TIMERS.REAL
I found them!
Confusingly, the time value isn’t actually a time value G.SHADERS[_shader or 'dissolve']:send("time",123.33412*(_draw_major.ID/1.14212 or 12.5123152)%3000)
@languid mirage iirc you made something where the (combo) flame were on the played cards. (i think u send a gif/video of it) could i please know how u did that?
shader is drawn on a dummy UI object that is attached to the card so first you need to create that, then you need to draw shader over it which you can hook within card:draw
both those things you can find if you look at where shader is drawn
ooh so you mean make a invissable box and draw the shader on that
yes
wow thanks!
i tought something about this cuz i saw the code for the boxes in the hand menu (the chip x mult boxes)
and saw it was like a function
yeah iirc it adds draw callback which draws the shader on UI element
Actually the mult/chip boxes are draws separately, as they are on top of the flames
hmm
someone can help me?
i try to install the modder and i cant work it, i play balatro app and appears in streammod 0.9.8 insead of the 1.0.0
u sure u got 1.0.0 instead of 0.9.8?
i do all but in the game appear this
The release is deprecated
https://github.com/Steamopollys/Steamodded/archive/refs/heads/main.zip this is the newest version
when you download steamodded you press the green button and click on download zip
delete the old steamodded folder and replace with the newest
the old folder where is?
Username/appdata/roaming/balatro/mods
Just do windows key + r and write %appdata%/balatro
okei, im there, in there, it's only the mods carpet
i delete de carpet "mods", i create a new one and i put in the carpet of steamodded
Hello, I wanted to start working on trying to update a mod for personal use that seems to have been abandoned, but I’m struggling to find anything on the GUI documentation for SMODS. Does anyone have any tips on how to resolve issues with the function SMODS.RegisterUIElement on the current alpha? Or any other information on GUI stuff with this build? Thanks in advance
What exactly are you trying to do??
Trying to resolve issues with the Deck Creator mod which appears to be built on SMODS 0.9.8 API which has a lot of deprecated features. I was trying to find out if it is possible to replace most of the existing functions with more modern iterations, or if it will need a full rewrite.
From a brief look at the code, it’ll probably need a complete rewrite to make sure it’s compatible with other mods
Hmm, unfortunate. Do you have any advice on where to start with a rewrite like that? Even if the original mod never gets updated I would like to try helping keep it available for modern Balatro
I’d try and get the base mod functional in terms of custom decks before worrying about the ui
what does the function juice_up() do
it does the shake thing for when a joker activates
also, is there a way to make a joker unsellable naturally? not like, an eternal tag or smth
i already got my description of make card juice jump vibrate boingong shake
nah i did G.hand_text_area.blind_chips:juice_up() G.hand_text_area.game_chips:juice_up()
wasnt to a card
😭 its done on jokers
it works on other things too

you can make almost anything juice up
so im trying to make some code for a joker that removes editions from another specific joker
and it copies the joker
but i cant figure out how to strip every edition from a joker
calculate = function(self, card, context)
if context.before and not (context.blueprint_card or self).getting_sliced then
for i = 1, #G.jokers.cards do
if
G.jokers.cards[i].ability.name == "Gerald" and G.jokers.cards[i].editon and G.jokers.cards[i].edition.negative == false
then
local chjoker = G.jokers.cards[i]
local card = copy_card(chjoker, nil, nil, nil, chjoker.edition and [here is where i need any edition])
end
end
end
end
}
you might be overthinking this? jokers can only have one edition
i think were saying diff thing
i meant remove any edition
might have not been clear
find modded jokers that manipulate editions, it could help you out
heres a big index of a bunch of modded jokers
is there a function to update the tooltip of a joker?
oh wait is it literally just card = card
it wont update ):
you can just do card:set_edition() and it'll strip it
can someone help it doesnt update the tooltip when the variable is modified
if context.blind_skipped and not context.blueprint then
card.ability.extra.h_size = card.ability.extra.h_size + card.ability.extra.increase
return {
message = localize("k_upgrade_ex"),
}
end
end```
can someone more well-versed in lovely help me out with how to get it to parse this line that i want to change in state_events that has both types of quote marks in it?
play_area_status_text("Not Allowed!")--localize('k_not_allowed_ex'), true)
I believe using ''' will work
didnt work
can you send your code?
well i edited it a bit but here
calculate = function(self, card, context)
if context.ending_shop then
for i = 1, #G.jokers.cards do
if G.jokers.cards[i].ability.name == "Gerald" and G.jokers.cards[i].editon and G.jokers.cards[i].edition.negative == false then
G.E_MANAGER:add_event(Event({
func = function()
local card = G.jokers.cards[i]
card:set_edition()
local card2 = copy_card(card)
card2:add_to_deck()
G.jokers:emplace(card2)
return true
end
}))
end
end
end
end
}
and what happens?
try using SMODS.find_card instead of the ability name check
Im trying to make it so this calls when a gold card is scored. How would i check if it is gold?
if context.other_card:get_id()==10 then --Check if it is gold instead
card.ability.extra.money = card.ability.extra.money + card.ability.extra.money_gain
return {
message = "Harvest!",
card = card
}
end
?
dont worry got it to work
just wondered if G.GAME.skips was valid for like getting the amount of blind skips
it was
like as in if SMODS.find_card == "Gerald" and G.jokers.cards[i].editon and G.jokers.cards[i].edition.negative == false then? idk how to do that lol
Look it up in the smods code base
is there a way to allow stone cards to show suits?
target = "card.lua"
pattern = '''self.ability.effect ~= 'Stone Card''''
position = "at"
payload = '''self.ability.effect ~= 'UNUSED Card''''
I cant seem to get this lovely script to even find self.ability.effect ~= 'Stone Card'
switching to patches.regex worked
the whole thing works now yippie
this'll make a joker that does nothing except be bought and sold, right? i just wanna be sure im doing this right before i commit the change
it should probably have a calculate function
idk if thats required for jokers
lemme check
i suggest testing it out by spawning it in via debug
ok well first off i forgot to make an atlas for it's sprite, im dumb
i genuinely cant find anything ;-;
does anyone here know how SMODS.find_card works? i cant find anything
It's not obligatory
Is there some way to enable/disable voucher availability in pool?
use in_pool
it works, my boyo's in the game even if he does nothing yet
It is not required just almost always used
Jokers typically /are/ a bit more useful if they do something
:p
yea but you can also use other functions to give them effects :3
a lot of mine use add_to_deck/remove_from_deck
by a lot i mean like 3
😭
Lol very fair
engine/sprite.lua:11: attempt to index field 'atlas' (a nil value)``` bro what is causing this error
clearly something with my atlases but idk what
this is for loading my joker configs and the first joker art atlas
SMODS.Atlas ({
key = '1up',
path = "1up.png",
px = 71,
py = 95
}):register()```
load_file is on line 12 so I think that's the issue but I don't know what's wrong with it
The order?
Doesn't jokers.lua use that atlas?
AFAIK you need to declare the atlases before they're used, and load_file basically just pastes or at that position
Might be mistaken
what does objects/jokers.lua look like?
(also, I don't think you need :register() anymore in 1.0.0+?)
SMODS.Back{
name = "Unstable Deck",
key = "MASS_unstable",
pos = {x = 6, y = 1},
config = {discards = -1},
atlas = 'MASS',
loc_txt = {
name = "Unstable Deck",
text ={
"All hands start at {C:attention}LVL 2",
"{C:mult}-#1#{} Discard"
},
},
apply = function()
G.GAME.joker_buffer = G.GAME.joker_buffer + 1
G.E_MANAGER:add_event(Event(
{trigger = 'after', delay = 0.8, func = function()
-- switch G.jokers for appropriate start of game effect?
for k, v in pairs(G.GAME.hands) do
level_up_hand(self, k, true, 2)
end
end
}))
end
loc_vars = function(self)
return { vars = { self.config.discards }}
end
}```
Trying to give a deck two functions and it's not working at all.
I added a comma (end,) and it booted!
It works.
ayyy nice
Less discards (2 at base, 1 on higher stakes) but it's easier to pivot and just play whatever hands come.
siiiiiiiiiiiiiiigh
really getting sick of how difficult it is to figure out how to override methods now
or if it's even possible to override certain methods, given how steamodded changes them
every SMODS.Joker{}
oh yea oops im stupid
it was 6am i blame that
nevermind that just didnt fix it
i moved the load_file to after the atlases and it still breaks
same error
you mean patch?
it is possible to patch steamodded files, but you have to use latest lovely version for that (and people who use your mod would need it too)
yeah, what i want to do is override the straight detection method
is it something not worthy of a PR?
PR?
pull request
trying to figure out how to add the capability to loop in straights
anyways if you want to patch steamodded function you have to use this format
#1209564621644505158 message
filename would be core/overrides.lua iirc
key = '1up',
path = "1up.png",
px = 71,
py = 95
}):register()
SMODS.Atlas ({
key = 'adollar',
path = "adollar.png",
px = 71,
py = 95
}):register()
SMODS.Atlas ({
key = 'bloodofthemartyr',
path = "bloodofthemartyr.png",
px = 71,
py = 95
}):register()
SMODS.Atlas ({
key = 'bobsrottenhead',
path = "bobsrottenhead.png",
px = 71,
py = 95
}):register()```
is there anything wrong with the way i register my atlases? in game for some reason all the jokers have no image and the first one to be written as SMODS.Joker{} has the wrong image 😭
why are you doing :register
I think maybe I can be blamed for that
just doing SMODS.Atlas {} should make it work
I suggested it when they were having a different problem that ended up having an unrelated actual solution
if they're the same user I'm thinking about
what do your joker definitions look like?
SMODS.Atlas {
<your values>
}
then putting the atlas in the joker definition to be the same as the key of the atlas definition should make it use your atlas
