#💻・modding-dev
1 messages · Page 287 of 1
hmm
is that enough to get balatro in an initialized state?
i want to make sure that if i i.e programmatically launch a game im launching it in a well formed state
im not sure, you can check Game:main_menu
idk what initialization balatro needs at first
?
Game:splash_screen too
are they functions or variables?
not for you
functions, they're in game.lua
ah ok
i mean actually reading them not checking for them
trying to compile asprite got me installing a ms c++ compiler
I don't know because this is my first time doing this.
all this to save 20 dollars
never made a malverk texture so I can't really help with that
oh wait i can just also check for !splash
Who does?
is there a way to make it so that when you play, you don't lose one of your remaining hands? or would it just be easier to give yourself a hand whenever you play one
do i need loc_vars for a retriggering card?
tried it in there.
waiting
can anyone explain why this shows the message but doesn't repeat the score?
you need to define it in G.ARGS.LOC_COLOURS for that
i recommend using SMODS.Gradient instead of patching tho, it also automatically adds it to loc_colours
oh neato
i think it needs to be in context.repetition
i think it's modprefix_key
help. pls.
what smods version do you have?
it worked for me but it needed to be in lowercase
what needed to be in lowercase?
the key
0315b
it was added in 0323a
i caved and paid for asperite
rq whats the sprite size of blind icon
Show your card code
This was using a basic card.
34x34 i think
in that case how do i add it manually
much love from Andrew tate ❤️
you can update smods or do this
Here's the crash log.
yea no it works now i just cannot count
i do not want love from tate thank you
Wait are you a mod dev? If not I don't think you're in the right spot
what would the SMODS.add_card be for creating a random playing card?
...I may have just 98%-ed myself 😭
I made mods for the old-calc version
not that
it doesnt support playing cards
ah
what would the create_playing_card( ) be to just make a random card
just that iirc
dont quote me tho
i think you need to create a random for each element, but try that and see if it works
i dont think so
you can just use and
heres my code for it https://github.com/nh6574/JoyousSpring/blob/afd2ccbcfc78f34f7d15a559bbf60f94de97afb9/src/effects.lua#L167
"my code" "vanilla"
i think you can infer that i copied it from vanilla code
hmm
maybe not let me check wwith something else
yeah it works for me but doesn't emplace it unless you do create_playing_card(nil, G.hand)
G.hand can be any card area btw
how do you make it only go in hand?
G.hand
Oh you meant you can replace that with any card area
yea
I thought you were saying that can appear in any hand and I was confused lol
hmmmmmmmmm
Anything is an exaggeration cause it's not a complete meme joker (if it were fully a meme joker I'd have 'anything' include, say, instantly winning the blind, or crashing the game), but it can do a lot of different things
im sad that u dont use {C:dark_edition,E:2} 💔
huh?
What is wrong? Why doesn't it load?
why doesn't what load
for the anything text replace the colour for it with that
oh nice
we got url files now??????
this is the error message
whats your code
alttexture.lua is this
Had some random inspiration!
yugioh mod vs THE yugioh mod...
Yeah I should have put that on my Ghost Rare or Secret Rare decks, instead of my own custom edition
Get all five joker pieces and then just auto win everything, lol. Or maybe it retrigger all cards five times, to make it less op
someone did an exodia mod
Draw all parts of exodia into your hand wins the bilnd
🆙 btw if folks haven't tried it, his/her mod is amazing!
hmm
oh cool, instead of doing exodia as jokers, do it as custom card enhancements
what is the way to access nodes in a global UI element? i have UI elements in a table, and i want to remove the table nodes to remove the Sprites that are in them.
local node = {n=G.UIT.R, config={align="cm",maxw=4, maxh=0.5},nodes={
-- animated sprite nodes go here
}}
-- the UIE is a UIT.ROOT node
G.HUD_blind_tracker:add_child(node, G.HUD_blind_tracker:get_UIE_by_ID('blind_tracker'))
there will be 3 subnodes in the node object and i want to update them in another function. how do i access them?
Can someone help with me?
lovely, malverk, and steamodded should be in the Balatro mod folder?
Yep! You should have Lovely's version.dll in the install directory for Balatro, and your mod content + steammodded should be in the mods folder
It is.
Try taking your content and copy and paste it somewhere safe. Then delete from the mod folder and restart Balatro to see if it still errors. Try to isolate the problem
nothing
it has to do with the files somehow
What file is it?
hmm
FoxDeploy?
WHat should I do next?
step 1 : move your files out
step 2 : does it still crash?
step 3 : move your stuff back in bit by bit
step 4 : eventually you will uncover exactly when the crash comes back
now you know where to look
Malverk-main is the file
but where in the file, FoxDeploy?
hmmmm
I don't know. what, do you know FoxDeploy?
or someone else
okay so would making a random rare joker be SMODS.add_card({set = "Joker", rarity = 3})
or is there a specific set for rare jokers
I don't know Malverk, sorry.
But try to see if Malverk itself works without changes
So it is the code I added.
The error message implies that somewhere, you're not returning a table valu, but instead a string
here's the difference
lua
local iAmAString = "my strval"
local table = {"hello}
AltTexture({ key = 'myprefix_F deck', -- the key of the texture set = 'Cards', -- define the object type that you are retexturing, see wiki for full list of types id = "foxtrotdeck", name = "F deck", path = '8BitDeck.png', -- the filename of your spritesheet, saved in assets/1x AND assets/2x loc_txt = { -- [NYI] Localization text for tooltips displayed in the texture selection screen - can be added to a localization file under [descriptions][alt_texture] name = 'F Texture', text = 'Cards are different' } })
I would start by looking super closely at examples from Malverk and double check syyntax
I would let a malverk expert help
I'm having trouble with programming... The first part and middle work fine, but the last part isn't doing quite what I want it to? It ends up destroying all the heart cards in hand, and not just the ones played. Admittedly I don't really know what I'm doing
Weird, I am correctly counting all of the Jokers of matching edition in my deck, but for some reason my loc_vars in the description doesn't update
...
try swapping the context to G.play to see if that helps
Sorry, I don't know Malverk. Maybe take some rest, have a nice night and try again tomorrow.
I don't know Malverk or lua
I'm not really sure what you mean, Like this?
I'm bumfuzzled/foxed
I think they meant change it to context.cardarea == G.play
does anyone know where in the code is the function to close a booster after it's done being used?
i found card:open()
there might be an easier way to do what i'm trying to do but i feel like i'm pulling on a thread that's getting longer and longer
What are you trying to do?
i'm trying to make a consumable that shows you a selection of consumables and lets you pick one to delete from the run permanently
Have you figured out how to delete it?
so what i'm gathering for now is that i have to create a card area for the consumables similar to the one created for a booster
What if you made It open a booster pack?
i haven't but i think that would be the easiest part, i think i'm gonna save a table of all banned cards and patch create_card() so it retries if the selected card is one of the banned ones
how would I make balatro bluescreen your pc
You could look at cryptid's delete code card.
could just ban the cards like how challenges do it
that's what I did for my joker only deck
true that sounds easier
holdon lemme check where you have to put the key
does nayone know what the arguments of Sprite() are?
G.GAME.banned_keys
i thought about that, the thing is that if i add a booster pack with smods it would show up in the collection and the shop and stuff
so i would ideally want a dummy booster that doesn't show up anywhere
that's what i'm gonna do for sure
man im so confused
You could remove it from the pool and set no_collection to true.
for some reason my code increases a joker's atk by 4% when i put it 2%
Set it to 1%
Solved
fair point
that sounds way easier, i wonder if it's gonna cause problems if i open a booster pack while inside another booster pack, or while playing the game, might have to ban the card from the shop
gonna try that thank you so much!
fortunately, it was just a visual bug ❤️
how does one go about indexing unlocked hand types?
for k, v in pairs(G.GAME.hands) do
if v.visible then
--- do things
end
end
????
this will make it work in the first hand of the round only right
shouldnt it be 1?
im actually not sure when that gets increased
if its immediately when you play a hand then that will never work
i copied it off trading card so that might be the prob
ok i found a first hand played thing from a different mod
tf does juice card mean
thanks!
Juice_card_until is for stuff like DNA or Trading Card to make them shake until their effect has/can't be activated
i dont know malverk sadly
ah, this one is easy
you did retexturing right?
it was meant to be hands_played not hands_used lol
nop
ok...
what do i put in the if statement that checks that theres no face cards in the played hand
i dont think theres any
but you can go through the whole context.full_hand
if v:is_face(), then the hand has a face card
for i,v in ipairs(context.full_hand) do
if v:is_face() then return end --doesn't run anything below this, basically
end
...
where do i put this in the lua file, not in the calculate function right
you do put it in the calculate function
so like
put it inside the context block
and on top of the return block?
yes
so thisll work now
mhm
nice thanks
now the next part
i found the code used for familiar
now how to slot it into joker code
hmm
This just kinda looks bad but idk what id make it look like
so like i found the part that generates the random card
but where tf do i put _rank and _suit
oh is this in the AltTextures.lua?
what
...
i think SMODS.create_card() doesn't work for boosters
i'm probably doing something wrong but i used the default create_card and it worked
I have no idea how to fix my error.
where the fuck do i put the rng variables aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
holy shit it finally works
creating the card in the return statement is cursed
if it works it works ack
usually you would do
if context.whatever then
-- create playing card
return{whatever = true}
end
what's your error?
oh it doesnt have to be in the return statement?
ive put all the joker effects in there so far
how do i remove a suit from the starting deck? read the wiki but it just confused me a bit
It has to do with this
AltTexture({ key = "myprefix_F deck", -- The key of the texture set = "Cards", -- Define the object type that you are retexturing id = "foxtrotdeck", name = "F deck", path = "8BitDeck.png", -- The filename of your spritesheet, saved in assets/1x AND assets/2x loc_txt = { -- [NYI] Localization text for tooltips displayed in the texture selection screen -- Can be added to a localization file under [descriptions][alt_texture] name = "F Texture", text = "Cards are different" } })
Yes, this
nah, the return table lets you set specific variables that can do different things depending on the context
there's also return { remove = true } for some contexts that let you remove cards
anything else goes before the return statement
https://github.com/Steamodded/smods/wiki/Calculate-Functions
is there a way to make a joker value be duplicated everytime something specific occurs? i have the code for getting +2 mult everytime a blind is skipped, how could i make the mult just go duplicating, like, 2 - 4 - 8 - 16 etc
aarvlo, what is wrong with this?
what error are you getting? i don't know much about retexturing but i can try to help out
if i want to do a number times another will it be number . number or number * number ??
that's the error ^
what are you trying to do with name = "F deck",?
I want to get the textures into the game.
so you want to retexture a deck called F deck?
No, I want to make a deck to retexture the playing cards to F deck
Shouldn't you use SMODS.Deckskin for that?
they're using Malverk
wait hold on
i don't see your mod in the modlist
@iron haven
SMODS.Deckskin is for playing cards.
Like friends of jimbo.
But for all ranks.
is there something wrong here?
ohhh yeah just do that @iron haven https://github.com/Steamodded/smods/wiki/SMODS.DeckSkin
does malverk not work for cards?
@iron havenhttps://github.com/Steamodded/examples/blob/master/Mods/DeckSkinTemplate/DeckSkinTemplate.lua here's the example mod in SMODS that covers DeckSkin if you need more help
so...
where do I put that?
In your main file.
?
do you have your mod folder set up?
there is a mod folder
i mean for your mod
?
In your mods folder.
Where is your mod?
I added a folder
In your mods folder?
yes
How do I check the amount of cards discarded?
The current run or current round?
bump
I think during a discard, #context.full_hand is the amount of cards discarded.
do this: @iron haven
- Remove malverk since you won't be using it
- Download this example mod pack and unzip it https://github.com/Steamodded/examples/tree/master
- Find the DeckSkinTemplate folder
- paste it in your Mods folder, this will be the template for your mod so you don't have to make it from scratch, you can change the names of the folder and the files inside if you want
- Read this https://github.com/Steamodded/smods/wiki/Mod-Metadata this will explain how to format the .json file you will find in the folder to fit the needs of your mod
- Read the .lua file so you familiarize yourself with SMODS.Atlas and SMODS.DeckSkin, here is the documentation detailing how they work https://github.com/Steamodded/smods/wiki/SMODS.Atlas https://github.com/Steamodded/smods/wiki/SMODS.DeckSkin
- change whatever you need to change to fit your mod
If you get lost along the way feel free to tag me, if i'm still awake i will respond
second question, what is the way to add/remove money in scoring?
You can either use ease_dollars(number) or return dollars = number
Both work for negative numbers I think.
is there a way to make keep_on_use not send the card to your consumable slots and then emplace it somewhere else?
i think what i'm doing is just an insane hack that steammodded wasn't built for
or balatro for that matter
Are you talking about that consumable that removes conumables completely?
yea
so I'm on step 5.
i was trying to put the used consumable back in the dummy deck but it doesn't seem to work
You could try looking at pointer and check what name is inputed and check if its one of how many choices of consumables.
i think i'm just gonna create a dummy consumable with the same texture
that does the actual card removal
and is only summoned in the dummy booster
yeah i think the create_card function doesn't let you put existing cards emplaced somewhere else back in the pack
i mean it wouldn't make sense to do that outside of my niche case
do you have any questions so far?
Do I make a JSON or edit the JSON or Lua script?
edit the JSON file that already exists in the example mod and put in your mod info, you can delete the existing one and make it from scratch if you want too
hmm
so
you will not be using the AltTexture code you made, that is from malverk and it's unfortunately not capable of replacing cards
what else do I add?
it looks too chonky compared to the actual consumable cards
that should do it i think
i can't find the documentation for SMODS.ConsumableType
does it not exist
ok im just gonna look at some other mods that use it
Don't I have to add the file to 1x and 2x?
that probably depends on what app ur using to make em
ok now?
in aseprite it's easy
just make the canvas twice the size then select your original sprite and resize it to the entire canvas
in photoshop/gimp/krita it's probably similar
I'm pretty sure there is an extension that does that automatically.
I did that. Now what do I do?
it isn't there.
What do you mean?
Show your mod folder.
No, your mod folder.
kinda expected it to be going down than up
The mod thats not showing up.
in examples-master?
Yes.
I replaced the template. fyi
you need to take the folder of your mod out of examples-master and paste it into the Mods folder
FDeck.
and delete examples-master
hmmm
oh
(263->) if context.retrigger_joker_check and context.other_card ~= card and context.other_card.ability.extra and context.other_card.ability.extra.is_jet_joker and not (context.other_card.ability.name == 'SUPCruise' and context.other_context.end_of_round) then
return {
repetitions = 1,
message = "Refuelled!",
}
end
end```
It is there but the cards didn't change.
You need to check if type(context.other_card.ability.extra) == 'Table'
You need to change the main file.
what is in the .lua file?
`local atlas_hc = SMODS.Atlas {
key = "skin_hc",
path = "skin_hc.png",
px = 71,
py = 95,
}
local atlas_lc = SMODS.Atlas {
key = "skin_lc",
path = "skin_lc.png",
px = 71,
py = 95,
}
local icon_lc = SMODS.Atlas {
key = "icon_lc",
path = "icon_lc.png",
px = 18,
py = 18,
}
local icon_hc = SMODS.Atlas {
key = "icon_hc",
path = "icon_hc.png",
px = 18,
py = 18,
}
SMODS.DeckSkin {
key = "example",
suit = "Hearts",
loc_txt = "Example",
palettes = {
{
key = 'lc',
ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",},
display_ranks = {"King", "Queen", "Jack"},
atlas = atlas_lc.key,
pos_style = 'deck',
suit_icon = {
atlas = icon_lc.key,
},
},
{
key = 'hc',
ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",},
display_ranks = {"King", "Queen", "Jack"},
atlas = atlas_hc.key,
pos_style = 'deck',
colour = HEX("9734f0"),
suit_icon = {
atlas = icon_hc.key,
},
},
},
}`
that ^
right, now to options > customize deck and see if your skin shows up
fr? it was working earlier... oh well
Here’s how my first joker went! It was annoyingly enough the simplest one I came up with, but it still resulted in a lot of bug fixing thay took longer than the original programming itself… despite that it’s actually a lot of fun to play! Balanced? Nah. That’s why it’s Cryptid Inspired. I’m planning to also add Kinito, PAL, Wheatley, GladOs, and like- maybe a few others? But also it’s a solid Joker on its own tbh. How do I uh- make it available to download? I’ve never gotten this far on a project before ngl-
That's because most vanilla jokers use card.ability.extra for number values.
oooh
I think it’s sick as hell
I like how it kinda has a subtle parallax effect to it? Due to the letters in the center being smaller? It kinda looks like a hallway a little bit it’s awesome
What is the name of your sprites?
8BitDeck
in SMODS.Atlas you need to change the png files to the ones you want to use
renamed them to FDeck and FDeckX2
`local atlas_hc = SMODS.Atlas {
key = "skin_hc",
path = "skin_hc.png",
px = 71,
py = 95,
}
local atlas_lc = SMODS.Atlas {
key = "skin_lc",
path = "skin_lc.png",
px = 71,
py = 95,
}` these?
the key?
oh the path
ok now?
`local atlas_hc = SMODS.Atlas {
key = "skin_hc",
path = "FDeck.png",
px = 71,
py = 95,
}
local atlas_lc = SMODS.Atlas {
key = "skin_lc",
path = "FDeck.png",
px = 71,
py = 95,
}`
run the game and see if it throws an error, make sure both the 1x and the 2x files have the same name
and make sure they are in their respective folders
assets > 1x
assets > 2x
It is on only the hearts
yeah
SMODS.DeckSkin { key = "example", suit = "Hearts", loc_txt = "Example", palettes = { { key = 'lc', ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",}, display_ranks = {"King", "Queen", "Jack"}, atlas = atlas_lc.key, pos_style = 'deck', suit_icon = { atlas = icon_lc.key, }, }, { key = 'hc', ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', "King", "Ace",}, display_ranks = {"King", "Queen", "Jack"}, atlas = atlas_hc.key, pos_style = 'deck', colour = HEX("9734f0"), suit_icon = { atlas = icon_hc.key, }, }, }, } How do I do it for all the suits?
you need to make another SMODS.DeckSkin
and change suit = "Hearts",for the next suit
basically copy all that
and make it the next suit
and so on until you have 4
?
in the code?
in the image
hearts clubs diamonds spades
can you send me a screenshot of your lua code
change the key on each DeckSkin so it's a different one
do I do the ones in pallete or no?
no not those
ok
then just run it
ok
[thanks, on his behalf :)]
Lmao
Omori reference?
hey guys how would one find a jokers position in the card hand thingy? I'm looking to make a joker to retirgger other jokers to thr left and right but I'm struggling with finding positions... :(
You’d loop through G.jokers.cards with a standard for i=1… loop. When G.jokers.cards[i] == card, store the value of i somewhere and use that as the baseline of where your joker is located
ok i finally managed to create the boosters but my brain is fried
forget that if you saw it i'm stupid
omg tysm youre a life saver!!
Now the joker doesn't make the game crash, but it doesn't work either
Show your current code.
key = 'ACarrier',
loc_txt = {
name = 'Aircraft Carrier',
text = {
"Retriggers all {C:attention}Aircraft{} type Jokers",
}
},
rarity = 2, -- Uncommon
atlas = 'AircraftCarrieratlas',
pos = { x = 0, y = 0 },
cost = 5,
loc_vars = function(self, info_queue, card)
end,
calculate = function(self, card, context)
if context.retrigger_joker_check and context.other_card ~= card and type(context.other_card.ability.extra) == 'Table' and context.other_card.ability.extra and context.other_card.ability.extra.is_jet_joker and not (context.other_card.ability.name == 'SUPCruise' and context.other_context.end_of_round) then
return {
repetitions = 1,
message = "Refuelled!",
}
end
end
}```
I assume I've implemented the new condition wrong
You should check if extra exists before checking what type it is.
How can I retrigger Jimbo at the end of a run?
hmmm
just discovered something
it doesn't trigger hologram
actually does DNA trigger hologram?
🙂
It returns playing_cards_created = {true}
guess i just add that to the return block then?
so it triggers hologram
do you guys like this?
I think so.
I kind of got this done but how do I make it say Again!?
message = 'Again!' or something like that
It doesn't work like that.
4 hours later here is all i have to show for it
What are you trying to do there?
You're trying to put a consumable in G.hand?
yea
i might need to create a new card area
fuck my chungus life
copied the code that draws cards into hand and replaced it with hex hoping it would just work
it doesn't
Wouldn't ```lua
local card_ = create_card("Spectral", G.hand, nil, nil, nil, nil, 'c_hex')
card_:add_to_deck()
G.hand:emplace(card_)
hmm
i don't wanna add it to the deck tho
i just wanna show it temporarily
i would just remove it afterwards right
but i don't want it to show up in the deck summary
It wont count as a playing card I don't think.
what about
local card = SMODS.create_card{key = 'c_hex', area = G.hand}
G.hand:emplace(card)
tysmmm
ok now i need to make this happen only once
i don't know if update_pack is the right function
What would happen if you put it in create_card?
ok i tested this and i think it works even better
pain !
how does one retrigger a joker? like blueprint does
There is a difference between blueprinting a joker and retriggering a joker which one are looking for?
uhm I'm trying to make a joker that copies the jokers to the left and right IF both are copiable
so blueprintable I think
You could do ```lua
if G.jokers.cards[i] == card and G.jokers.cards[i+1] then
return SMODS.blueprint_effect(card, G.jokers.cards[i+1], context)
end
And ```lua
if G.jokers.cards[i] == card and G.jokers.cards[i-1] then
return SMODS.blueprint_effect(card, G.jokers.cards[i-1], context)
end
It would have to be all in one return though.
here is my code at current (I MIGHT be new to lua) sorry for low dhitty quality I'm at school and disc is banned unless you have a vpn 😪
context.other_card cant be both the joker to the right and the left.
so I'd put both of the code you sent inside a for loop?
I think.
stupid question but how do you check if a jonkler is blueprint compatible?
Put this in the update function ```lua
local other_joker = nil
if G.STAGE == G.STAGES.RUN then
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i+1] end
end
if other_joker and other_joker ~= self and other_joker.config.center.blueprint_compat then
card.ability.blueprint_compat = 'compatible'
else
card.ability.blueprint_compat = 'incompatible'
end
end
I'm sorry I'm rly new to this, I dont have an update function and I wouldn't know where to put one...
Just put update = function(self, card, context) above your calculate function.
okay I implemented this !!
does that not only account for the right joker tho?
You would have to set a different variable to the left joker.
ah okay!
in calculate would i do an if to check if both left and right joker are compatible?
No because in jokers its copying if they aren't blueprintable they will have not context.blueprint everywhere and blueprints will not activate
but would that lead to one of them being activated when the other isn't compatible?
You probably would have to check then.
okay I'll do some testing, thanks for all the help tho! I can't thank you enough !!
im confused on how the text colour works for suit, how would i use a colour tag (like C:mult) with this suit
i give up for today
gonna continue tomorrow
i was so close too but my brain is cooked
you mean in loc_txt?
the same as any other loc_txt
no like if i had a joker that gives "+x mult for each card with Leaf suit" then what colour tag would i use to colour it
i think steammodded patches G.C.SUITS
to add your suit
okay so hey as soon as I get the joker during the run (not the collection) the game crashes at 45, am I being stupid?
You need to check that both a joker to the left and right exist.
ohh
i think the color tag would be G.C.SUITS["prefix_YourSuit"]
but i'm not sure exactly how the key is formatted
played cards with {G.C.SUITS[prefix_Leaves]}Leaf{} suit give +x mult when scored
or no curvy braces for the tag
no hold on
there might be a better way to do it but here's my solution
give me a sec
SMODS.Joker {
key = 'jimbo',
loc_txt = {
name = 'Jimbo',
text = {
"{V:1}Leaf{} card"
}
},
loc_vars = function(self, info_queue, card)
return {
vars = {
colours = { G.C.SUITS[prefix_Leaves] } -- sets the colour of the text affected by `{V:1}`
}
}
end,```
ahhhhh that makes sense
Just look at the Ancient joker 
would if i had the code, i can look at castle in example mods tho
Just check vanilla balatro code
it's the same
would do it if i had the steam ver 🤷♂️
so, i can now spawn the joker in but when i go into it with the blind my game dies and I get this error
but hey atleast it's a different error
i dont have the steam version, dw im not modding for other platforms lol
Try removing context from the update function.
how do you update the nodes that are used in an UIBox? do you update with a new table or do you access them via get_UIE_by_ID to update/delete?
like i have 3 nodes that make up a table and i want to delete them it updates
G.HUD_blind_tracker:get_UIE_by_ID('tracker_small').remove()
^ something like this
:recalculate()
does that work with the removing of nodes? it didn't seem to update
it should
also it should be :remove()
Removing node doesn't require recalculate by itself
Why does this not put a seal on every card in a pack?
I tried that but feel free to look at the github
Because ipairs, not pairs
Lua moment
Still doesn't work.
Also what is the difference?
pairs for object, ipairs for array
This works and this is in the calculate function.
This doesn't crash just because G.shop_jokers.cards.highlighted doesn't have seal
Use ipairs anyway
wait where in card.lua is this
pairs iterate all keys until first nil, ipairs only integer keys (1, 2, 3 and go on) until first nil
does anyone know what all the contexts are? if that makes any sense lol
This is a deck for reference.
how does context.other_joker work if I'm not too much trouble...
It's for things like baseball card.
ahh, I'm having alot of trouble making a blueprint type joker, do you think it'd be easier to just retrigger jokers instead?
It would.
so another thing to stare at for 3 hours... worth it
this is why you mentally limit the amount of retriggers
well my joker retriggers 2 jokers once but I just cant seem to grasp it..
didnt work for some reason
Try putting playing_card_joker_effects({true}) after it creates the card.
that did it thanks
could anyone point me in the direction of make a retrigger jerkler?
First you need to put ```lua
SMODS.current_mod.optional_features = function()
return {
retrigger_joker = true
}
end
okay that's done!
Then you put this in calculate ```lua
if context.retrigger_joker_check and not context.retrigger_joker and context.other_card == (Right_joker or Left_joker) then
return {
message = localize("k_again_ex"),
repetitions = card.ability.extra.retriggers,
card = card,
}
end
You shouldn't.
You probably should check for blueprint compatibility.
Because not context.blueprint doesn't apply for retriggers.
Show the error.
What does your code look like?
I uploaded it to the git hub
Contribute to fey-fish/jjok development by creating an account on GitHub.
Why did you remove the prefix for the rarity?
oh shit that was me splicing segments of code together a while ago whoops
my laptop just died so I can't fix it rn but could that be the issue?
It probably is because raritys have pools and raritys need prefixes.
you can hit control+c to copy that error from the game. Taking a picture of the error, lol.
can't get on discord on my laptop since I'm in school
Don't know if it was mentioned but retrigger_joker_check has to be enabled also at your mod's base config.lua level
like this?
https://github.com/fey-fish/jjok
this is the git hub if you want to take a look but I dont think it has that...
Contribute to fey-fish/jjok development by creating an account on GitHub.
SMODS.current_mod.optional_features = {retrigger_joker = true}
otherwise SMODS custom handling of joker retriggering does not work. Not related to your error
This does work guaranteed.
well when I get back home to my rig I'll update the pool and make an actual sprite for the joker lol
Looks good to me 🙂
it's in the localization file, in this case english
How does a Glass or Stone joker only appear when you have at least one of those cards? I am trying to implement the same but I didn't see where that is done in the code
enhancement_gate
Does anybody know why when I play a deck it looks like this?
you mean so flat?
Thank you! I thought it was called yes_pool or saomething like that!
are you messing with the card buffer, looks like you only have one card in your deck
you have the flags which are for things like cavendish
Do you have cardsleeves installed?
and pools which are used for card packs and such
normal deck for comparison
I do.
that's why it looks flat. All the cards are stacked in the same spot for the sleeve sprite to not mess with it. You're just not using a sleeve
That's fire
this is a really cool idea
oh hey it all fits
Me when I put every single shape into the square hole
not even close
i should make all the face cards 5s prolly
how do i make a joker spawn a specific tarot card when blind is selected?
Which part are you trying to figure out? There is a context for setting blinds, and smods has a create card function for the specific tarot
context for setting blinds i have figured out im just not sure how to make it create a specific tarrot card
(also great pfp)
i want it to create the highpriestres for example
thank u man 😄
cant really find it in the documentation
I can check the specifics once I'm at a PC, but I'd check documentation or Smods code for SMODS.create_card, which should get you there. I think it's in utilities?
ill check rn
so in the if statment it should be SMODS.create_card("t_highpriestess")
or t_high_priestess
SMODS.create_card{key= "c_high_priestess"}
don't forget to emplace or add_card()
thanks man
wdym
is that to check for avalible slots or?
you gotta tell the card where it's going else it'll be very confused and lost (as in hovering over the card area and not working)
Okay gang what do we think of these legendaries
if context.setting_blind then
SMODS.create_card{key= "c_high_priestess"}
card:set_edition('e_negative', true)
card:add_to_deck()
end
end
}
so far i have it like this but its kinda fucked it spawns it top right and dosent count as a consumable neither can i use it
did card:add_to_deck()
cause i saw that in the perkeo example though i would give it a try
G.consumeables:emplace(card)
I don't love D'acosta as a design there
you can also replace all of that with
SMODS.add_card{key='c_high_priestess', edition= 'e_negative'}
how would i change this pack's offset? my current code isnt working
context.shop_card.children.center.offset.x = context.shop_card.children.center.offset.x - 20 context.shop_card.children.center.offset.y = context.shop_card.children.center.offset.y - 20
calculate = function(self,card,context)
if context.setting_blind then
local card = SMODS.add_card{key='c_high_priestess', edition= 'e_negative'}
card:add_to_deck()
G.consumeables:emplace(card)
end
end
}
it works like this it spawns one but counts it as two for some reason
eaven without e_negative same problem
remove the add_to_deck and emplace
add_card does both of those automatically
add_card without parameters?
add_card automatically emplaces in the correct area for the object key you give it
wheres the documentation on modifying ui? things like an object's offset or scale
im trying to see if im using the right command
there's a UI guide but i don't think it has what you want
https://github.com/Steamodded/smods/wiki/UI-Guide
@red flower
calculate = function(self,card,context)
if context.setting_blind then
local card = SMODS.add_card({set = 'Tarot', key='c_high_priestess', area=G.consumeables})
return true
end
end
fixed it like this thank u for helping out and answering my stupid questions 🫶
ah, yeah this isnt
so then how do i change the alignment/position of cards? things in my shop are offset and i need to realign them
Wow, this maybe goes a bit too hard
@red flower I have struggled so much with making Ghost Rare work with a shader. That effect is just soo cool looking in cards. But my wife pointed out to me that there is some unique art at play, and also custom hologram foil layers in the card to make it possible
I know as a fellow Yugi head, you'll know what it is I am trying to do
how do you check a joker's rarity & edition?
joker.config.center.rarity for rarity
And joker.edition.polychrome/holo/foil/negative for editions
do i use 1 2 3 or 'common' 'uncommon' 'rare'
You would use numbers.
is there one for base edition or would i have to do "not polychrome and not holo and not foil and not negative"
You would do not joker.edition
ahh ok ok
i have never seen a real yugioh card irl sorry
For real!?
That makes your mod even more insanely well done then
This goes soooo well together. This uncommon card, maybe I will make it a Rare, retriggers cards when the hand is a flush.
This custom edition is like the card having it's own built-in hiker!
i still cant figure out how to remove this with the least amount of effort as possible :p
whats with that secret rare description...
Gains +5 Chips when scored
(Currently +5 Mult)
I'm pretty sure it is G.GAME.round_resets.ante
Hi everyone! I wanna make a custom Joker mod but I'm not sure how to get started. I've installed Steammodded and Lovely but I'm not sure where to go from here? Is there a FAQ for creating your first mod and how to access the bit where I can modify game code? Thank you so much!
You would check context.shop_card.config.center.rarity
And not context.shop_card.edition
thanks :D
what's the variable for the small blind? i know the one for boss blinds is G.GAME.blind.boss
oop! found it
G.GAME.blind:get_type() == "Small"
ghost
haihaiii!
Cool, each card has it's own unique id! I was trying to work around the issue of editions not having access to the base.card obj by making a global tracking table to look up the card.
But I was doing that using card.base.id, the effect? All identical card (like Kings of Clubs) would share an increasing perma_mult!!
Is there a way to globally check if a card's sprite is smaller (i.e. half joker, photograph, wee) or would I have to add in manual exceptions
I wanna globally check so that it's modproof
Like, is there a tag that defines it being smaller and I can check that tag?
Oooohhh, you can declare mod level functions and use them in Debug plus!!!
i wanna mod balatro but vs studio keeps giving me the same error every time anyone know how to fix this?
I want to get the in code name for a spectral card that a mod adds so I can make the ghost deck start with it, how do I do that?
lua doesn't work like that
Lua needs to be in your Path. Make sure you have it added to your environmental vars
Google 'Adding Lua to Env Variables Windows'
ive done that already and triple checked it yet i keep facing the same error
it's 2nd of April now
actually TBH I have not tried just running Lua 'hello world' in that context, I am not sure if it should work
@daring fern okay so im back but on my rig this time! it works... but it only retriggers the right joker and im not too sure how to retrigger the left aswell
What does your code look like?
i loaded up balatro again and now it doesnt even retrigger...
Oh while I'm here for the moment something, how did you fix your issue of eternal glass cards staying on screen?
I'm out of the house for the day but I figured I'd pick your brain while you're here
Why is there 0 indentation.
git hub copy and pasting fucked up my indentation
As a minor help you can select all of it, right click, and format selection if in vscode
what do I use if I want to add/subtract money on a joker trigger?
You can either use ease_dollars(number) or return dollars = number
Weird....my edition code does not seem to see info for the card it applied too
For instance, this card has +20 extra chips, but in loc_txt from my edition, I don't see those values. I am trying to do this to support showing extra chips for jokers which have my custom edition
Every time a joker triggers?
yep
loc_txt = {
name = "Secret Rare",
label = "secretRare",
text = {
"Gains {X:chips,C:white}+ #1#{} chips when scored",
"{C:inactive}(Currently {X:chips,C:white} +#1# {C:inactive} chips)"
}
},
loc_vars = function(self, info_queue, card)
return {
vars = {
self.config.chipGrowthRateSelf,
card.ability.perma_bonus }
}
end,
You have to put ```lua
SMODS.current_mod.optional_features = function()
return {
post_trigger = true
}
end
Then you have to use context.post_trigger
okay i auto indented thanks to dilly
thank you!
Did you try printing Right_joker and Left_joker to check that you checked correctly?
i did not.. i didnt know there was a print function lmao
okay so a couple of things, when i change which joker its copying it no longer copies and it still only copies the right joker
I think the problem is you need to do (context.other_card == Right_joker or context.other_card == Left_joker)
My mistake.
IT WORKS OMG
THANK YOU SO MUCH YOURE THE BEST
but erm, can i get it to say something other than 'again'
Return message = 'message' and it should work
it worked tysm!!
okay ive found what its called in the code but how do I do that? how do I change what consumables a deck starts with?
You would take_ownership of it.
right
so like this as a base?
No, It would be something like ```lua
SMODS.Back:take_ownership('b_ghost',
{
}
)
how would one make the 'compatible' 'incompatible' thing in blueprint description in a custom joker?
check how the loc_vars are set up for vanilla's blueprint, and copy that over!
it's a custom ui node passed to the main_end return key
You put lua main_end = (card.area and card.area == G.jokers) and { {n=G.UIT.C, config={align = "bm", minh = 0.4}, nodes={ {n=G.UIT.C, config={ref_table = card, align = "m", colour = G.C.JOKER_GREY, r = 0.05, padding = 0.06, func = 'blueprint_compat'}, nodes={ {n=G.UIT.T, config={ref_table = card.ability, ref_value = 'blueprint_compat_ui',colour = G.C.UI.TEXT_LIGHT, scale = 0.32*0.8}}, }} }} } or nil in the return of loc_vars
ill have a look ty!
Hi ice my friend
and then I just add this with the consumables I want it to have within the brackets?
yo yo dilly
How goes the movie watching
Have you made an Oppenheimer consumable yet that destroys every played 5 and instead creates a 2 and 3 of the same suit
You would probably put config = {spectral_rate = 2, consumables = {'c_prefix_consumable'}}
good morning chat
Bepisss
helo
I have joker art for it that's sat unused for like a month but I don't wanna make a big bomb joker based on the actual nuclear bombs dropping, haha, so I've been trying to find an alternate effect
Yea I've got no idea lmfao
My only quip is splitting 2 and 3 from 5 there
But that's not super great
I wanna finish up the Codex system and have it interact with that in some way. As a 'solving equations' kinda thing, but I've got no clue yet beyond that, haha
okay so if the key of the consumable is the_8 then I would put in 'c_the_8' ?
prefix in this case isn't an article, but your mod prefix!
do you think there would be a way to do it so that its dependant on two variables instead?
where do I find the mod prefix? just making sure!
I'm editing the files of an existing mod
In the JSON file.
okay I used the correct mod prefix with this being how I coded it and I got this, what went wrong?
What is line 643?
it's SMODS.Back, not deck
whats with everyone having the profile border
yes....finally figured this out! I made an enchantment like Hiker, which makes a card upgrade in chips when scored
Hiker squared baby
If you play a high card, with these two jokers...then it goes really well
I am wondering...is the deck an object I can apply an effect to? I would ilke to render an edition effect on the deck area, to demonstrate that the cards within are all X type
SMODS.Sticker {
key = 'cursed',
atlas = 'tecci_stickers',
pos = { x = 0, y = 0 },
badge_colour = G.C.PURPLE,
loc_vars = function(self, info_queue, card)
return {
vars = {
G.GAME.cursed_rounds or 3,
card.ability.cursed_left
}
}
end,
calculate = function(self, card, context)
if context.end_of_round and context.cardarea == G.jokers and not context.blueprint then
if card.ability[self.key] and to_big(card.ability.cursed_left) > to_big(0) then
if to_big(card.ability.cursed_left) == to_big(1) then
card.ability.cursed_left = 0
G.E_MANAGER:add_event(Event {
func = function()
card:set_ability('j_joker', nil)
card:remove_sticker(self.key)
card:juice_up(0.8, 0.8)
play_sound('foil1', 1.2, 0.4)
return true
end
})
else
card.ability.cursed_left = card.ability.cursed_left - 1
return {
message = localize {
type = 'variable',
key = 'a_remaining',
vars = { card.ability.cursed_left }
}
}
end
end
end
end,
apply = function(self, card, val)
card.ability[self.key] = val
card.ability.cursed_left = G.GAME.cursed_rounds or 3
end
}
``` is there something extra you have to do to get your stickers to show up in the shop? I can reroll like 1 million times and no Jokers will have the sticker.
this brings me back to when i first started my mod
Yes it is
one of hte first things i made was some reverse hanging chad
how could i use debugplus to check the value of G.CARD_W here?
ok good
Sweet! It does not seem to be G.GAME.Deck, do you happen to remember it's handle?
Oh it wss G.deck
how can i set an objects scale to a specific value? Ive only figured out how to change it, but i need to set it
im making something that replaces shop cards with packs, and so i need to scale the cards to the size of the packs:
context.shop_card.children.center.scale.x = 71 * 0.8059 context.shop_card.children.center.scale.y = 95 * 0.8059
the problem is nonstandard joker sizes: photograph, wee, square, and half all warp the pack texture. I want to set it to specifically that value rather than scale it by that value so that way i can fix all of those jokers as well as handle nonstandard joker sizes from mods
I will keep working on this, but so far this route doesn't work
G.deck.children.center:set_edition or send_to_shader
Could you nudge me in the right direction if you have some time, @wintry solar ?
can anyone figure out why my joker isnt displaying with its proper sprite? it WAS working but then i changed a couple things that i cant rly remember about and now its the default sprite and rarity :(
is the atlas the same?
here is the atlas, its the only one
Wow you are really cooking!
omg ty but i have all of you to thank for the help!
I’m pretty sure you just want to make a drawstep that draws the shader on G.deck.cards[1]
Steamodded should add ^mult support like it does with xchips
At least with adding a sound
Talisman does that.
talisman does that
Oop
No it shouldn’t
Good to know
The only reason it added Xchips was to stop everyone asking for it and having many different implementations of it
Cool, I wil give that a try! So far I have managed to enhance my whole deck like so... but it would be cool to have the deck stack of cards itself also demonstrate that it's enhanced ❤️
my heart was so sad when I realized that xChips is that same thing as mult, lol
if i wanted to render an immovable card inside a ui, what is my best course of action? is it to create a card, set the properties i want on it, then do something like this?
{
n = G.UIT.O,
config = {
object = my_initialized_card,
role = { role_type = "Glued" }
}
}
How could I draw a second seal on a card?
uhhm card.config.draggable = false iirc
it might be card.VT.draggable
thanks that's very convenient
will i need to manually set the screen coordinates for the card, or is that managed by setting my ui object's config.object to the card?
not at my desktop so i cant try anything out right now
stickers are so weird. for some reason the label text doesn't change when I set label lua tecci_cursed = { name = 'Cursed', label = 'Cursed', text = { 'Converted into {C:attention}Jimbo{}', 'after {C:attention}#1#{} rounds', '{C:inactive}({C:attention}#2#{C:inactive} remaining)', }, } and the sticker also never gets applied to a Joker in the shop unless I force it to with ```lua
should_apply = function (self, card, center, area, bypass_reroll)
return true
end
you should place it in a cardarea
and put the cardarea in the ui
okay makes sense enough, thanks for your help
oh my god why is needs_enable_flag true by default
that's why it's never in the shop
I have the sprites of the seals moved down but how do I draw them onto a card?
trying to figure out what and not not means right now
self.boss = blind and not not blind.boss
why does it seem like my custom common joker shows up so much more than every other joker, oh yeah and it can have dupes without showman
Did you create the first copy with Debug Plus
It’s the same result as AFAIK
oh shit yeah
but why is it so common
Is there a way I can have text on the side of the screen when a joker is in use?
So that way I can have joker details being shown at all time?
Creating a copy with Debug Plus doesn’t remove it from the shop. It showing up a lot seems like confirmation bias
i remember seeing stuff about weight, do new objects have different weights compared to already defined rarities?
No
Yeah! Although at a larger scale so that viewers could be able to see it easily, like Undertale Chaos Mod
https://gamejolt.com/games/undertalechaos/896330
So that viewers can see a list of things to vote on
There was a Twitch integration Balatro mod
Idk about it though
Oh! I found a UI guide, I think that may help
whats the 'set' keys for planet cards, tarot cards, and playing cards?
like the config.center.set value to check it
I think it’s just Planet, Tarot, etc.
Playing cards don’t have a set I think
Unless the set is named after the center
mmm ok ill have to check the booster pack values then
playing cards are "Default" and "Enhanced"
you get them with card.ability.set
Because you can’t SMODS.create_card then
oh yeah no but theyre called sets too
I see. I had thought they were just Center object types or something
...I think I added too many badges.
is there a sensible way to detect when the player gains/loses a consumable? I'm trying to make a joker that depends on how many consumables you have, in real time
not to toot my own horn but maybe something like this would be better?
Couldn't you check #G.consumeables.cards?
#G.consumeables.cards
What's the real time part of the effect? Does it only matter when the effect triggers? Or does it trigger when the consumable count changes?
in particular, this is the mechanic
#G.consumeables.cards should work then.
It'll be inefficient, but not in a way thatll impact performance, but I'd just make it set that every context check
that sounds like a bad idea
it would do that in update, i think that one is justified
i'd rather have it trigger only when a consumable is added/removed, otherwise keeping track of the hand size value itself is a bit of a nightmare
How so? You could just have it set the extra hand size variable, no?
That exists in every context, even in the shop
glsl can make bocchi
i mean you can do it on a consumable being used or sold but that might not take into account other mods destruction effects and you need to keep track on the modified hand size anyway
does anything else modify extra hand size?
Indonesia mentioned
because I don't want the effect to overwrite, say, turtle bean
You can just count the number of consumeables
I know
Add one more for comedic effect
you only need to keep track of the modified hand size, you can make it independent from other effects
This should be possible
You'll wanna set the modified handsized from that joker, so that you can see if it's changed. That should prevent you from overwriting the other effects
Adding Consumeables can use the modded context card_added
Removing consumables needs to be divided into two parts
Sold or destroyed
Sold is built-in
I have a joker that I struggled with a similar issue with regarding chance, and @modern kindle wrote a pretty cohesive function to ensure it didn't overwrite other parts for it
Destroyed needs a bit of work but mods have done it
Tweaked it from 1.2 to 1.
What size is the mod badge, though?
I'm out right now and won't be back for a bit but you can share whatever relevant parts I don't mind :)
omg it’s dilly
Hi vic!!
It's very rainy here but I'm doing alright
I didn't want to get up and exist today but I did, so thumbs up to me
How are you?
:D
okay I have a weird system but it seems to work
where every update tick I'm just checking the difference between the value of #G.consumeables.cards and a variable I set to #G.consumeables.cards last update tick, to get the change in consumable count every update tick
and applying that change to the handsize on that update
the only issue is this
the handsize gets set perfectly fine, but discarding the purple seal just Decides to draw more cards than it should
are you setting the variable in the update function?
checking if they aren't equal, then if they aren't, change handsize by the difference and make them equal again
I suspect it'll be because the game doesn't set the buffer properly, so it draws cards weirdly because the purple seal sets the buffer, but doesn't set the hand size, then a card gets set to be drawn because the hand isn't full. Then the tarot becomes real, and actually increases the hand size, and another card is set to be drawn. So it accidentally draws 2 cards
I suspect you can solve it by just checking the buffer together with the total
it looks like changing handsize always draws a card even when it obviously shouldn't?
adding 1 to handsize when I'm at 11/8 cards still draws another card, putting me at 12/9
really? i'm back at my pc in a second, let me try that in my own mod and see if that's just standard behaviour
I haven't patched anything related to hand size so this should be stock behavior
smods is 0319c
I haven't patched anything related to hand size either, and testing with just Kino and debugplus installed, increasing hand size doesn't draw a card if the hand-size max is already topped
but that is on 0323a
i'll upgrade and see
question, why do print(G.GAME.blind.chips) and print(G.GAME.chips) return their values with hi attached to the end of the number?
Is it card.rarity or card.center.rarity?
okay, it's still doing it for me, which makes no sense because all that's going on here is changing the value normally
this isnt working right. I used a seed to get a shop 1 polychrome blueprint, and instead it just made a polychrome jumbo pack
if context.shop_card.config.center.set == 'Joker' then
if context.shop_card.config.edition then
packselect = 'p_buffoon_mega_1'
elseif context.shop_card.config.center.rarity > 2 then
packselect = 'p_buffoon_jumbo_1'
else
packselect = 'p_buffoon_normal_' .. math.random(2)
end```
okay not only is this happening on my end even after updating, but it happens when removing and re-adding turtle bean as well, it just blindly draws the amount of cards it thinks it should for the handsize change
unrelated to my joker
are you testing with any other mods installed?
just debugplus
I have a suspicion
(suspicion was wrong)
do you have any optional features enabled?
retrigger_jokers and the unscored card area
I remember some GitHub issue about hand size changes
but also I don't think checking every frame is a good idea
or necessary
I have a joker that sets a hand size and draws temporarily once I'm home i can look
that wouldn't affect turtlebean, though, would it?
It shouldn't touch it no, i thought the issue was smth that was being done was impacting turtle bean my b
that's so odd, why is it happening to me but not you
to the extent that turtle bean does it too
I'm testing some jokers rn, but after that I'll clear my mods file and install smods clean with only debugplus, and see if it happens on my end still too
maybe I've patched something that accidentally solves that behaviour, but I don't think so. The only patch in the draw behaviour I have is one that stops all drawing from happening if you have a specific joker, but that can't affect this
I don't know if I would consider DebugPlus' remove to be reliable to test this
how are you supposed to change the text at the bottom
label doesn't do anything ```lua
tecci_cursed = {
name = 'Cursed',
label = 'Cursed',
text = {
'Converted into {C:attention}Jimbo{}',
'after {C:attention}#1#{} rounds',
'{C:inactive}({C:attention}#2#{C:inactive} remaining)'
}
}
That's a badge
I mean, it shouldn't affect my joker because all that is going on is the checking of the length of g.consumeables.cards, and that is detected correctly
can anyone help me with my first joker? the github page really isnt helping me understand anything i have steammodded downloaded and lovely but what now?
also just tried it with selling and it does the same thing
now you code
i code w h e r e
also the way you do it is very jank
use your text software of choice, although I'd recommend one made for coding
so would it be called badge then

