#💻・modding-dev
1 messages · Page 107 of 1
¯_(ツ)_/¯
Alright stupid question alert (might be a bit drunk due to christmas ( Happy Christmas btw))
Does anyone know if its possible for steamodded to load files over a path? been trying for a while know...
local path = SMODS.MODS_DIR .. SMM.config.collection.tagsplus.path
local mod = require(path)```
throws me ```module 'C:\\Users\\Shinaii\\AppData\\Roaming\\Balatro\\Mods\\SMM\\Collection\\tagsplus.lua' not found```
even tho its obviously available ...
you can't use require for that
steamodded provides a util function to do it
ohhh thats what i oversaw then
assert(SMODS.load_file('path/to/file.lua'))()
where that path is relative to your mod's root dir
Would that be fixed on the next version of steamodded?
I'll check if I need to add it or if the docs are wrong/out of date
if it's not in, I shall add it
Blinds 100% support keys in loc vars
not sure why that is, must be an oversight
Did I maybe make it work for myself?
yt m6m6t7 mjr5vu4fedf nendsde de de xd erd r xer5tz w zxxc n r5ncvvx sbycjfsxdikop/[
[2:35 PM]
not sure why that is, must be an ]\
]\
hinjm kuj]
]mk hjnu\
}i
Oo'] mop'];i
Careful about that packet spill, @hardy viper. 😛
smh
I keep forgetting I can just do this in smods
gonna come back to this after i eat because i am well and truly stumped
I can't wrap my head around how deleting cards is supposed to work
Okay, how do I target scored card that has an enhancement (on each card)
god fucking dammit
dude i can't be bothered i'm going to take a break 😭
"card is nil" ok so i test to see if it's nil
nope it's not
me when the game lies to me
i cannot be bothered i take 1 hour procrastination break to play isaac (technically this is related to dev anyway)
does anyome know if theres an example of a castle-like modded Joker that uses a variable that changes suits each round, but is compatible with modded suits?
im trying to make one and i'd like to make it mod compatible and also not crash with the dynamic colors in the description
should add that to ModdedVanilla tbh
campfire eat your heart out
Sorry, that just looks like muyskerm Bob. 😅
looks like What?
i don't see it
anyways, thoughts on it?
Changing Played to scored
rare?
Him.
okay, genuinely, how does one remove a playing card from the deck after scoring, i feel stupid but for the life of me i cant figure it out
Like destroying it?
yeah
Does anyone know if this is possible?
return true during context.destroying_card
THANK YOU EREMEL
i don't see it
all 3 jokers are rare, rarity was not important to me when testing
It looks similiar enough to him for me, sorry. 😅
really cant figure this out on my own would love some help with this
I just realized i had made unintentional Synergy with Roffle, Doc, and Murphy
Murphy creates Blank Cards (enhancements) and Glass Cards (also enhancements)
Scored Enhancements are destroyed by doc giving +5 mult per, and you can use the 1 in 5 of perkeo to copy tarots to make enhancements
and if you get the rare 1/1000 chance with Murphy to get literally all the charity money, you can SKYROCKET Roffle's xmult
Lil showcase of T. Red that includes pretty much every joker rework and also one of the ways to get discards and hands back (beating the boss blind without discarding and in one hand, respectively)
new problem: my items are now not showing up on mac and i have no reason why
lmfao
wait i have an idea of why it might be happening but i doubt it
thhhattts why
ummm
what if a deck that had you buy your hands and discards........
(stupid idea)
I mean that's kind of this one
cooollll
calculate = function(self, card, context, effect)
if context.cardarea == G.play and not context.repetition and not context.debuffed then
effect.x_mult = card.ability.extra.mult
if context.destroying_card and not context.destroying_card.ability.eternal and math.random(0,1) < G.GAME.probabilities.normal/card.ability.extra.odds then
return true
end
end
end
why is this code not working, its used within an enhancement, the mult works just fine but the destroy does not
I’m not sure destroying card is sent to enhancements
how would i go about making an enhancement that destroys the card its on then
on reworking the calculate stack, we could maybe send all contexts to everything
what are the chances of being able to do that non-breakingly though...
very very carefully
well let's see how glass does it
i've been trying to find the code for glass in the source code but couldnt find it 😦
it does it during G.FUNCS.evaluate_play and looks like this
local cards_destroyed = {}
for i=1, #scoring_hand do
local destroyed = nil
--un-highlight all cards
highlight_card(scoring_hand[i],(i-0.999)/(#scoring_hand-0.998),'down')
for j = 1, #G.jokers.cards do
destroyed = G.jokers.cards[j]:calculate_joker({destroying_card = scoring_hand[i], full_hand = G.play.cards})
if destroyed then break end
end
if scoring_hand[i].ability.name == 'Glass Card' and not scoring_hand[i].debuff and pseudorandom('glass') < G.GAME.probabilities.normal/scoring_hand[i].ability.extra then
destroyed = true
end
if destroyed then
if scoring_hand[i].ability.name == 'Glass Card' then
scoring_hand[i].shattered = true
else
scoring_hand[i].destroyed = true
end
cards_destroyed[#cards_destroyed+1] = scoring_hand[i]
end
end
for j=1, #G.jokers.cards do
eval_card(G.jokers.cards[j], {cardarea = G.jokers, remove_playing_cards = true, removed = cards_destroyed})
end
i'm... not actually sure how to adapt that to a modded enhancement
i guess you could lovely patch it but i feel like there's a better way
Throw it in a table as context.SMODS, what's thw worst that could happen?
welp... time to look for a different solution to my problem, any way to apply an enhancement to a card played done by another enhancement?
that doesn't magically get me around breaking changes
Yeah, it's meant to be more of a joke, I wouldn't expect it to work at all.
Just made the addition and updated docs
also did some other things like actually document the fact that loc_vars support setting a default text scale and color and extended that support to locked stuff
You have to patch into evaluate play
Better to do it sooner rather than later, rip better calc
yep, doing it sooner didn't work out due to ejwu quitting i guess 🤷♂️
I wonder what happened to him
Got hacked, made a new account, then vanished from the server entirely
just moved on to other things, I suppose
Is there some guide somewhere on how to do this or should i just search through past messages here to learn how it works
how would you use a seal to destoy a nonscoring card? trying to do this but it isnt working, dont know if seals follow different rules or not
Just as a double check/clarification, only PC modding is allowed and nothing else? Even mobile?
i have some DM messages with him from some 2 weeks after seeing anything from him on the server but nothing after that
Steam deck is fine as it's practically a PC platform, but no mobile or consoles
besides we don't have a way figured out to mod any of the other platforms in the same way we can on PC anyways
so it wouldn't be of much use for your efforts if it were allowed
No guide, but you can look at how I make sand cards work in ortalab
@shell condor similarly, I don’t think seals are passed destroying card, you’ll have to patch it in
Anyone know why this shift to the right happens?
label = localize('mods_tag_refresh'),
chosen = true,
tab_definition_function = function() return {n = G.UIT.ROOT, config = mod_option_config, nodes={
{
n = G.UIT.C, config = {align = 'tm'}, nodes={
create_toggle({label = localize('mods_tag_refresh_enable'), ref_table = SMM.config, ref_value = ''}),
{n = G.UIT.T, config = {text = localize('mods_tag_refresh_desc'), scale = 0.4, colour = G.C.UI.TEXT_LIGHT}},
create_toggle({label = localize('mods_tag_refresh_enable'), ref_table = SMM.config, ref_value = ''}),
}
}
}} end
},```
try putting the text node in a row container
Wrap your text nodes in a row
Ill try that thanks
Thank you, are these patches just replacements in the source code? What do pattern, position and match_indent do?
They inject code directly into the source code. Pattern is a full line to match in the original file, position is set to inject the payload either before, after or at, and match indent just keeps the original indentation so it doesn’t look awful
Damn it worked! you guys are a blessing fr
...so how does one apply a patch?
i found a patch in Cryptid for the green seals
no idea to actually apply it though
Got it!! And why the triple '?
For multi line payloads
ah so just like in discord?
How does the base game handle negative point scores?
but with other character (' instead of `)
And then I use it in patterns too so I don’t need to escape single quotes
^bumping
Is there any room for the mod loaders to integrate a git(hub) auto-update?
I had plans for adding it, but there's a full external mod manager in the works, which is a much better place for it
so we held off on adding something of the sorts into steamodded
Do tell me about the external
LOL what is going on
i need to get this child to stay away from my computer
no way
she hit the fucking linkedin windows keybind
and the onenote one
ctrl+alt+win+shift+L and ctrl+alt+win+shift+N
AND POWERPOINT
Crazy
this girl is a pro
Damn
get thus child into congress!!!
shed be better than half the current folks
Is there no built-in way to run an update code for a booster pack that hasn't been opened yet?
(if it's still in the shop)
shes a proud balatro player
she doesnt know how to read
thats a sign of a great balatro player
why doesnt this work, this patch should make it so that every fire card thats played gets destroyed
version = "1.0.0"
dump_lua = true
priority = 1
[[patches]]
[patches.pattern]
target = 'functions/state_events.lua'
pattern = '''if scoring_hand[i].ability.name == 'Glass Card' and not scoring_hand[i].debuff and pseudorandom('glass') < G.GAME.probabilities.normal/scoring_hand[i].ability.extra then destroyed = true'''
position = 'before'
match_indent = true
payload = '''
if scoring_hand[i].ability.name == 'Fire card' and not scoring_hand[i].debuff and pseudorandom('glass') < 1 then
destroyed = true
end
'''
use enhancement key instead of name, probably that's not actually the name the enhancement has (it's not guaranteed to be unique)
scoring_hand[i].config.center_key == 'm_modprefix_key' where modprefix is your mod's prefix and key is what you put as a key into SMODS.Enhancement
there's some things like this in vanilla code that are deemed bad practice or not viable in modded
ok so now i have this
[manifest]
version = "1.0.0"
dump_lua = true
priority = 1
[[patches]]
[patches.pattern]
target = 'functions/state_events.lua'
pattern = '''if scoring_hand[i].ability.name == 'Glass Card' and not scoring_hand[i].debuff and pseudorandom('glass') < G.GAME.probabilities.normal/scoring_hand[i].ability.extra then destroyed = true'''
position = 'before'
match_indent = true
payload = '''
scoring_hand[i].config.center_key == 'm_avatar_fire' and not scoring_hand[i].debuff and pseudorandom('glass') < 1 then
destroyed = true
end
'''
but this still wont work :{
it needs an if at the start
🙃
just saying, you're also changing glass card RNG
you should remove the pseudorandom call, it doesn't do anything
i know, just wanting to get this to work, probabilties will be updated later but i want a surefire way to check if it works
still won't work 
change your pattern to this if destroyed then
would anyone happen to have a sort of template sprite for making joker cards?
or atleast what the default sprite resolution for jokers is
cheers!
thank you so so much, why this and not the other thing?
np
your pattern doesn't match, these take full lines
and your pattern isn't the exact line
ah
- simpler patterns are better and less likely to cause patch conflicts
do you btw know if i can call pseudorandom with any string or if it has to be one of the already used ones?
it works with any string
nice
in fact you should avoid using ones the game already uses as to not alter the game's RNG
would have to playtest for balance, seems quite strong but fine for a rare
Aight. I'll let doc have the final say on if it's too powerful or and whatnot
destroying cards is a great effect but enhancements aren't always easy to come by
woooo new card properties
Woo!
It's a curse
They're Ortalab's opposite Seals, but we decided to make them a new type
mhm
True
Tldr, they're for a downside for a good effect for Mythos cards if i remember correctly
I'm changing Roffle from 1 in 5 to 1 in 4 for a perkeo effect
i should play some ortalab, i've actually never played it smh
oh no aure is going to find all my bugs
Aure's gonna make that bugfix section of our todo list long
lmao
I changed Roffle's effect a little
playing around i felt like the perkeo effect did little to nothing
O-Oh
is there a mod to quickly restart balatro after updating your mod?
the alt+f4 key then clicking it on your taskbar
hold M
how do i make it so that a new card gets added to hand that is the same rank and suit as scoring_hand[i] but with a different enhancement, should copy edition and seal as well but that is'nt as important
guys i need help i want to mod balatro a bit and makeit little more clear for me without loosig style points (i dont really like high contrast colours choise) and how hard it would be just to change colours on cards like to make spades black-> dark violet etc. (i know nearly nothing abouit modding and programming)
that would probably be pretty simple, im sure there are texture packs or mods out there that do that exact thing
turning on high contrast in settings didnt help you?
Thats the thing i hate this blueish and yellowish choice of colours so i want to my own contrast set
I really REALLY did not wanna ask this but I need to know how to make this consumeable to only create a rare card thats compatible with perishable
or uh just exclude a specific joker for future reference
h
g
u
r
meow
bread
bread
big jeremy
Blåhaj spotted

Can I modify and update shown hand_chip and mult values during scoring? It appears to work for chips only if I try to, say, swap the two values around.
Cross referencing my joker with Fortune Teller, looks like my message didn't trigger when I used a spectral card
calculate = function(self,card,context)
if context.joker_main then
return {
card = card,
chip_mod = card.ability.extra.chips * G.GAME.consumeable_usage_total.spectral,
message = '+' .. card.ability.extra.chips * G.GAME.consumeable_usage_total.spectral .. ' Chips',
colour = G.C.CHIPS
}
end
if context.using_consumeable and context.consumeable.config.center.set == 'Spectral' then
return {
card = card,
message = 'Upgrade!',
colour = G.C.ATTENTION
}
end
end
Also it seems to crash whenever I try to play a hand when there no spectral cards were used with my joker to add +10 chips
It crashes at the chip_mod part with attempt to index a nil value on consumeable_usage_total
It works when I do spawn in a spectral card with debugplus since by then the nil error doesn't happen
Anybody know how one would go about making it so that consumable cards in a booster pack have the option to select (like card and buffoon packs where it goes into your deck) instead of being instantly used (like arcana and spectral packs)
I'm trying to make a modded booster pack of mine work like this and I'm having difficulty figuring out how to do something like that lol
I've technically done something similiar except with vouchers in terms of calculating the bonus, but you may find this useful.
if context.joker_main then
local usedspectral = G.GAME.consumeable_usage_total.spectral or 0 -- 0 if nil, use actual number if not.
local specbonus = card.ability.extra.chips * usedspectral -- this is either 0 or actual multiplied bonus.
return {
card = card,
chip_mod = card.ability.extra.chips + specbonus,
message = '+' .. card.ability.extra.chips + specbonus .. ' Chips',
colour = G.C.CHIPS
}
end
Betmma Vouchers has a Voucher for being able to reserve tarot and spectral packs respectively, perhaps you can peek at how its' done there?
Ooh okay thanks for the lead >:3
Attempting to directly influence the scored chips and mult from a function without adding or subtracting via bonuses from cards or jokers... am I meant to modify the G.GAME.current_round.current_hand.chips and G.GAME.current_round.current_hand.mult then and which functions do I call to "update" the values shown with the changes? Basically want to visually and literally swap the two around on trigger.
would g.hand.cards be how many cards are in your hand
or like how would i get that value otherwise
what event is triggered when a playing card is modified
i.e. with tarot cards, hiker, spectral cards, etc
I actually have a list of all the times a deck can get modified
- magician (tarot)
- empress (tarot)
- justice (tarot)
- lovers (tarot)
- hierophant (tarot)
- devil (tarot)
- chariot (tarot)
- strength (tarot)
- tower (tarot)
- death (tarot)
- star (tarot)
- moon (tarot)
- sun (tarot)
- world (tarot)
- aura (spectral)
- sigil (spectral)
- ouija (spectral)
- talisman (spectral)
- deja vu (spectral)
- trance (spectral)
- medium (spectral)
- hiker (joker)
- vampire (joker)
- midas mask (joker)
change_suit
set_base (both rank and suit)
set_ability (enhancement)
set_seal
also wtf you know guigui too
FUCK
death
killin myself
you're being converted into a 2 of diamonds

I'm also trying to get a joker to preview in the game
what's the best way to do this
if context.cardarea == G.hand then
if (context.other_card:get_id() == 2) or (context.other_card:get_id() == 3) or (context.other_card:get_id() == 4) or (context.other_card:get_id() == 5) or (context.other_card:get_id() == 6) or (context.other_card:get_id() == 7) or (context.other_card:get_id() == 8) or (context.other_card:get_id() == 9) or (context.other_card:get_id() == 10) or (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
if context.other_card.debuff then
return {
message = localize('k_debuffed'),
colour = G.C.RED,
card = self
}
else
local bonus = (card.ability.extra.money)
if bonus > 0 then return bonus end
end
end
end
end```
collection > hover over a jonkler > press (ctrl+)3
i assume that bullshit line of code is whats fucking up
basically its supposed to treat every card as a gold card
what the fuck
the problem (i think) is that "calculate" only happens when its NOT in context.cardarea
i know okay
doesn't work for me
the mod is 100% installed
3 doesn't work either 
are you putting your mouse over it?
guh
or clicking it
let me look at the official keybind things
I do have this on
but yea no it still doesn't work
and yes I am hovering over it
i forgot what the other configs are there
turned the setting off too
does it show anything in game if you hold tab
yea
fcuk
for some reason, ``` if context.cardarea == G.hand then
keeps crashing
whether its in an event or calculate = function or whatever
okay its no longer crashing
but now its not doing anything
if context.end_of_round and not context.cardarea then
if context.other_card:get_id() == 2 then
if context.other_card.debuff then
return {
}
else
return {
message = localize('k_debuffed'),
colour = G.C.RED,
card = self
}
end
end
end
end```
this is what we're at rn
the 2 was just testing
crashes either way
the problem is with line 240, aka the context.other_card:get_id()
but it specifically said the "context.other_card"
that's not how I remember checking for individual end_of_round
i stole it
that would be context.end_of_round and context.cardarea == G.hand and context.individual if I'm not mistaken
if i wanted to start developing mods for the game where should i start?
this happened
stupid line 961 for limit
this thing keeps popping up
LINE 961 IS ABOUT GLASS CARDS
look at the tutorial in steamodded, ModdedVanilla.lua
aure you were a blessing the last time. Do you know why it can read enable but not newgame?
enable = true,
path = "Collection/TagRefresh.lua",
newgame = true,
},
create_toggle({label = localize('mods_tag_refresh_enable'), ref_table = tag_refresh , ref_value = 'enable'}),
create_toggle({label = localize('mods_tag_refresh_newgame'), ref_table = tag_refresh , ref_value = 'newgame'}),
Its just always disabled by default so it can't read it for some reason
wait
i think i
put something in there on accident
nevermind gave the same crash anyways
NEVERMIND DID SOMETHING WRONG AGAIN ONE SEC
might not fix it but still
if context.end_of_round and context.cardarea == G.hand and context.individual then
return {
context.other_card:juice_up(0.5, 0.5),
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.money } },
colour = G.C.RED,
card = self
}
else
end
end```
that is causing this
and im not sure why
from what i can tell, it is detecting everything just fine
huh, that should work all the same-?
card = card
instead of card = self?
yes
Thats the funny part. it throws all nil after enable is true. but i found a way around somehow i guess? makes no sense to me but its not nil anymore
CARD = CARD WORKED
I DIDNT THINK CARD = CARD BUT HERE WE ARE (here we card)
would there be a way to do it 1 by 1
like each card has the effect happen one by one
instead of all of them shaking at once
remove context.other_card:juice_up(0.5, 0.5),
well i do want them to juice up, just one by one
or is that what that would do
ok that is not what that does
im guessing id have to check each card in hand individually for it to happen one by one
card = card should already do the juicing up
doesnt
unless i have it in the wrong spot
its last
if context.end_of_round and context.cardarea == G.hand and context.other_card and context.individual then
return {
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.money } },
colour = G.C.RED,
card = card
}
else
end
end```
doesnt send the message either
I think i know why it was nil for me... does steamodded or whatever cache configs?
Can you send me the full code where this is?
I'll dm you
SMODS.Atlas{
key = 'Enhancements',
path = 'Tangle.png',
px = 71,
py = 95
}
SMODS.Enhancement{
key = "tangle",
loc_txt = {
name = 'Tangle',
text = 'The card to the left of a Tangle card and the Tangle card itself can be played as a single card'
},
atlas = 'Enhancements',
pos = {x=0, y=0}
}
Trying my hand to at least get a card in game, but I'm met with this error:
msg = string: "functions/misc_functions.lua:1690: bad argument #1 to 'ipairs' (table expected, got string)"
Any insights on this? I'll provide more of the crash log if needed, I don't want to spam this channel
loc_txt.text needs to be a table of strings, not just one string
this is how you do text wrapping, each string is on a separate line
I don't follow, I'm very much new to Lua in general, what does that mean
Like this
^
Ah right
I just figured out why my runs weren't saving tonight
Yep, got it working!
talisman overrides the save manager and doesn't have the kill signal
So to update the changes I've made to my main.lua, do I have to exit and reopen the game for every change or is there some kind of hotkey to streamline the process
you have to restart the game. steamodded has a quick restart feature though
you just need to hold the 'm' key for a second or so
Gotcha
Time for the painful part, actually coding in the mechanic
What kind of checks there are that can detect
- cards that are on the left of the selected card
- the number of cards played in a hand (My card's ability is to play itself and the card to its left as one card)
And also, is there some documentation where I can see what checks are there?
added this to the example jokers mod btw
Thanks a ton for adding it on, definitely a nice one to know about,
I'll probably go over it and elaborate more on the comments later, and maybe add one more joker as well, since I realized I don't have a single info_queue example in there yet.
i have an idea for a mod but have no idea if it's possible, adding vouchers that will give the possibility to kinda "continue" a run if you lose but with different effects depending on which voucher you purchase
Doesn't sound impossible, first mod that comes to mind is https://discord.com/channels/1116389027176787968/1211425207080718416, which you could maybe take a look at and see how they let you retry antes.
Maybe more on the complex side, but, probably not impossible.
also is it possible to have something show up with a generic sprite and description in the shop if it hasn't been discovered yet?
You could look at #1248249207526002698 for something similar to that effect.
Merry crimbus!!
do tarots or planet cards spawn more in a shop (not packs, like the actual cards)? presuming no vouchers or any other changes to spawn rates
Is orange not a usable color in joker descriptions? I'm just trying to do "Provides a {C:orange}Ruby{}" but it's just showing up as black. G.C.ORANGE is a thing, right?
C:attention is orange
Oh that works great, thank you!
im pretty sure G.C colors are different than the ones used in description but im not sure where theyre defined
loc_colour function
seem to be the exact same weight, hrm
yeah it's the same by default
...per chance, can the currently scored chips and mult be "swapped" around? I assume some functions will have to be called to "update" after the change of values by the swap.
yes but that sounds really useless
you can look at greyscale from ortalab
...unfortunately, I don't seem to see any code that does the swapping of the two values around? Downloaded latest code up there... unless I've used the wrong repo or should have used the release.
it's in the lovely patches
## Greyscale edition on jokers
[[patches]]
[patches.pattern]
target = 'functions/state_events.lua'
pattern = '''if edition_effects.jokers.x_mult_mod then'''
position = 'before'
match_indent = true
payload = '''
local card = edition_effects.jokers.card
if card.edition.swap then
local old_mult = mult
mult = mod_mult(hand_chips)
hand_chips = mod_chips(old_mult)
update_hand_text({delay = 0}, {chips = hand_chips, mult = mult})
card_eval_status_text(card, 'extra', nil, percent, nil, {message = localize('ortalab_swap'), colour = G.C.PURPLE})
end
'''
mult, hand_chips = hand_chips, mult 
Forgot to swap my filter to *.* from *.lua, oops. 😅
Assuming w/o such patches it does not work as intended? mult, hand_chips = hand_chips, mult alone didn't cut it either as I tried earlier.
you just need to include the update_hand_text line
so to mod balatro i need to unpack the game right; how do i do that
you don't "need" to do that, you can do it if you want to inspect the source code
you just extract the executable with 7-zip
It's not early Minecraft days with direct .jar modding.
Localization file confusion... does message = localize('toga_swappy') not pull from the misc.dictionary sub-table that's returned from the loc-file?
it should
is toga_swappy the exact key you have in the file?
mkay where's the loc file?
..\localization\en-us.lua
is there a way to transfer over a jokers value to another joker?
i have a scaling joker that has a chance to turn into another joker, is there a way for the new joker it turns into to keep its scaled amount?
-# im gonna presume i could do this with botched blueprint code, but might aswell ask
Root of my mod folder.
so it's outside of your mod's folder..?
No? TOGAPack\localization\en-us.lua
-# Should've just sent it like this.
bumping this rq
Can this
juice_card_until(card, eval, true)
be used with playing cards other than jokers?
As long as you can pass the right "card" to it, yeah.
I was trying to make some cards shake due to a Joker's effect but it keeps crashing
may be best to do card:juice_up() within a G.E_Manager:add_event
lemme grab an example
its the third picture
np, thanks anyways 💪🏽
but heres an example of how to make a card juice up, its just that you may have to replace card with other_card
what would the right card be
altho its crashing in the eval
Are you really making sure that a playing card is not being passed through as card there?
Playing cards don't usually have card.ability.extra.
It should be passing the Joker's card in the eval
i did something similar in my mod, strange pencil, so you could look at that (specifically for the spectral card Negative Space)
wack.
noted, what mod is this from?
Ah, I probably understand the issue
yippe
it was like Ali said 👍🏽
first ever balatro modded player that uses 0.5x speed
if i wanna get into making mods what modding framework would i ideally look into using
Steamodded has most of the tools you will need
ty
Lovely also does some stuff
Generally adding new content use steamodded modifying existing content use lovely
But there's decent overlap
feels like 0.5
How do I make a joker detect if a certain joker is in possession as well?
This is what I had before and I fumbled
if context.other_joker:get_id() == JokerKey1 then
return {
mult = card.ability.extra.mult,
}
end
You can use SMODS.find_card
weird thing: trying to go through area.highlighted and remove_from_highlighted gives "attempt to index a nil value"
imma try to add the cards themselves to an array before i guess?
ok now nothing happens
siiigh
how do I set count_debuffed to true? do I just put in config extra?
Just pass it to the function
i thought config.center.name was the key, no?
After removing card from highlighted, size of array of highlighted cards will change, but iterator will keep going, which can lead to returning nil
i'm aware
oh wait actually
in that case what i'm doing now should theoretically fix it
Isn't there a function to remove all?
Iterate all cards, then remove
Or are you just doing some?
I think so
They share the same area code
Ofc it is. unhighlight_all()
oh
I think it's used for the hand when right clicking
nope it returns a nil value
yeah
well wait
actually
i could try G.jokers:unhighlight_all()
i just did the card area but that might work
It will work
you are jesus
this should work
god please can i finally be done with d6 and start another card
god fucking FINALLY
finally i can sprite this and then easily do ed6 and be DONE with dice
Try to explore vanilla classes and functions first, maybe they are already contain what you need
i had been honestly
I would also like to
I just actually found this: https://www.youtube.com/watch?v=Zp-4U5TlbxY
STEAMODDED 1.0.0
A tutorial on how to make a modded Joker.
https://github.com/art-muncher/Example-Mod -- EXAMPLE MOD
https://github.com/Steamopollys/Steamodded -- STEAMODDED
https://github.com/WilsontheWolf/DebugPlus -- DEBUGPLUS
-----------------------------------------------------...
Hope it helps
Thanks for sharing
local joker_cards = SMODS.find_card('JokerKey', true)
mult = card.ability.extra.mult * joker_cards
is this what you meant cus it wouldnt detect
Found it from this: https://discord.com/channels/1116389027176787968/1307744498360520805
SMODS.find_card returns a table... you want to card.ability.extra.mult * #joker_cards. Keep in mind that it can be 0 too.
is there a way to add an eternal negative card to a deck by default
i tried doing it like a challenge deck but it didn't work..
it's possible that i'm stupid but like
is this not exactly what this should look like?
it does LITERALLY everything except for add the joker i want
do i have to do it in apply?
make an apply function
gotcha
yeah that's what i was thinking
just add it to G.jokers.cards?
or um g.jokers i meant
Wow, looks like a great video!
You should subscribe to them!
SMODS.create_card supports adding stickers and editions directly
i saw that
the you just need to add_to_deck and emplace it into G.jokers
how do the vars work? is it an object or is it individual?
i'm assuming it's an object
like {set="joker"}
you can use that too if you like some nil, nil, nil, nil, true
m
localthunk..
how do i do the eternal enhancement?
oh
stickers = {'eternal'} iirc
Side note it might be nice to have something like add_joker but with the args of SMODS.create_card
So it emplaces and adds to deck for you
yeah we should add that
line?
Old aure name detected
should i just like. update steamodded?
i can do that too
i should do it anyway tbh
I mean it's good advice in general
I mean that's from before the file structure change which is at least 2 weeks out of date
so I'd have to track down the commit and check it out to actually find what that means
Someone should give me a good nickname
beat me to it
I should add an error message to that
and I should make it a warning and just add the prefix if it's missing
bruh
incredible, it works now
thanks
I already did
i_cant_dpell
wilsonthewolf
Let's go guys, loading mods fully works now with steamodded and lovely (ofc it's built in to the mod manager). Steamodded is done. Now working on Balamod jimbo_spin
:jimbo_spin:
when do we get to test it
also why waste your time on supporting balamod
balamod is more obsolete than 0.9.8
TBH I should make DebugPlus balmod exclusive
When everything is done, I'll roll out the mod manager to a few testers which will then give me feedback on what's working and what's (still) broken, so I can make the most stable version of it available
true, should dedicate a mode to smods 0.9.8
Talsiman has code to ensure smods 0.9.8 compat
what's a Talsiman
Refer to my nsme
fine
talsiman is that specrtal card that gives a plaiyng card a glod sael
haven't managed to get my gf into balatro yet so can't make her play my mod :(
thats line number? im pretty sure?
wdym?
im 99% sure thats the line number thats causing/related to the error
oh so something a mod maybe accidently mistyped or smth
lemme have a look
possibly? im not smart enough to read balatro error messages, my apologies
dev*
oh dw thx for helping eitherway
yeah I've seen that
okay
your version of FusionJokers is incompatible with latest steamodded
ohh so i have to get a newer fusionjoker version?
you should get elbe's version
i am pretty sure i had this one already
i am pretty sure you didn't
Merry Balatmas
Added quantum enhancement utils here https://github.com/Steamopollys/Steamodded/wiki/SMODS.Enhancement-[wip]
does context.other_card work for cards held in hand?
yeah it should
your bf is awesome as fuck bro....
is it possible to add unlock conditions to steamodded decks
is there an unique id I can use instead, that is not the card's rank?
I tried printing ability.name and its empty
yo how exactly do i like. extract balatro’s files and code im curious
is there a tool i can use?
just zip up its .exe, and then unzip it
yes, you can add a check_for_unlock function
there's docs for that btw
he did really good
is there?
What's the formatting or method used to create the upgrade dialogue when I use a spectral card? This does nothing
if context.using_consumeable and context.consumeable.config.center.set == 'Spectral' then
return {
card = card,
message = 'Upgrade!',
colour = G.C.ATTENTION
}
end
Used Ali's small bit of refactoring but it's still giving me [SMODS GRIZZLETECHJOKERS "main.lua"]:42: attempt to index field 'consumeable_usage_total' (a nil value)
if context.joker_main then
local usedspectral = G.GAME.consumeable_usage_total.spectral or 0 -- 0 if nil, use actual number if not.
local specbonus = card.ability.extra.chips * usedspectral -- this is either 0 or actual multiplied bonus.
return {
card = card,
chip_mod = card.ability.extra.chips + specbonus,
message = '+' .. card.ability.extra.chips + specbonus .. ' Chips',
colour = G.C.CHIPS
}
end
I'm trying to make a simple spectral card as my first mod, under SMODS.Consumable, what is "atlas"
an atlas is a spritesheet
this one was 90% documenting vanilla things
Thank you Aure
might be another dumb question, where and how do you define what a consumable will do on use?
where is this, I can't seem to find it
here, towards the bottom of the page
anyone know why my mod isnt appearing in the game?
use .json
self.base.nominal = on the ranks is how much the card scores when played, right?
(in the source code)
currently trying to figure out what i need to call to change how much a card scores
yep
cool
finally made it 👴🏽
I'm trying to figure out how to use the parameters, self is the actual consumable card, I'm guessing area is the cards you draw while in a booster pack or blind, but what is "card" and "copier"
Just wanted to follow up with this
Fun fact, it was just for me to remember what I was doing when creating the parsing system lol
I forgot to remove it in first release, but now JSON Metadata are a way better solution anyway
lol
Btw is there any way you could support custom love2d font objects in future releases so i can make specific parts have different fonts?
Maybe G.GAME.consumeable_usage_total.spectral or 0 > G.GAME.consumeable_usage_total and G.GAME.consumeable_usage_total.spectral or 0? We just need to ensure that it's either is used as value if it is a valid number... if it's not, redefine it as 0.
how do i make it so that my custom rarity stops showing up in shops if i already have all of the items in it?
like i have the 1 card in the shop and then it just fills it up with jimbo's stupid ass
make your Rarity.get_rate function return 0 if you have every joker
ah
how would you uh. effectively implement this without taking up half the file?
ya was boutta say
you just gotta do it unfortunately
Edit made
flowwey would it be simple enough to add functionality for shop jokers of certain rarities to just not appear instead of being replaced with jimbos when there's no more in pool
@autumn coral unrelated but fire music
Nope, same crash.
if context.joker_main then
local usedspectral = G.GAME.consumeable_usage_total.spectral or 0 > G.GAME.consumeable_usage_total and G.GAME.consumeable_usage_total.spectral or 0 -- 0 if nil, use actual number if not.
local specbonus = card.ability.extra.chips * usedspectral -- this is either 0 or actual multiplied bonus.
return {
card = card,
chip_mod = card.ability.extra.chips + specbonus,
message = '+' .. card.ability.extra.chips + specbonus .. ' Chips',
colour = G.C.CHIPS
}
end
i mean yeah if consumeable_usage_total is nil rewriting your code won't make it any less nil
I more of meant replacing that line... but...
local usedspectral = G.GAME.consumeable_usage_total and G.GAME.consumeable_usage_total.spectral
if usedspectral == nil then usedspectral = 0 end
have we considered that it's probably something other than "consumeable_usage_total" because evidently it does not exist
what does fortune teller use
G.GAME.consumeable_usage_total.tarot
Although it makes the check if G.GAME.consumeable_usage_total exists first.
Real???
That means a lot thanks
😭😭😭😭
I tryyyy
So the likely problem is that you're indexing consumeable_usage_total before it actually exists.
lol np i listened to all of it (or at least what's on spotify is there anything else) and it's bangers
Thankkkk new song is coming out on Fridayyyyy
oo sick i will be listening
I wish lua had like some python features ngl
[i for i in i if i[‘rarity’] == 4] in a good ending
Would make my life so much easier
lua has pythons #1 most talked about feature which is being slow as fuck
shoutout pypy for being not slow btw..
i can't believe python developers found out what a compiler was
oh also why are there like 5 python C translators
okay from further inspection everything ive ever known is incorrect
i need to start paying more attention when i watch tsoding vods
Who even uses python
a lot of people apparently
it's very useful
lots of good libraries
i know it's the second-most popular language for statistics, after R of course
but both have big communities for that kind of thing
Are there contexts that check for the number of chips and mults scored?
I'm making a joker that checks whether the total number of chips or mults scored in a hand is higher, and the higher one will have half of its amount sacrificed to be added to the lower amount
Like if your hand scored 4x10, the 10 gets halved and the half gets added to the chip score, making it 9x5
G.GAME.chips and G.GAME.mult or soemthing
iirc that's actually what I've been messing with by swapping currently scored chips and mult around by swapping hand_chips and mult.
no, and they're just values defined in global space that get changed during scoring, nothing to do with context
but yeah it might be hand_chips, you'll have to check
Alrighty then
And where do I check that? Steamodded's wiki?
No wait hold on, I should peer into Balatro's source code for that, right?
So those modding tutorials that show these global value suggestions, it's because they opened up the source code in VSC or something?
you can look at other people's code to see where you can find certain things globally but generally yes you can look at source code
👍
it's just being able to figure out where you can find what you need
Found something, looks a bit close to what I need
Alright so now I'm trying to lock everything to 0 since without a spectral card played I still get chips added but then it crashes on attempt to perform arithmetic on nil specbonus
calculate = function(self,card,context)
if context.joker_main then
local usedspectral = G.GAME.consumeable_usage_total.spectral
local specbonus = card.ability.extra.chips * usedspectral -- this is either 0 or actual multiplied bonus.
if usedspectral == nil then usedspectral = 0 end -- Lock the amount of used spectral cards to 0, not nil
if specbonus == nil then specbonus = 0 end -- Same thing for this, except for the bonus chips
if specbonus == 0 then return end -- Don't do anything if the bonus equals 0
else
return {
card = card,
chip_mod = card.ability.extra.chips + specbonus,
message = '+' .. card.ability.extra.chips + specbonus .. ' Chips',
colour = G.C.CHIPS
}
end
So I'm trying to make a joker that is meant to increase the hand size by 1 for every 6 diamonds in the deck, but I'm running into a couple issues:
firstly, it's applying the effect additively every blind, (so on a standard deck with 13 diamonds it'll be 10 on one blind, 12 on the next, 14 on the next, and so on)
secondly, it doesn't update the hand size mid-blind if the number of diamonds increases (so making six new diamonds will still only have the hand size at 10 instead of going up to 11, even after playing or discarding).
Would anyone be able to help me straighten things out?
Maybe you'd want to actually collect all cards that count as Diamonds and then divide the total by 3 and store it in the card as variable. If on the next check the value is different, add (or subtract) the difference between the original total and new one, then override the old total with new.
I'm pretty new to modding, I had a lot of help with even this much, how would I go about doing that?
i dont remember this card.
it looks weird like the sprite is ai generated or something
so how would i program a joker to give +50 chips. by like. default.
You're already counting up all diamond cards with the for loop. Remove the if diamonds == 6 check and replace it with setting the card.ability.extra.tally. You may find needing an extra value to store a second copy of it to check (card.ability.extra.compare for example).
In the calculate part, check if card.ability.extra.tally = card.ability.extra.compare. If not, store the result of card.ability.extra.compare - card.ability.extra.tally as a local variable, then set card.ability.extra.tally to be card.ability.extra.compare.
if context.joker_main then
return {chip_mod = 50}
end
in calculate.
oh; nice; for future reference, where does balatro keep all the code for the cards
card.lua within executable itself.
got it; thanks
calculate = function(self, card, context)
if context.after then
if G.GAME and G.GAME.chips and G.GAME.mult then
if G.GAME.chips > G.GAME.mult then
local halved_chips = G.GAME.chips / 2
G.GAME.mult = G.GAME.mult + halved_chips
return {
message = "Balanced!",
colour = G.C.MULT,
card = card
}
elseif G.GAME.chips < G.GAME.mult then
local halved_mult = G.GAME.mult / 2
G.GAME.chips = G.GAME.chips + halved_mult
return {
message = "Balanced!",
colour = G.C.CHIPS,
card = card
}
end
end
end
end
Trying my hand to make the Joker I talked about earlier, its ability is when at the end of a hand, it will check whether the chip or mult total is higher, and the higher one will have its value halved and added to the lower one
Unfortunately it's not triggering the joker for me, what am I missing? Do I need joker_main?
Tried with context.joker_main as part of the condition of contexts?
OH BOY MY FIRST ERROR
Haven't tried it yet, I was just following the example mod source code, and noticed that some jokers don't have them, so I'm just trying out without it first before adding joker_main
this is. probably the reason why. im still very new to this.-
calculate is a function too.
calculate = function(self, card, context)
if context.joker_main then
return {chip_mod = 50}
end
end
i'll. work on this some other time once modding becomes a bit more. understandable???
is it possible to make a voucher appear more rarely or is it just purely a random selection out of however many vouchers?
you can make the in_pool function only return true 1 in 4 times
but i don't think theres a way to add a weight
regardless the prior will artificially make it 4 times rarer
that would work, cause i want the vouchers for my mod to be somewhat rare since they may result in crazy builds if luck is on the player's side
SMODS.Joker{
key = "balance",
loc_txt = {
name = "Facet of Balance",
text = {
"If the total Chip or Mult amount",
"is lower than the other, {C:attention}sacrifice",
"half of the higher amount{} to be added",
"to the lower amount"
}
},
atlas = 'Jokers',
rarity = 2,
cost = 4,
blueprint_compat = false,
eternal_compat = true,
perishable_compat = true,
unlocked = true,
discovered = true,
pos = {x=0, y=0},
calculate = function(self, card, context)
if context.joker_main then
return {
message = "Balanced!",
colour = G.C.MULT,
card = card
}
end
if not context.before then
if G.GAME and G.GAME.chips and G.GAME.mult then
if G.GAME.chips > G.GAME.mult then
local halved_chips = G.GAME.chips / 2
G.GAME.mult = G.GAME.mult + halved_chips
return {
message = "Balanced!",
colour = G.C.MULT,
card = card
}
elseif G.GAME.chips < G.GAME.mult then
local halved_mult = G.GAME.mult / 2
G.GAME.chips = G.GAME.chips + halved_mult
return {
message = "Balanced!",
colour = G.C.CHIPS,
card = card
}
end
end
end
end
}
Hmm alright, I managed to get my Joker to trigger at the end of a hand and display "Balanced!", but it's not going through the calculations so it's basically an empty joker
Maybe my calculation logic is in the wrong place or something? Or am I missing something?
Not actual coding help but doesn't this just conceptually always return a lower value than if you didn't have the joker
a = 87
b = 13
87*13 < 43.5*46.5
I believe the if statement starting at "context.joker_main" is always going to return a value before it even reaches "not context.before" so it never has the chance to check any actual logic
Yeah it seems like the triggering happens inside the return bracket of joker_main, it didn't get the chance to reach the calculation part
I don't think part is really doing anything anyway? Could probably just get rid of it
Tried following example mods, they all have like card abilities to increase mult, chips, money etc etc with card.ability
However, my Joker modifies the mult and chip score directly instead
Could just try replacing "not context.before" with "context.joker_main", getting rid of the original "context.joker_main" thing and seeing what that does. (Also I don't think you're actually removing half of the values from the larger value currently?)
I'm still pretty new to this too so I'm not sure if that'll actually work lmao
I just started today LMAO
Why not merge the two into if context.joker_main and context.after then?
Though, actually, context.final_scoring_step may be needed instead.
What does that context do?
For any deck effects like 'Plasma' merging chips and mult.
calculate = function(self, card, context)
if context.joker_main and context.after then
if G.GAME and G.GAME.chips and G.GAME.mult then
if G.GAME.chips > G.GAME.mult then
local halved_chips = G.GAME.chips / 2
G.GAME.mult = G.GAME.mult + halved_chips
return {
message = "Balanced!",
colour = G.C.MULT,
card = card
}
elseif G.GAME.chips < G.GAME.mult then
local halved_mult = G.GAME.mult / 2
G.GAME.chips = G.GAME.chips + halved_mult
return {
message = "Balanced!",
colour = G.C.CHIPS,
card = card
}
end
end
end
end
I haven't added context.final_scoring_step yet, does it replace context.after?
And also, it's still not able to reach the return statements, and I'm not sure how to rearrange them
Replace, yes.
Does lua evaluate integers as true or false? If not "G.GAME and G.GAME.chips and G.GAME.mult" is probably causing the issue since chips and mult should theoretically both be integers
If I don't add them, the game crashes since it detects them as NIL
Conditionals (such as the ones in control structures) consider false and nil as false and anything else as true. Beware that, unlike some other scripting languages, Lua considers both zero and the empty string as true in conditional tests.
Try using hand_chips & mult in place of G.GAME.chips & G.GAME.mult respectively?
Lua is strange
Just wait until you see SRB2's implementation of it, known as BLua. 😂
Just hand_chips and mult? No prefixes in front of them?
No prefixes.
Gotcha lemme try it out
You may need to also use update_hand_text({delay = 0}, {chips = hand_chips, mult = mult}) to update the shown values.
Is that outside of calculate?
No, you call that after modifying the values.
Lemme give it a go
Right after, in fact.
calculate = function(self, card, context)
if context.joker_main and context.final_scoring_step then
if G.GAME and hand_chips and mult then
if hand_chips > mult then
local halved_chips = hand_chips / 2
mult = mult + halved_chips
update_hand_text({delay = 0}, {chips = hand_chips, mult = mult})
return {
message = "Balanced!",
colour = G.C.MULT,
card = card
}
elseif hand_chips < mult then
local halved_mult = mult / 2
hand_chips = hand_chips + halved_mult
update_hand_text({delay = 0}, {chips = hand_chips, mult = mult})
return {
message = "Balanced!",
colour = G.C.CHIPS,
card = card
}
end
end
end
end
Ooh boy, it's still not triggering after I've played a hand, sorry for basically making yall do my homework but I'm still lost haha
Comment out the if G.GAME and hand_chips and mult then bit with its' end?
What of just having context.joker_main on its' own?
Holy fuck it worked
Cheers to all of you who helped me!!
🤝
The Balanced! doesn't really fit there... maybe there's a better synonym for it that could fit better. 🤔
Maybe I could use numbers instead
As you're literally taking half away from one and allocating them to the other... Reallocated!.
I'll think about it!
One down, a couple dozen more to go
Also one more question, if I were to create custom Enhancements (like some of them you see here like Radiant, Volatile, etc), are they just automatically made global? Or do I have to do extra work to make them work?
They technically are... but you may need to make a card actually apply them, be it a special Joker or a consumable.
another question, would it be possible to add an extra modifier type for cards on top of the ones that already exist, or only add to the current types of modifiers?
And also something like basic booster packs to spawn cards with these custom Enhancements?
If you make it a Tarot or a Spectral card, not necessarily, but also still could be done if custom consumable type.
Oh yeah they aren't tarot or spectral or planet cards, they're just enhancements like Mult Cards, Wild Cards, etc
Kinda like this
If you want these cards to spawn only via Booster Packs, sure.
ala Seal, Enhancement?
I plan that they can come in two sources, Jokers (for example, playing a Joker will cause some cards to have this custom enhancement) and Booster Packs
But if I'm stupid and ambitious enough I could do consumables too
yeah so it would be possible for a card to have an edition, seal, enhancement, and an additional modifier from my mod
mainly cause I'm wanting to make a thing where, if you purchase a certain voucher, upon losing a run you can continue in a way, but with some extra effects, and one that I was thinking was a "reincarnation" thing where it resets the ante to 1 and resets the deck to its starting condition, but with a chance to keep some of the cards from your deck when you lost, replacing cards in the normal deck, as well as a smaller chance to retain jokers, but with a "Reincarnated" effect for the cards that doesnt replace the edition, seal, or enhancement for the card and makes it so that you cannot destroy, discard, or modify the card without a certain joker
I don't have enough knowledge for additional modifiers. Best wait for someone else with more know-how on such things to pop in. 😅
I just hope its possible to do, or if not now then sometime in the future
Planning to make a Balatro mod soon, currently jotting down some ideas for stuff I might add in
It is possible, yes
Definitely possible to spawn these in a booster pack too
@unique elm also your joker is reallocating wherever it is in joker ordering, rather than at the very end of scoring, don’t know if that’s what you want it to be or not
any mods that do something similar that i could see how?
I think lobcorp does? @crisp coral
I believe it's done using stickers, since stickers can overlap with each other.
Then publicly I’m not sure if it exists yet
but is that only for jokers, or could i make it so any card can have a sticker?
But here’s a short preview of the type I’m currently working in for ortalab
if anything i could probably just experiment and see if i can figure out how to do something like that
How much modding have you done so far?
not much at all, i just started yesterday though i do have a bunch of experience with lua so that helps
lobcorp modifiers are not stickers (before sticker api got finalized i believe)
ah so does it add another type or is it one of the other already existing ones?
neither i believe, they're not categorized
Hi! I wanted to make a joker called "Positive Reinforcement" where it gives you +6 mult when the hand played is your most played poker hand, I was wondering if there was a way to get your most played poker hand? Or will I have to keep track of that myself
and not added via smods.gameobject
hm well then i may need to dig into the code to see how it works then?
it's just card.ability.modifier and a lovely patch to draw the modifier sprite
Either way, this probably isn’t the easiest place to start modding, it requires a fairly good understanding of the game code to know what you need to do
eh, I'll see what happens and try to learn as i go, starting with the simpler stuff then doing the more complex things
so far all I've started on is adding vouchers
honestly the hardest part for me will probably be the sprites
You can look at how Obelisk finds it.
yea, it is
just set unlocked to false and add an unlock conditions
hello chat, I would like to learn how to mod this game. where do I start? I already have coding experience.
is this code viewable somewhere, for tangled cards? i have a similar enhancement idea (that requires cards of the same enhancement to be next to eachother), and it'd be useful to see how someone else pulled it 😭
Nope, I only got the texture in, I haven't coded the mechanic yet
SMODS.Enhancement is severely underdocumented
oh yeah, its still wip
Anyone here that knows a good way to merge loc files? 
i have no idea all i been doing is downloading mods and seeing how they work
Try making a Joker since that's really nicely documented
if context.repetition and context.cardarea == G.play and not context.repetition_only then
local leftCard, rightCard
for i, playedCard in pairs(context.scoring_hand) do
if playedCard == context.other_card then
leftCard = context.scoring_hand[i-1]
rightCard = context.scoring_hand[i+1]
break
end
where/how would i add a check to this to make sure that leftCard and rightCard are of a specific enhancement? i'd presume it'd be something like:
context.scoring_hand[i-1] and [enhancement check] = "enhancement-name", but i just wanna make sure before i attempt this again 😭
gotcha
local leftCard, rightCard
for i, playedCard in pairs(context.scoring_hand) do
if playedCard == context.other_card then
leftCard = context.scoring_hand[i-1]
rightCard = context.scoring_hand[i+1]
break
end
end
local specific_enhancement = "desired_enhancement"
if leftCard and rightCard and leftCard.enhancement == specific_enhancement and rightCard.enhancement == specific_enhancement then
logic here
end
end```
Thats my thought, when i understood you right 
that is perfect, ty
also helped me figure out where to put my actual enhancement effects, i have no idea what im doing 😭
Thats 99% me when doing lua in general. i don't know what im doing everytime
makes sense honestly, same
im just using what i've learnt to make jokers, mostly by taking existing code and making it fit 😭
no idea how to use lua properly
there is no proper way of using a dynamically typed language
the nature of it makes it improper lol
getting somewhere raisedcateyebrow~2
finally, an excuse for my shitty coding!
-# and it did nothing when played.. let the debugging commence GOODLORDWHATISHAPPENINGINTHERE~1
having no types only works when you have very very well made documentation
makes sense
have you seen factorios documentation? it also uses lua, and the API docs are insane
-# its also where i started modding, so maybe im a little biased
factorio devs definitely understand how horrible of an experience Lua is, and so they try to make it as easy as possible. lol
every single time I try a dynamically typed lang, I always end up hating it and stopping what I was doing and also really seriously thinking of starting my own typed embedded language project...
but then I remember how hard it actually is to make a programming language after a bunch of books I read
balatro is like, the 3rd time on lua
honestly i like lua, but as mentioned i've never used it properly so maybe i might hate it and just no know 😭
honestly lua would be so much better if only we could have importable jsDoc style documentation
wait, enhancements use context right? raisedcateyebrow~2
you could do something like
--import(SMODS.Joker)
SMODS.Joker{
-- now we have autocomplete yippe
}
Sumneko tried it, idk if lua_ls can do it.
-# they do use contexts.. hrmmm..
luals seem like hell, i've heard stories
the code works
it just, doesnt repeat
-# although i did have to get rid of context.repetition for it to even print() anything
-# do enhancements support retriggers?
lua_ls is the status quo
they do have docstrings, it works okay. making a mock module with types is feasible
fair enough
it does seem very useful (the factorio VSC extension uses it), but from the dev of it itself, i've heard it causing a lot of issues
What do you think it’s missing?
Example code
Oh right there isn’t one in the example mods
there are other mods with enhancements you could reference, but also they’re structured like any other object
whats the call for modded enhancements? m_[mod-prefix]_[enhancement-key]?
Yup
hrm.. are there any visible reasons why it wont go past local specific_enhancement = 'm_mjok_copper" then? i can show the entire code if you want, but this seems to be the main issue
Because card.enhancement isn’t a thing
-# makes sense
Use card.config.center_key
leftCard.config.center_key == specific_enhancement, or am i interpeting you wrong?
Did u just copy paste my thought? 💀 That was just an example of how you approach your check i should have said that i guess
-# im stoopid :(
but yes i did, my bad 😭
Yeah this is correct
cool, ty
kid named quantum enhancements
kid named "i need to look into that, it looked interesting"
-# gah why wont this thing just work >:(
SMODS.has_enhancement(leftCard, specific_enhancement) ahh util function
I love abstracting away vanilla structures instead of changing them when they're bad
-# is that a suitable replacement for what i currently have, it still just wont move to the specific_enhancement line and >:(
-# yeah it should be, need to see code to tell what's wrong
calculate = function(self, card, context, effect)
if context.cardarea == G.play and context.repetition_only then
print("why so contextious")
local leftCard, rightCard
for i, playedCard in pairs(context.scoring_hand) do
if playedCard == context.other_card then
leftCard = context.scoring_hand[i-1]
rightCard = context.scoring_hand[i+1]
break
end
end
print("why so left and rightcardious")
if leftCard and rightCard and leftCard.config.center_key == "m_mjok_copper" and rightCard.config.center_key == "m_mjok_copper" then
print("why so configious")
card_eval_status_text(card, 'extra', nil, nil, nil, {message = "Zapped!", colour = G.C.GOLD})
effect.repetitions = card.ability.extra.repetitions
end
end
end
-# i hate how discord squashes code lines, makes it a pain in the ass
looks terrible on mobile
Are ya makin a custom enhancement?
it does
Epic
I can observe
exactly
where is it failing?
it wont go past the if leftCard and rightCard and leftCard.config.center_key ==... line
have you checked you got the enhancement key right?
yougottabepennyingmyjim thats annoying
that is what i've been trying it with, but still
you're playing 3 copper cards at once?
nope, im doing 5, ignore my stupidity
and you just get the first 2 print statements 5 times?
why so copperious
Same
Nothing beats naming a local variable cockmocker or something
one time while working on another joker, every single print was just what the previous line was, with -uzz at the end
i have a screenshot somewhere
but also, tested it with 3 copper cards, same thing
just with 3 prints
lemme just check on my end
What does context.cardarea == G.play mean, is it a check to see if the card is played?
uhhhh, one mo
which which card area is being evaulated, G.play is the cards being played(?)
theres also G.cards and G.jokers
I don't follow can you rephrase it haha
naming my debugging prints something stupid is what makes me insane
i always name them something something skibidi rizz toilet
oh I think I got it
context.cardarea is essenitally just the game going over a specific area, G.play being the cards being played. G.cards being the cards in your hand, and G.jokers being.. jokers
Ah, gotcha
trying it rn
-# should i make it say
to be more clear, r keep it as Zapped! since its.. electricity
yes
GOODLORDWHATISHAPPENINGINTHERE~1 , just if PlayedCard == card then, and not if PlayedCard == context.other_card then, right?
You could play a custom sound if you aren't already to keep the zap effect present.
good ppoint actually
i like the idea a lot more
Don't mind me copying bits of your code BlackATM
if leftCard and rightCard and leftCard.config.center_key == "m_mjok_copper" and rightCard.config.center_key == "m_mjok_copper" then
This is for checking whether the left and right card of a played card are copper cards, right?
oh idm, your free to use my code
it is yeah, you could replace it with m_steel to make it activate with steel cards if you wanted
Yeah my Tangle card needs to check its left card and then somehow do some code fucktuckery to make that left card and itself count as one card
good luck 😭
It's either that or scrapping the idea 💀
Is there a context or a global value that manages the number of cards played in a hand?
i know you can check through how many cards are in a hand, i cannot remeber the code
IIRC its a loop over the played hand, or something along those lines
Do you recall at least some words used, maybe I can scour through this server's chat history to find it
you'd have to cahnge the selected limit, but you'll have to completely rework identifying hands too
Good lord
sorry ,would you mind just sending over your, working code? i changed the thing to card but it just errors out 😭
I hope I don't have to directly modify the source code to do that
literally just change this from if playedCard == context.other_card then to if playedCard == card then
lovely patches, lovely patches everywhere
tf?? wanna be completely sure and im not being blind, this is what you did right
yup
I don't know what line in state events that is
Update steamodded.
OH
and lovely
you are over 2 months out of date

