#💻・modding-dev
1 messages · Page 424 of 1
to_big will be a thing of the past
That's the thing, the modded stuff shouldn't affect chips, only mult
ok, where do you change mult?
alrighty so it no longer crashes
however it also does not work ingame
also please send your whole crash report
question, i can just write their description in the loc file right?
i can just delete the text
yes
here's a simple version of a loc file
hand_mult should be mult
@maiden phoenix should the custom tooltips stay out of the jokers loc?
nevermind
its Others
Yea
ignis
ah, thanks
I recommend adding a name = too, but I think technically yes
well i already put the name on the loc txt tho
They meant for the Joker
hm, still has no effect
Ithink it will show an error if you dont
it works!!!
this code seems to be printing this error, what would the fix be here?
i recently updated steammodded to the version that adds destroycards but i can't seem to get it to work
is that the entire code?
context.other_card doesn't exist in every calculate call
Hai N'
hiii
here's the whole thing
key = "kuromisr",
loc_txt = {
name = 'Kuromi',
text = {"Each scoring {C:spades}Spade{} or",
"{C:clubs}Club{} card gives {X:mult,C:white}X1.5{} Mult.",
"Retrigger each played {C:gold}6{}.",
"If {C:mult}My Melody{} is in your deck,",
"this Joker disables itself.",
"If {C:mult}My Melody{} is sold or",
"destroyed, this Joker gains extra",
"{X:mult,C:white}X1.5{} Mult."}
},
pos = { x = 0, y = 0 },
rarity = 2,
atlas = 'sanriocards',
blueprint_compat = true,
cost = 12,
config = { extra = { Xmult = 1.5, repetitions = 1 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.Xmult } }
end,
calculate = function(self, card, context)
if next(SMODS.find_card("j_srio_kuromisr")) and next(SMODS.find_card("j_srio_mymelodysr")) and not context.blueprint then
card:set_debuff(true)
end
if not next(SMODS.find_card("j_srio_kuromisr")) and next(SMODS.find_card("j_srio_mymelodysr")) and not context.blueprint and card.ability.extra.chips == 90 then
card:set_debuff(false)
end
local dmymelo = 0
if SMODS.destroy_cards(context.other_card) and context.other_card.config.center.key == 'j_srio_mymelodysr' then
return {
message = localize('k_upgrade_ex'),
colour = G.C.SPADES,
dmymelo = dmymelo + 1.5
}
end
if context.individual and context.cardarea == G.play then
if context.other_card:is_suit("Spades") or context.other_card:is_suit("Clubs") then
return {
xmult = card.ability.extra.Xmult + dmymelo
}
end
end
if context.repetition and context.cardarea == G.play then
if context.other_card:get_id() == 6 then
return {
repetitions = card.ability.extra.repetitions
}
end
end
end,
}```
yeah you need to specify a stricter context like context.individual
also returning dmymelo = dmymelo + 1.5 is not doing what you think it does (it does nothing)
it's already separated i thought 
you need to do it outside the return but even then a local variable gets erased as soon as you return so it'll still do nothing
you need to save it to the joker
^
hi haya
well it's not doing nothing, it's softlocking the game when i try to sell the card 
j
How can I tell when a card is retriggered?
iirc, context.retriggered exists
ok i think my code isn't working because the joker doesn't get properly debuffed
i'm assuming card:set_debuff(false) doesn't work at all if the card is already debuffed right
Yay! Ty
like since the joker's debuffed it's not running any code at all
ok I'm pretty sure I was incorrect.
is this an effect that's happening when a single joker is retriggered, or when anything is retriggered?
When a playing card is retriggered by anything
oh, neat
ok one second
ok, here's my thoughts
so context.repetition exists
I'm thinking basically just do something like ```lua
local reps = 0
if context.repetition then
reps = reps +1
end
this may not work, but it's the best that I could come up with from looking at the wiki and repos
can you put some prints in to make sure it's running?
What abt context.post_trigger?
Nvm, ignore me I didn't read it all
ok cool haha
Wait, retrigger_card exists...
hold on let me grab the actual retrigger notes for you
Please do, I can't find them in the wiki
eremel im gonna barge into your house just for the new documentation
🤣 I just cba doing all the contexts, I want to set them out in a slightly more useful way but I'm still workshopping what they should be like
shouldn't it be and not context.retrigger_joker there at the end
this is what they currently look like at the start but I'm not 100% happy with it
question, did you cover the optional features 🤔
yes
nice
it also covers adding new contexts and calculation areas
I will write them all for you if you at least give me their names (and I can find them in the lovely/dump directory)
I'm pretty happy with all that stuff, it's just how to set out the contexts I'm not sure on
:3 im bad at web designing so i will double this and give it to sleepy or someone else who actually knows how to do it
ill quad it and return it to bepis
If we're going that far and it already exists, then why not just do context.retrigger_card?
i just mean that the text is wrong
oh
Hey everyone!
I'm new to modding balatro and currently working on a mod and I'm trying to figure out how to get the current number of consumables (Tarot cards, Planet cards, Spectral cards, etc.) that the player currently has "in hand" / in the consumable slots.
Does anyone know which variable or function in the game's code handles this information?
Thanks in advance for the help!
#G.consumeables.cards
Thanks!
how do I check for cards instead of jokers retriggering?
welcome to the server!
this is gonna advance the modding community so far
Is it possible for a patch to be conditional?
how do you guys changes your font in vscode?
or atleast a fork of it
actually nevermind im stupid
What’s the effect you’re trying to make?
hi again
does some1 know how i can have a context that happens when another joker triggers?
context.post_trigger
good enough
Oh my god how the fuck do you code with that font 😭
biblically accurate human handwritings
just need to change the bg to a fucking paper 🥀
tbh I didn't even think that was code for a sec
LMAO
insyaallah we shall find the bug
actually, i can use this font for the hood irony joker
hold on
thanks bro
Hey y'all, I've encountered a problem where if cards change rank during scoring, they become debuffed by The Pillar. Is this a common problem or would it be a problem with my code?
is there a way to make a joker unable to be targeted by invisible joker
Yes.
How do you do it?
You would need to patch/take ownership of it.
AFAIK no
hi, is there a way to check if scroing is taking place, I can think of checking context.scoring_name but is it guaranteed to not be set if scoring is not taking place
ohh I can just use before and after to track the state myself sorry
When a consumable is constructed, what information is taken from the consumable type? I'm not sure I know what needs to be set per object versus on the entire category
anyone know how to do start_dissolve() with an specific joker? like joker:start_dissolve() where joker = "j_prefix_joker"?
for k, v in pairs(SMODS.find_card("j_modprefix_key")) do v:start_dissolve() end
What's the specific effect you're after?
thanks!
Is it possible to make some items impossible to buy in the shop until a certain Joker is held
Like they just won't show up
insert into the pool whenever the joker is put into hand?
Yea
How would I go about doing that
Yes.
Huh
Neat
Thanks :>
couldnt find it in docs for a minute lol
Was thinking about it because I have a couple items that only do anything if you have a certain Joker
And it's kinda annoying to just have those around
Question about this
Does this still allow SMODS.add_card({ set = the_set_of_the_card_in_question }) to spawn it
No.
Unfortunate
what you can do is add a key_append and check args.source == key_append in in_pool
I'm getting an error whenever I load Balatro using one of my mods. Could someone help out?
I've attached the error I'm getting, along with my main.lua and anything else that could be relevant.
(I have a feeling it could be something with the main.lua file since it's only one line)
isnt it done with assert(SMODS.load_file())
let me try that, I've been referencing other people's mods to try to get multi-joker mods working and I havent seen assert(SMODS.load_file()) yet
still getting the same error
unfortunately :(
oh wait no yeah that wouldnt really do anything here
ive just really gotten up, being slow there
is the folder content in the same folder as main.lua
Does anyone know how to score Xchips with calculate?
remove the YummyPlus, its relative branch
okay let me try that
should just be content/jokers/wineJoker.lua")()
is there a way to check if a joker is modded, and if so, what is it?
that fixed that error, but now I have an error about a missing atlas, which I might know how to fix fixed, you need to define the atlas in your main.lua file
nvm sorry!!!
Man, the button UI for cards is set up weirdly, huh. Lots of hard coding things in. Think I'm managing to work around it though
can playing cards have pershiable? Trying to make this joker
you could make an enhancement with a timer that goes down every round and then sets card.ability.perma_debuff = true once it hits 0. if you do that, i would use info_queue to display info about that enhancement in this joker description
would I just use info_queue instead of C:inactive to do that?
not sure how info_queue works
No?
Yes.
You have to implement it though.
might as well just make the perishing part of the enhancement if you also want the spreading behaviour and the X3 Mult
It would probably just be a hook of calculate_sticker
here's how i add info_queue in loc_vars to a joker if i want the wooden enhancement description to appear beside the card (my mod prefix is gb). just sub in your own prefix and enhancement key
info_queue[#info_queue + 1] = G.P_CENTERS.m_gb_wooden
Having an issue with create_slider, attached video of the issue, from what i understand its because it keeps running G.FUNCS.slider(e) and then breaks when backing out because e doesn't exist
im mainly confused because it was working fine before but now breaks
create_slider({label = "Contrast", scale = 0.5, label_scale = 0.5, ref_table = palette.config.PACKS.BUFFOON, ref_value = 'CONTRAST', w = 3, min = 0.1, max = 8, step = 0.1, decimal_places = 1, colour = G.C.BLUE})
local c = e.children[1]
e.states.drag.can = true
c.states.drag.can = true < Breaking Here```
Code: https://github.com/BlackoutMaiming/Palette/tree/main
how do you check if the hand exceeds the blind requirement? making it for this enhancement here.
if G.GAME.chips >= G.GAME.blind.chips then ?
error or just non functional
What is the goal?
non functional
You would then do if hand_chips * mult >= G.GAME.blind.chips in context.final_scoring_step I think.
lol
ghweufnewquiofnwefwqk
is there a way to get the starting deck configuration?
Is this for checking missing ranks at the start of the run?
great minds think alike
yep
anyways this worked ty
skjdfnkjsdngsd ya you saw techno joker, you put your wee 🤔 on it
i see there's G.GAME.starting_deck_size
but that's for how many cards are in the deck
You would have to check at the start of the run and store it because ranks don't get removed from the config.
right, gotcha, thanks ^^
hi, i made this code to multiply a joker's values by a number, but instead of that it just completely changes the joker's ability to giving xmult, so i'd like to know what i did wrong. lua for key, effect in pairs(G.jokers.cards[card.ability.extra.sel_joker].ability) do if type(effect) == "number" then G.jokers.cards[card.ability.extra.sel_joker].ability[key] = effect * card.ability.extra.multiplier end end
That is because jokers have xmult by default.
ease_hands_played
thank you
so what would i have to do to fix it?
oops copy pasted too much
happens to the best of us
You could either multiply all values in extra if it has it, or you could do what Cryptid does.
isnt the first thing already what my code does?
No, it multiplies everything in ability
oh yeah, but base game jokers dont have extra do they?
Yes.
Either you copy Cryptid or you miss compatibility for most jokers.
then i'll try copying cryptid, i remember looking at its code for a short while and not fully understunding most of it lol
thanks!
bump bc i added the github so you can check the code
How do I get the current mult value of the hand when a joker scores? (not the base mult of the hand, but the current mult e. g. after glass cards, etc.)
mult
I'm trying to make a joker multiplies the current mult of the hand by it's logarithm (base 10). How would that look like? Thanks in advance!
how can i make play card destroyed after scoring?
if context.destroy_card then return {remove = true} end
idk if this one working ? (im making a deck that destroy play hand if the play hand have multiple suits)
hello, where in the game files can i see the descriptions for all the jokers as a reference?
localization/en-us.lua
thank you!
does anyone have any tips for reskinning face cards? im new and wanted to make a pack for my partner and i :)
tysm 🙏
CHAT
IM TIRED OF OPENING THE GAME EVERY TIME I WANT TO PREVIEW MY SHADER CAN SOMEONE PLEASE MAKE A RELOAD SHADER BUTTON 😭
you can add a button to the menu that just runs SMODS.restart_game() ?
That just saves me one click
Is there no option for only reloading shaders
they're loaded in during startup so i doubt it
i might be able to make a mod for it actually
you can
theres the update thingy that debug plus provides
though i dont know how to use it :p
i was thinking just bind the shaders section of smods itself to a function keybind
DebugPlus has a feature to help make this better
Which one
Bless me with your arcane information
watch shader Mods/your mod/assets/shaders/name.fs
it will update ingame whenever you save the file
Omg i love you so much
You saved my life
thank debugplus not me
just gonna bump this again bc i cant rly do anything with this broken lol
how do i do a random pitch for play_sound? and give lower and upper limits, because if i just use pseudorandom it ends sounding like croaking wood
Whats the pixel size for enhancements?
71x95?
would taking ownership and pasting in vanillaremade code (for calculate/use functions) be a good way to try and see what works when messing around with stuff like if/return statements
why this one doesn't destroy played hand when i played multiple suits ? (im making a deck that destroy play hand if the play hand have multiple suits)
card:destroy_card() doesn't exist.
Neither does card.suit
Neither does G.FUNCS.G_Update_HUD_Cards()
Neither does context.played_cards
Neither does context.in_scoring
how can i fix that? (cause i'm new to this)
I have a problem with displaying numerical data in the card description. I just recently started making mods and I can't really find how to solve this problem. In theory, this card should do x4 with a 1 in 4 chance if 4 is counted, but instead of numbers it says nil. Maybe you know how to fix this?
You put #4# but you're not inputting a fourth value.
i dont think the x in xmult is supposed to be capital
with the way that you put in the variables, you should be saying #1# in #2# chance with X#3# Mult
let me check
That doesn't matter?
Wait, the number represents not just a value but its order?
Xmult_mod is valid here im pretty sure (lemme double check rq)
yeah it represents the order you placed them in loc_vars
couldnt you use card.ability.extra.xmult in loc vars
yeah but capitalization of variables in config doesnt matter since its variables youre defining yourself
If i may ask just out of curiosity
What exactly does the "mod" in xmult_mod mean
so long as its consistent in your code it works
its just a valid way of returning xmult
No i mean like
Name-wise
wdym by that
Isnt it just for flat xmult tho
because its a mod? 🤷♀️ im not the one who decided its a valid way to return xmult
Like you have to modify the xmult manually
Oh, its working now! Thanks a lot! I was trying to fix this for idk... 5 hours i think
np, dont forget it bc its pretty important lol
Yeah:)
how do i fix (or at least get rid of) these warnings?
does your workplace include smods-main (or the smods folder, basically)
is smods in your lua workspace
no
include it in there then :3
Also the lovely dump.
i gotta go sleep early so i will let factwixard handle that, ur doing a good job helping others btw 👍
which file should i open
wdym which file
do i just openm the folder?
i dont use lua workplace but i think you just have to include the folder
are you trying to open a file
im trying to put smods in my workspace
try this #💻・modding-dev message
can i add properties to other jokers? like if i wanted my joker to select other jokers could i do other_joker.locked = true and it would be added as a property?
yes but it's not going to be saved on a reload
hey n
hii
reload as in what, i only need it for the span of a calculate function
then that's fine
reload as in quitting are reloading a run
oh, ok then that's dop[e
bump
Whats the atlas for making enchancments 😭
so long as i can utilize it in modification of consumables and jokers thats most of what i need
wdym
atlas = 'Jokers',
this thing but for enchancments
i dont know what it is and I get a crash everytime i try to see my enchanment
are you modifying the base game atlas or something
no just trying to add a new enhancment but I cant find an example of an enchancment in its entirerty only the functional code for base game ones
so i dont know how to format enchantments
atlas is the key for the SMODS.Atlas you made
if you don't have one then you can remove that line to use the vanilla atlas
have you looked at the wiki for enhancements
if your talking about the smods wiki it only has the code for making your enchancment functional not the art part of it
Hey im dying inside. How does it not make EVERY card negative? (Ill add the card type condition later)
calculate = function(self, card, context)
print(context.playing_card_added)
if context.playing_card_added then
other_card = cards[0] or nil
print(other_card)
if other_card then
other_card:set_edition('e_negative')
end
end
end,
this is what i got going on
so do you have an atlas set up for the enhancement
did you set up your atlas?
do you at least have an image with your enhancement
context.cards is the array of cards added
im uusing that
also please don't make global variables
oop forgot
is this what I need?
ctrl+f context.cards in your code and see that you're not lol
is that png the entirety of all your mod's art
no, the bottom one overrides the top one
yup it has everything
then set the key to just one thing and call that key in everything you make
for the atlas
oh do i need different files for making enchantments
no
can i not mix them in the code with my jokers
you can use the same file for the atlas you just need to have everything use the same atlas key
oh also lua starts indexing at 1
how do you insert an info_queue?
well context.cards dosen't work, but context.other_card does
this wont make the card negative tho
calculate = function(self, card, context)
if context.playing_card_added then
local other_card = context.other_card
if other_card then
other_card:set_edition('e_negative')
end
end
end,
you mean event?
no, like the information besides the card that explains a certain keyword
oh
i can assure you context.cards works
help how do I DrawStep 💀
is there a blind context for discarding like context.press_play
i figured out the problem. i used the wrong context 😭
context.press_play does not exist of my knowledge
check https://github.com/Steamodded/smods/wiki/Calculate-Functions
it does
blinds
😭
blinds have the same contexts as anything else
i hate myself
the new contexts are not there yet sadly
so would context.pre_discard be a good context for this?
😭
How do i check for the enhancment of played card
SMODS.has_enhancement(card, "m_modprefix_key")
Holy fuck, I guess I found something
We cannot set metatable for numbers, it has no effect
BUT we can set metatable for string
And perform ariphmetic operations on a string
thanks I hate it
how would I use that in context? if i wanted to turn all scored lucky cards into another enhancement how would I do that?
This code actually works
i might be dumb, but is there a way to check for if a card... has no rank?
like a kind of check that catches any enhancement that makes the card rankless like stone joker, but picks up any other enhancement that does the same thing
SMODS.has_no_rank(card)
context.after
context.area
context.before
context.blind
context.blueprint
context.blueprint_card
context.buying_card
context.card
context.card_effects
context.cardarea
context.cards
context.cards_destroyed
context.check_enhancement
context.consumeable
context.cursor_pos
context.debuffed_hand
context.destroy_card
context.destroying_card
context.discard
context.drawing_cards
context.edition
context.end_of_round
context.ending_shop
context.extra_enhancement
context.final_scoring_step
context.first_hand_drawn
context.full_hand
context.game_over
context.glass_shattered
context.hand_space
context.hook
context.ignore_debuff
context.individual
context.interrupt
context.joker_main
context.layer
context.main_eval
context.main_scoring
context.no_blueprint
context.open_booster
context.other_card
context.other_consumeable
context.other_joker
context.other_something
context.playing_card_added
context.playing_card_end_of_round
context.poker_hands
context.post_joker
context.pre_discard
context.remove_playing_cards
context.removed
context.repetition
context.repetition_only
context.reroll_shop
context.retrigger_joker
context.retrigger_joker_check
context.scoring_hand
context.scoring_name
context.selling_card
context.selling_self
context.setting_blind
context.skip_blind
context.skipping_booster
context.stack
context.starting_shop
context.tag
context.type
context.using_consumeable
bump
where's context.amount
possibly odd question but can an if statement go inside of an event
That list has non standard contexts in right?
So, Lua doesn't allow you to compare table and number, but you can compare string a number.
So, if we'll use string as method for storing big numbers, we a gucci... right?
I've regexed contents of the lovely\dump folder for that list. Some still may not be in it.
we serializing the bignums
like inside the function or what, you can do anything inside the function lowkey
There’s definitely some missing/some fake ones in there
messing around with familiar's code by taking ownership, how would i avoid destroying said card if it has a mod sticker
If card never appear in a first place, game will stuck forever btw. Use non-blocking ones or do better checks
how
Imperfect regex is also true... self.cursor_context.stack[self.cursor_context.layer] & -- TARGET: add context.other_something identifier to your cards...
i was told SMODS.find_card was the way to check if a player had a certain joker
Yes, but what if you don't?
wdym
Game will stuck forever in this check until this joker appears from somewhere, which it isn't because game stuck
you need the return true if you want the event to end so it will keep checking if it finds nothing
not SMODS.find_card(...) is always false also
how do i better check for said jokers existence then
is the return not being first after the if causing issues
it will just keep queuing the event if it finds the card
now can i get the original question answered
i would make a new list and add the cards_to_destroy that dont have the stickers to it
what
local new_list = {}
for _, pcard in ipairs(cards_to_destroy) do
if not has sticker then -- idk how to do this :3
new_list[#new_list+1] = pcard
end
end
SMODS.destroy_cards(new_list)
Consumeable idea. Would this be too complicated, or should I only pick one between them?
It doesn't seem that difficult.
This reminds me that I need to once again update my smods folder,
because I have never seen SMODS.destroy_cards before.
@minor magnet wants to add minigames, I think @chrome widget or @weak brook could help
does anyone know the weight of spectral packs?\
like so?
Define minigames?
Keku is the one who outright programmed a scratch Tetris game for a card so she's probably more in line to ask, but it really does depend on your scope
I mean you added Donkey Kong
Someone else did the original work but still you attached it to a Joker
I meant to put the return after the whole if block
otherwise yes
so put it after the end for the if?
yes
Also why are you @red flower
that's rude to ask
thanks
Uhhhh
I can’t tell if you’re saying “Uhhhh” or if it’s because Tavros says that a lot
how do i get the base X1 blind size for the current ante
is it normal for my LOCALIZATION FILE to crash balatro what 😭
yes, it's a lua file like any other
can i somehow read from the crash log what exactly crashed it...
yes look at line 2722
bump
is it possible to get the sell value of a joker that was just sold and activates context.selling_card
ive been just looking through anything i can im starting to think its just not possible
what are you trying to do
take said sell value and add it to xmult
one sec
context.card.sell_cost iirc
im pretty new to this so like how would i apply that?
So I have a card that breaks on repetitions. How would I make it repeat until it breaks ?
code snippet
calculate = function(self, card, context)
if context.selling_card and not context.blueprint then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmultgain
return {
cardarea = G.jokers,
message = 'Upgraded!',
colour = G.C.MULT,
card = card
}
end
if context.joker_main then
return {
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.xmult } },
Xmult_mod = card.ability.extra.xmult
}
end
end
card.ability.extra.xmult = card.ability.extra.xmult + context.card.sell_cost or something like that
let me try that ty
heres what I did in my code. it doesnt add to the XMULT but rather checks if the sellcost is higher than the current mult added
how can i create a specific tarot like hierophant?
thx
No.
SMODS.add_card({key = "c_heirophant"})
that worked ty
i spent like an hour trying to figure it out on my own 😭
I use create_card ? Is there any difference
should have just asked fr
I was the same way when I started out
DISCLAIMER: This post contains AI generated art. AI generated art is NOT endorsed by LocalThunk or the server mod team. This post has been okayed by the mods - see below
Hey guys, I was joking around and curious as to how poorly-made a Joker would be if it was solely made by AI. I can confirm, though the Joker seems to work as intended, it's coded absolutely awful, and the art looks atrocious (can't even get the letters right.) Wanted to share with the community, so here's what I ended up with.
The difference is adding to deck and emplacing.
ah
before anyone asks: this post is okay. this is a permitted use of AI art under the rules - please see this post for more information - #🎨・fan-art message
you should do add_to_deck there if youre not using add_card
Qoar
Qokr
the first part of the effect is still not what it does lol
how can I take control of a vanilla Joker to modify its code?
I didn't modify it lol 🤷
D:
the text should be "Gives X2 Mult if a Queen is scored"
and it used punctuation, when the only punctuation used in cards is commas
Oh is it backwards? That's even funnier haha
yeah it doesn't give X2 for each queen like the text implies, just once
that's really funny
Fitting that misandry is an AI hallucination
does it matter what the psuedoseed is?
yes and no, depends on what you want with your randomness
the string itself doesn't matter but you want cards with the same "source" of randomness to have the same one
What learning material did you feed in?
I gave it the Smods wiki and the mods that I coded in the past as a reference
Smods wiki only so it knew the commands
I’m surprised it did so well tbh, it’s a lot better than a lot of AI attempts I’ve seen
How specific was your prompt?
Is there any way to get the id and name of a random common joker?
how do I do it?
pseudorandom_element(G.P_JOKER_RARITY_POOLS[1], pseudoseed('seed'))
thanks👍
Then get .key and put that key into G.localization.descriptions.Joker[key].name
I once again have returned to gather the minds to see if we can collectively figure out how to make an options ui element (option_cycle page) be changed by another element (uibox_button)
how do I get the key?
what are the vanilla seals keys?
"Red", "Gold", etc
Search "Taking ownership" on this page
https://github.com/Steamodded/smods/wiki/API-Documentation
Just put .key at the end.
ok, thank you!
responding to this
@daring fern why did you question mark react, that is where it is in the wiki
thats fair i didnt see you had replied, mb
was looking at my other monitor and it went past
maybe point that out and use your words instead of question mark reacting
is there a context for when in a boss blind, i cant find anything and context.boss_blind doesnt work
this function freaks out if you discard (because it's calling itself), is there another context i can use that isn't pre_discard to stop this
G.GAME.blind.boss
how do i make that the seal animation doesnt play (deck)
context.press_play exists but context.press_discard does not. do i have to patch that in
how do I check when the joker is created?
Probably G.FUNCS.discard_cards_from_highlighted but it would be a hook.
Checking if it's not the hook and calculating a context.
Make it ("Red", nil, true) iirc
i’d honestly rather just patch into button_events
This would probably be the cleanest solution yeah
how can i add a card thats a custom consumable
thanks!
al animations play at the same time, also its loud
good afternoon all
hi somecom
holy shit john lovely hi
Yes, but the button directly goes there does it not?
Also button_events doesn't exist.
yeah i mean button_callbacks
Admittedly Something you'd probably be better served directly presenting what you're confused about rather than just a vague emoji react
For me at least, I basically completely ignore reactions as a part of conversation since they don't really say anything specific
I usually use reactions to end the conversation haha
Yeah, they’re like a final tick on a chain
Bump
i can't find an SMODS.calculate_context call for press_play in the lovely dumps
I'm trying to make a joker that has a 1/5 chance of destroying a card and improving the Xmult_mod whenever a stone card is triggered but I can't figure out how to get the card to be destroyed. I've gotten all the other code working and I was wondering if anyone knew how to get it to destroy the stone cards?
fwiw, I also find the one word responses with a full stop at the end come off as very passive aggressive
It's in a hook for Blind:press_play in SMODS's repo itself
to be fair on that one sometimes its a "Yes." and proceeds to find the relevant page and post it
shit. is it really that hard to get this not to call itself
For me, I sometimes like typing in full capitalization/punctuation so I'm not being passive aggressive it's just how I type sometimes. The same for some others as well.
lol
im entirely ignoring that reaction lol
Yeah but just find the relevant page first and post it straight away, whats the need for an intermediary step that doesn’t provide any clarity for the person asking the question
config = { extra = {xmult = 1.35} },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.xmult } }
end,
calculate = function(self, card, context)
if context.other_joker then
if G.P_CENTER_POOLS["Shape"][context.other_joker.config.center.key] then
return {
xmult = card.ability.extra.xmult
}
end
end
end,
can someone help me figure out what im doing wrong? it just doesnt work
Sowwy I wasnt reading cause I just woke up hi @chrome widget :D
Instead of my reaction you get an image
Hi hi!!!
My image of voice
SMODS.Joker:take_ownership("j_joker",
{
config = {
extra = {
mult = 8
}
},
calculate = function(self, card, context)
return {
mult = card.ability.extra.mult
}
end
}
)
I wrote this code to take control of Jimbo but its not working. I had just joker before instead of j_joker but neither works
To let others know you are looking in case it takes a bit for you to find?
I kind of understand the idea of going "Yes, that exists, give me a moment to find it", but yeah thats very fair too, i see your point
Then a simple “yes hold on” is much more helpful
Saying just “Yes.” comes across to a lot of people like you’re done answering the question
I don't see it?
G.P_CENTER_POOLS["Shape"] is an array
you can try updating smods and using (context.other_joker.config.center.pools or {})["Shape"]
N my goat
Is there any way to check when a joker is added?
hi
How are you feeling n
bad becasue im in the office
ok ill try thanks
if context.card_added and context.card.ability.set == "Joker"
Just gonna bump this if anyone has an idea of why this error is happening while there are people
i tried changing the #1# to a #2# (as shown), yet the description still isn't formatting properly?
you only return 1 var
sorry for the bad phrasing, but I was asking to check when the joker itself is added (for setting up the joker's variables)
Let's go out for lunch
do i put main_end = main_end in the vars?
is the problem that the ...? is not showing?
also no
hey, how can i keep track of a value throughout the course of a run (like throwback)
in this case i'm trying to track how many food jokers (ice cream, popcorn, gros michel, etc.) have been consumed throughout the run
yes and the compatibility badge isnt showing up (unless that only appears while you own the joker)
you only return in loc_vars when the joker is in the joker area
so nothing will show
you need to return outside that if block
ohhh ok
this is collection btw, so you're not supposed to see that grey text
ill move the return
bump
G.GAME.blind.mult returns 0 if you're not in a blind, is there an equivalent for it for the whole ante?
ok so
:(
is this not outside the if
it collapses like it is
What is the goal?
you need to switch it back to #1# if you havent
OH RIGHT
i want this to show the correct value when in the blind selection menu
ok everything works now thanks n
would that not just grab 8
This is a really cool idea!!
i spoke too soon
thin cryptid
hmm i dont understand what you want to do honestly
deltarune ch3 spoiler below
||during the tenna fight, minigames are used as the main win condition, taking what you usually do with the game and stretching it in a warioware style, i'd love to have a tenna joker that lets you play a minigame before playing each hand in a bossblind, with a reward of some sort for getting them right, like it gaining mult||
you need if context.joker_main then inside calculate
the minigames could use other jokers as textures
if the base X1 blind size was 50,000 on ante 8, when you see the showdown blind in the menu, the tooltip should say "Selling a joker reduces score requirement by 100,000"
I wanna do this but make it breakout
Gotta clear a stage to gain xmult
boosters keep having this effect and dont spawn any cards
(i know the name is error i havent put a name down)
looks like a creepypasta
it's supposed to transform instead of copying but instead it just
(it shouldnt have even transformed in this case there werent any other jokers 😭 )
i'll add that but it doesn't seem to even be taking effect
like I modified the config but the effect and item description aren't changing
I'm trying to change variables using add_to_deck, but nothing happends :(
"i was playing balatro and i openeed up a booster pack. no cards spawned and then there was hyuperrelaistic blood and my jokers were killed and there was blood. edb teof the stroy"
i dont think you need the j_ prefix
also are you loading the file
you don't, prefix keys aren't needed in take_ownership()
is there a way for a joker to know if its about to be destroyed
When an unenhanced card is retriggered, send it back to hand with [custom enhancement]
yeah thats what i figured (im in a large session of having to take ownership of a bunch of stuff)
same lol
Minigame Idea 1: A memory-like minigame where shoot the moon is mixed with 4 queens, then flipped and shuffled, minigame is won by successfully clicking shoot the moon
just trying to figure it out for the first time
i mean if its like a food joker you can have it just check if the joker is on its last turn, ie add a check to popcorn if its at 4 mult, but i feel like thats not what you're looking for
are you sure the rest of the file is loading
yeah, like if madnes wants to destroy my joker I want to change some gloabl variable (not specifically madness but any destroy effect)
I mean I could override the card:start_dissolve for that specific card, does lua allow that
if card.getting_sliced?
I placed it into my main file and its working now so I guess I didn't load it correctly, thanks!
Minigame Idea 2: Find Cavendish (Find Luigi but with cavendish hidden between many gros michels)
but when do I check it, the card can be getting sliced anytime thats the problem
np
jimbleeding
What is the goal?
you can tell he's evil cause he's using 000 black
I want a card that changes some global variable when its destroyed, not sold
yeah, he went against all localthunk's children
You would probably hook Card:remove() perhaps?
mm maybe check if the card is highlighted on remove_from_deck?
how do i debuff a card outside of context.debuff_card without using perma_debuff
does remove from deck work for jokers too
yes
SMODS.debuff_card(card, true)
if n is still here i would like to point out minor mistake in vanillaremade incantation
thanks
okay i got it to spawn cards but the glitchy effect is still an isue
those particles are there forever
thats my issue
Code?
the for i = 1, card.ability.extra.cards do is missing .cards
SMODS.Booster({
draw_hand = true,
key = "reversepack",
atlas = "Booster",
pos = { x = 0, y = 0 },
discovered = true,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.choose, card.ability.extra } }
end,
config = {
choose = 1,
extra = 2
},
cost = 4,
weight = 1,
kind = "reversetarot",
group_key = "k_yip_reversetarot",
create_card = function(self, card)
return SMODS.create_card({
set = "reversetarot",
area = G.pack_cards,
})
end,
ease_background_colour = function(self)
local choices = {
HEX("a56767"),
HEX("773e3e")
}
local color = pseudorandom_element(choices, pseudoseed("reversepack"))
ease_colour(G.C.DYN_UI.MAIN, color or HEX("a56767"))
ease_background_colour({ new_colour = color, special_colour = G.C.BLACK, contrast = 2 })
end,
})
this crashes the game
Log?
Does anyone know how I would go about this?
bump
That seems quite complicated.
I would suggest looking at 6th sense code to reference destroying the card
Are you giving it a card that exists?
Yea, I passed out last night before i could finish getting help with it tho, so I thought I might as well ask at least once
i should be if i'm looping through G.hand.cards, no?
bump
Firstly, you would probably patch/hook SMODS.calculate_repetitions, Secondly, you would probably patch/hook G.FUNCS.draw_from_play_to_discard()
im trying to make a joker that gives some mult when a stone card is scored, but it isnt adding the mult, any ideas why? i addapted it from the walkie talkie example
local shell = SMODS.Joker {
key = 'Shell',
loc_txt = {
name = 'Shell',
text = {
"Each played {C:attention}Stone Card{}",
"gives {C:mult}+#1#{} Mult when scored"
}
},
config = { extra = { mult = 4 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult } }
end,
rarity = 1,
atlas = 'crabro',
pos = { x = 2, y = 0 },
cost = 4,
calculate = function(self, card, context)
if context.joker_main then
if context.individual and context.cardarea == G.play then
if SMODS.has_enhancement(context.other_card, "m_stone") then
return {
mult = card.ability.extra.mult,
card = context.other_card
}
end
end
end
end
}
Remove the joker_main check.
bumo
is there a way to prevent a joker into being debuffed by the blind?
does G.P_CENTER_POOLS.Joker include modded jokers?
Yes.
Put skip_materialize = true into SMODS.create_card
Idk what hooking is...
In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...
What are you trying to do?
ohhhh i finally found context.hook. this works now, but it only selects cards up to the card selection limit. is there any way to bypass this
You could change it temporarily?
smods has a new api for that, right? not sure how to use it
Could you have it select a single card in hand, discard it and then repeat for the length of your hand?
No, you change the highlight limit then change it back, you can still force discard.
pre_discard effects would trigger for all cards instead of just once then
i know, i meant i don't know the new variable for changing the card selection limit
Can I ask what the code would be?
local thunk = G.hand.config.highlighted_limit
G.hand.config.highlighted_limit = 1e6
-- Discard cards...
G.hand.config.highlighted_limit = thunk
Are you trying to prevent a specific joker from being debuffed?
How can I get the edition of a Joker?
card.edition and card.edition.key
So to check for negative it would be card.edition.negative?
That's not what I meant but yes, that would still work.
hi sorry, what exactly is context.main_eval
It's the same as checking context.cardarea == G.jokers
ohh, thanks
nvm im stupid but thanks anyways
I’d use context.individual and count triggers of cards to flag it to be enhanced and sent back
my friend meant smth else when he said "always active"
Shouldnt this code give a 1/5 chance of destroying a stone card when triggered or did I mess something up
How would I count the triggers, tho?
context.destroy_card not context.individual also context.destroy_card not context.other_card
alright thank you
bump?
basically it's supposed to call that custom function once there's a joker next to it
instead it calls it by itself the moment the blind starts like a billion times
how can i fix
this works but i'm pretty sure it's keeping cards that get selected by me highlighted even when they're in the deck, causing weird behaviour
What can I use to refresh/reopen the ui that is currently open? (In the settings)
This might be the only way I can get my visuals to update 😅
I’d just store the id of the card and check if it’s the same or not
I'm still confused, check if what's the same or not?
how do i force all highlighted cards to deselect?
G.hand:unhighlight_all()
the highlighted cards are in the deck
G.deck:unhighlight_all()?
that shouldn't happen but it does, so i'm using a hacky solution
The id of the card in context.individual, it gets called for every repetition
I have a Boss Blind that forces the entirety of the first drawn hand to be auto-played, would that be of any reference help?
So if you store what it is in your joker, you can just check if it’s the same as the current triggering card, which would imply a retrigger
doesn't work. i know it's a highlighted card in the deck because the poker hand won't show until played (flipped card highlighted) and it gets pulled from the deck when i play the hand
So I just store every time that context.individual is called and if it's more than 1, then I activate a flag to bring it back to hand in context.after?
Hate to bother but do you know if theres a way to still have it trigger for each card individually or is it a one or the other situation
it functions properly after replacing those two but its visually difficult to tell what its doing
You could have it gain the xmult in context.individual then destroy it?
No youd need specifically the id of the card in that context
I'll try that
I think I got it, I'll try smth and brb
spawning negative consumables (using SMODS.create_card({})) finally works but for some reason they don't have "use" button and do not return to consumable slots when dragged around?
use add_card instead no?
Change SMODS.create_card to SMODS.add_card
Works now, thanks
if I want to find what Jokers the player has, I use next() and pass in the card area and the Joker's key, right?
No.
next(SMODS.find_card("j_modprefix_key"))?
ok, thanks
Code might be helpful here
hold on let me get it
what does context.retrigger_joker_check do?
You install the lua extension.
yea i have it installed and its not telling me anything
i think its somewhere around here
It's because your file is not in the lua language.
the file is a .lua
Yes, but the language is not .lua
how do i get if a card is in a certain cardarea?
how do i make it lua
(as in not in collection to be specific)
if card.area == area
I wanna make a Joker that gives itself mult if a discard only contains heart cards. How can I detect if there are only heart cards being discarded?
how do i check if a scored card or joker is foil?
card.edition.key == "e_foil"
check if card.edition exists first
ok thanks
what about for jokers?
Show your entire code window.
card is a joker if youre in a joker's calculate
i accidently used regular visual studio my bad
as i see thanks
damn my code has a lot of syntax errors
hi! i have a bug with my Copper Grate cards, where if you play a Weathered Copper Grate card with an Oxidised one, both get destroyed
this only happens if the cards are the same rank and suit, and i know why this is happening — the Oxidised card is destroying both, as they're identical cards
tried a run with only jokers i added
That's one mythical looking scholar
thats an upgraded scholar
my idea is theres gonna be a consumable that u can use on various existing jokers to upgrade them into Attuned Jokers
im gonna call it like The Rune or something
what context should I use when the player acquires a new joker
I, in fact, did not have it
if context.card_added and context.card.ability.set == "Joker"
itd be obtained from spectral packs or buffoon packs, like how black hole is spectral/planet and the soul is spectral/tarot
(bump)
u could set a variable in the card's config
then check for the variable
if ur not already doing that
if u are then idk
Try using card.ability instead of self.config
Log?
ohh wait yeah if ur using self.config to tell the game information about specific instances of a card that probably wont work
sure, hold on
ah, no that's only to access the primed variable of the Oxidised cards
which i added so Weathered cards don't self destruct once turned into Oxidised cards
as iirc the destroy_card context comes after final_scoring_step
do you need primed to be different between different grate cards
okay so the way i'm using it
when a card becomes Oxidised, its primed variable is false
and it's only true if context.before happens, and it'll only self destruct if primed is true
if you want multiple of your cards to have different values of the same variable, then youd need to access that variable from card.ability, otherwise if im not mistaken it will only access the default variable you set in Joker:config
Start a new run if it crashes
Yes, and if there is another one that just turned primed to true it will destroy itself even if it hadn't changed yet.
it will assume that every single instance of your joker contains the default settings
gotcha
ah i see
ya also, testing revealed that i was wrong about the cause, as different cards also don't function properly
also, if you update the default value, it wont change the value of an instance of ur joker mid-run
you'll have to sell your joker and spawn a new copy
Yes, because two cards cannot be the same, because of sort_id and other properties.
Whenever you modify config you have to start a new run, otherwise they'll keep the old config they had
^
well wait cant u just spawn a new copy of the joker
or am i mistaken about that
am I able to get any information about that specific card after adding? like I want to modify their config by giving them extra mult if a card that gives mult is acquired
ah i've got it working now :D
you're not mistaken, but saying starting a new run is easier
No, because it is self.config
thanks :D
congrats !!! :D
After modifying the code they mean
How would i add a counter to all cards using a joker?
i still love how these look :3
woah those are amazing
You mean adding a property to all cards or counting how many cards in the full deck?
btw did you get your thing figured out?
the bug
I might make the suit a little brighter though, I have a little trouble with the first two in particular
the former of the two
ya, it was as ENNWAY said, i was accessing the wrong thing ^^
Minecraft? In balala??
for k, v in pairs(G.playing_cards) do v.count = true end
ty!
bump
Yes.
and how would I do that
if context.card.ability.mult > 0 then context.card.ability.mult = context.card.ability.mult + number end?
You cannot check that the card would give mult.
Or where it would be.
I tried that but card refers to this Joker, since I have this code inside of a calculate function
ideally I'd be using other_card or something but nothing I've tried has given me the results I want
got needled
No, context.card is the card added.
solid
context.card
I forgot to scroll down
happens
I get this crash notification when I use the card, any way to fix this?
need some help with creating a Booster Pack type
one that contains specific jokers, and has two variants, a Jumbo variant and a Mega variant
i'm saying this because VanillaRemade doesn't have a page for boosters
That didn't seem to work...
I was right the first time, still the same crash
did you start a new run
I wanna make a Joker that gives itself mult if a discard only contains heart cards. How can I detect if there are only heart cards being discarded?
same crash
uhm, from what i see the cards will only have the count if you select a blind while you have your joker
"ability" is nil somewhere in here apparently (i think i may know where it is but have no clue what else i could put there)
Does anybody know if there is a function in SMODS to change the sprite of a joker with an event?
There is not.
yep, that was the issue, ty
Thanks for the quick answer
How do I make it so a booster pack only has a select type of Joker
like what type for example?
how can i get the count for current and max amount of hands and discards?
In the round or what they reset to after?
i'm pretty sure i can just use the mod prefix to isolate certain cards since that's what i want to get
both
Thats G.GAME.round_resets.hands and G.GAME.current_round.hands_left respectively
make an objecttype instead
then in create_card you can return { set = "modprefix_key" }
thanks :3
yw
yup this is def the problem area (and i gotta try to figure out how to fix it)
Can you hook the object init functions?
Yes, I'm pretty sure one of the SMODS examples does it
Do you know which one off the top of your head?
guys, how can i learn how to read crash logs 😭
that looks fine except for the context.other_card bit
all im doing is modifying a localization file
yeah, that's what the error message said
You forgot to close a bracket or put a comma in your cs.lua file
Ohhh sorry, this wasn't what I mean
idk enough about lua to know what to do with it, tho
uhh... does it say where?
The init function for the object class in the vanilla code. Last timeI tried I had some issued b/c the initialization stuff is like slightly more complex or smth? Idk
about Line 3264
I could just try it again
just keep if context.pre_discard and not context.blueprint
youre a godsend thank you
that's it?
yeah
Yeah you should be able to capture CardArea.init in a variable and use it as a function just like a regular hook
init_game_object is not the same as the init on an object ironically enough
the reason I was curious is becase init_game_object is a more specifed function, whereas CardArea:init is layered multiple times on the object init functions and does some metatable bullshit
That's fair, I have too little lua knowledge, sorry
oh sorry my brain just autocorrected lol
:is_suit("Hearts")
so
would i list every joker in my mod under the ObjectType's "cards" parameter?
yes
i do it automatically in my mod if you want an example of that
wait no nvm my example doesnt work with other mods i changed it
Basically I'm having to do some fun surgery to see if I can have hidden cards in the Joker slots be calculated as if they're regular jokers and minding the event queue, while never visibly displaying them (because they represented by a different card that sits in the consumeeable slots)
Weirdness on weirdness
But I'll figure it out
good luck
Anyway I hope hooking CardArea:init doesn't cause something to blow up
like
j_modprefix_key1 = true
j_modprefix_key2 = true```
etc. etc.?
yes
does nothing
G.hand.highlighted[1] not G.hand.highlighted
Not only that but I'm pretty sure your if check is scuffed
if #G.hand.highlighted == 1 not if G.hand.highlighted == 1
the game doesn't crash anymore, but now it gives mult whenever I discard a hand that has any heart cards. I want it to give mult when the discarded hand only has heart cards
uhh let me reread the logic
heart_cards >= 0 should be only heart_cards > 0
yeah, I caught that too
it doesn't change this problem, though
whats the current code (ive done this before with played hand)
if you discarded 2 spades and then 3 hearts it would count as 3 heart cards cause it checks each card individually
ahh
maybe you could use some sort of bool value if the card is not a heart then set it to false so it doesnt add the mult
ok yeah i see that
for the entire discarded hand
Yeah just a bool, for loop and return if
gotta figure out how to use bool values then :D
wait, are they just true or false?
Make it true by default, if something is NOT hearts, set it false.
If it's still true, return x_mult
yea lol
local has_only_hearts = true
for _, pcard in ipairs(context.full_hand) do
if not pcard:is_suit("Hearts") then
has_only_hearts = false
break
end
end
Yes, bools are either true, false or nil
nil is not bool
anybody know how i could scale mult on a joker when food jokers are fully consumed and destroyed throughout a run
kinda like throwback
Check the cardarea on context.destroying_card
maximus has a similar card (leftovers), poke around and see what they did
i think they want it to be retroactive as well, you'd probably need a global variable of some kind
context.destroying_card is to destroy playing cards, not to check cards destroyed
Is it not?
no
why does this result in cards being selected in the deck after a discard