#💻・modding-dev
1 messages · Page 538 of 1
me for like the entirety of may through october
now i need to figure out how to code my joker
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
meh i dont know
You can read the docs and get started there, vanilla remade is a great resource to check out too and its wiki is fantastic
:o
dont think the game was intended to ban this many stuff 💀 🤣
What do i put in the brackets of SMODS.destroy_cards() if i want it to destroy 1 card out of the whole deck?
i wish you could stack those icons if enough was banned, or if banned was excessively long instead of a blacklist it was a whitelist on what isnt banned
Would be very nice to have
You point either just 1 card or a table of cards.
the card you want to destroy
If it's just one card, it gets converted to a table and processed still.
I want it to be a random card, should've clarified that
you would need to get the random card yourself
that function doesn't handle that part
Okay, how do I get the table that has all the cards of the deck in it?
G.playing_cards
hi dilly
how are you N my goat
very tired
me too
i had gotten a call from the repair shop and got out of bed sooner than i wanted of them saying he would let me know when the store was open
Using pseudorandom, right?
yeah
ye for a random
pseudorandom_element
i have a blind that destroys 1-3 random
Can I use the same for destroying a random Joker?
SMODS.destroy_cards(destroyCard)```
yes, but you might want to change the pseudorandom_element key (currently "Card")
And what do I put instead of G.playing_cards?
G.jokers
But destroy_cards() isn't for Jokers, is it?
Joker cards are considered cards.
So like this?
SMODS.destroy_cards(destroyJoker)```
is there a particularly easy way i can replace a cards chips with mult?
Generally the key used is descriptive and unique. So if you were, for instance, using a Joker named "Madness" to destroy other jokers you would say pseudorandom_elements(G.jokers, "MadnessTarget")
Permanently?
Gonna change that after I thought of a name
yea
im in the process of making a card that has a chance to upgrade your playing cards from adding chip value to adding mult
so instead of +10 chips, itll give +10 mult
Yeah, erm... It crashed
G.jokers.cards
N bestie i need u
so how do you want it to interact with Hiker?
it wont
so if you have a 5 card that gives +20 chips from hiker, and it's converted by this joker it will give +15 chips and +5 mult?
if you play a 5 said 5 will give 5 mult,but since the card has no chip value it cant get an icnrease in chip value, it will not work for that card
if the 5 had already gained 30 chips, that value gets converted to mult
no idea
if so you just need to do:
if card.ability.mult == 0 then
card.ability.mult = card.ability.bonus
card.ability.bonus = 0
end
that's...
ok what I did will do what I said above
What you're asking for (Hiker no longer working) is not really possible.
(without changing hiker)
anything is always possible
maybe you need to hook the get_chip_bonus and get_chip_mult?
yea thats what i was considering
Okay, quick question... If there are no Jokers in play, I get an error since it tries to remove something that's not there. How do i prevent that?
if destroyJoker then
if #G.joker.cards > 0 then
either one
ok so I had a question, following up from last night
Currently attempting to insert a stake between Orange and Gold stake. I have the following code:
SMODS.Stake {
name = "Silver Stake",
key = "silver",
applied_stakes = { "orange" },
unlocked_stake = "gold",
atlas = "Chips",
pos = { x = 0, y = 0 },
sticker_atlas = "Stickers",
sticker_pos = { x = 1, y = 0 },
modifiers = function()
G.GAME.modifiers.enable_preorder = true
end,
colour = G.C.GREY,
shiny = true,
loc_txt = {},
above_stake = "orange"
}
SMODS.Stake:take_ownership('orange', {
unlocked_stake = "silver",
}, true
)
SMODS.Stake:take_ownership('gold', {
applied_stakes = { "silver" },
above_stake = "silver"
}, true
)
Observed behavior is silver stake is above gold, and not unlockable (I have beat both orange and gold stake to test).
(This was tested on a profile that already had gold stake unlocked and beaten)
iirc for applying vanilla stakes you need to use prefix_config so it doesn't auto apply your prefix
where does this live? inside of the stake table?
and for above_stake
ok, progress
SMODS.Stake {
name = "Silver Stake",
key = "silver",
applied_stakes = { "orange" },
unlocked_stake = "gold",
prefix_config = {
applied_stakes = { mod = false },
unlocked_stake = { mod = false },
above_stake = { mod = false },
},
atlas = "Chips",
pos = { x = 0, y = 0 },
sticker_atlas = "Stickers",
sticker_pos = { x = 1, y = 0 },
modifiers = function()
G.GAME.modifiers.enable_preorder = true
end,
colour = G.C.GREY,
shiny = true,
loc_txt = {},
above_stake = "orange"
}
SMODS.Stake:take_ownership('orange', {
unlocked_stake = "uvdm_silver",
}, true
)
SMODS.Stake:take_ownership('gold', {
applied_stakes = { "uvdm_silver" },
above_stake = "uvdm_silver"
}, true
)
I also adjusted the references to silver stake to have the proper mod prefix in the other stakes. Currently, it is in the correct location, but it errors without an diagnostic.
(also the chip is not shiny, so I assume there's something wrong with my stake table somehow)
How do i change the Joker amount the player can hold? I looked at negative's code and black deck's code but both do it differently
what is applying this change?
is it temporary or permanent?
For whatever reason my hook of get_straight() stops Shortcut from working. Everything in the hook only executes when you have the custom Joker so there shouldn't be any problems, but Shortcut starts working only when I remove my hook. (Is that what 'Lovely patch' from VanillaRemade is for?)
what are you trying to do
also thats an old version of vanillaremade, just so you are aware
wait, then where's the new one? I use this https://github.com/nh6574/VanillaRemade/tree/058bedca263b90fead8ec5d2fa868674e91aadef
is there something im overlooking here?
whats its supposed to do is that it counts cards held in hand as scored cards for joker effects
thats an old commit
also the problem is that get_straight is missing arguments
so far those two worked so idk
lmao I used an old version this entire time
also thanks
G.jokers.config.card_limit = G.jokers.config.card_limit + 1
rn it uhh probably loops infinitely
since it crashes right when i play a hand, no crash log
oh gosh, so, I do something similar with a joker I made, but it's very invasive.
mine shouldnt be
I don't immediately see what's wrong here, but if you want to crib off of my code
its just rerunning the joker's calculate with the new contexts
like, its only this specific effect that crashes??
hmm... let me review a little better.
oh wait im missing individual = true in here, not sure if thats the cause, hm
though even if it is im pretty concerned why it crashes
yeah it still crashes, damn
well im just gonna guess that this effect in particular needs more tweaking than i thought, hm
it might have something to do with the fact that calculate_joker calls calculate_joker.
yeah thats why i added hsr_change_context to the new contexts
Wait, you can have negative Joker Slots? xD
yes
It's the same as zero in the game though, right?
you can even trigger it in vanilla iirc. By having negative jokers in the typecast challenge and then selling a negative joker after ante 4.
I honestly don't see what's wrong.
wait
you only add this to the contexts if there is a joker modifying these contexts. You don't seem to add it normally. Which means that you don't skip this shuffling about when you chain call into calculate_joker. But then again, that shouldn't really matter, unless Balatro normally has a call stack here half as deep at the call stack limit?
Has anyone experience with modding jokers, that look for a specific card that changes every round?
yea i used that a bit, yet the game tries to index a nil
well post the code and the crash log then
how does one get the crash log?
you can either copy paste it from the crash screen or find it in Mods/lovely/log
as files or in text?
Making a balatro mod about SEALS!!!
Need help with one. using jokerforge
I wanna make a seal that turns the card into a heart suit.
as files is nicer
rightio
ask in the jokerforge thread
i did

no response
i would recommend waiting, i think no regulars here use jokerforge
im guessing its because it tried to clone the context.cardarea part which caused it to freak out
since cards also have .area which also refers back to the card 😭
makes sense
this is a syntax error, you wrote the code wrong
i would recommend getting vscode and the lua extension
so notepad++ won't cut it?
i wouldnt recommend it, no
-# at least its not notepad honestly
How do I give the player a random voucher?
🤔 how do i make this only run during scoring again
not end of round
ic thanks
umm which lua extension exactly?
the sumneko one
this wiki has more info
i would recommend following the first question
what the fuck
this doesnt crash anymore but it counts all cards in hand as scoring cards now?? like, not just for the joker but for the ENTIRE scoring process
3:
did you just remove the table.clone
yeah youre replacing the context table permanently
you can edit it and then revert it maybe
yeah not changing the context table worked, no clue if this will have any consequences
well if im seeing it right then it shouldnt anyways, so
:3
i will see if my mod's players crash and know myself lmao
Does this also work mid-round?
maybe
This gives me an error
local voucher_pool = get_current_pool('Voucher')
local selected_voucher = pseudorandom_element(voucher_pool, 'modprefix_seed')
local it = 1
while selected_voucher == 'UNAVAILABLE' do
it = it + 1
selected_voucher = pseudorandom_element(voucher_pool, pseudoseed('giveVoucher'..it))
end
selected_voucher:redeem()
end```
in context. after and context.final_scoring_step
oh yeah i think i deleted something there
I want to make a consumable add a passive effect (i.e. 2 additional retriggers on all jokers owned), is there any way to like, run a calculate function isolated ? or would there be a better way to go about that
consumables have calculate
gimme a sec to find the correct code
will it still work once the consumable is used?
ah no
that's what im going for
the next smods update has a global mod calculate
You need to create the voucher before you can redeem it
What do I need to add/change in my code?
what should I do in the meantime? should i just wait for that?
you can hook SMODS.calculate_context maybe
What’s the exact effect?
N' already mentioned that
oh
hm
well if you want to have it done early then you can
- create a dummy joker in an invisible cardarea (i did this one)
- hook to SMODS.calculate_context like N' said (i didnt do this one, but its probably better idk)
You can just get the consumable to do it too
oh wait does the :redeem function always subtract the cost
the consumable Ceases to Exist when it is used, no ?
they want it to basically have calculate after the consumable is used, which i dont think you can do just from consumable's calculate alone 🤔
orrrrr you can go with kino's approach, which is to have the consumable linger in the area for the calculate effect
:3
wouldnt quite work for what im trying to do
mm
Just get it to stay when used
And set an internal flag when used that triggers the calculate and stops future use
wouldnt quite work for what im trying to do
It’s a bit jank but it works
Yeah you can do card.couponed = true iirc
tried it but it only works if the area is the shop, card.cost = 0 works tho
im trying to add the voucher animation now
Okay
Let me check what I use
local voucher_pool = get_current_pool('Voucher')
local selected_voucher = pseudorandom_element(voucher_pool, 'modprefix_seed')
local it = 1
while selected_voucher == 'UNAVAILABLE' do
it = it + 1
selected_voucher = pseudorandom_element(voucher_pool, 'giveVoucher' .. it)
end
local voucher = SMODS.add_card { key = selected_voucher, area = G.vouchers }
voucher.cost = 0
voucher:redeem()
that works but the voucher doesnt get shown
That's fine, I'll figure something out. Thank you :3
You need to create it in G.play
My code is like this
local voucher_card = SMODS.create_card({area = G.play, key = voucher})
voucher_card:start_materialize()
voucher_card.cost = 0
G.play:emplace(voucher_card)
delay(0.8)
voucher_card:redeem()
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.5,
func = function()
voucher_card:start_dissolve()
juice_hooligan = false
return true
end
}))
Is there a calculate context that activates on each card drawn? (SImilar to the context for each card discarded)
orrrrrr maybe you can have a global table (not in G.GAME) with the calculate function, then when the consumable is used it adds a key to refer to the global table in a table within G.GAME, like G.GAME.consumable_passives then hook to SMODS.calculate_context?
so it would look something like
ConsumablePassives = {
deadass = {
calculate = function(...)
...
end,
}
}
local hookTo = SMODS.calculate_context
function SMODS.calculate_context(context, return_table, no_resolve)
for _,v in ipairs(G.GAME.consumable_passives) do
local ret = ConsumablePassives[v].calculate(context)
if ret then
--probably add it to return_table idk
end
end
end
local ret = hookTo(context, return_table, no_resolve)
return ret
end
:3 i havent checked what return_table is supposed to be yet, but i assume thats where you want to change for the effect to happen
i just realized i took so long to type this we already moved to another topic
sob
this way you can basically "store" calculate without directly storing it into G.GAME
-# that's also kinda what i did for stacked :3
@jolly shadow sorry if i took too long lol
this is what i was going to attempt
was focusing on implementingthe booster first n stuff which looks neat
yeah it looks really cool
is there a steammodded support for VS code?
i just pasted whatever there
context.hand_drawn but its only called once
is it possible to use variables in a custom info queue localization entry ?
Yeah, I saw that, but I was kind of hoping there was one for each card drawn
no sadly you will need to iterate manually
I wanted to make my Joker visually juice up and display a message for each card drawn kind of like Ramen
Ok what is the point of this if statement
lmfao
?
check If It's a tarot pack or spectral pack
But both of the statements are the same
doesnt do anything
It's basically saying "If X is true, do A, else do A"
I keep seeing these cards, what are they from?
localthunk prob did something else and forgot to change it later
Do you mind me using your code? (I haven't done much modding so idk if that's frowned upon or not)
Go ham with it.
Ok, thank you :)
Just adjust the context call for your unique needs.
Yeah, I think I'll need to add an other_card field since I need to check properties of the drawn card
card can not be defined when calling draw_card, though.
If it is not, it is internally defined and you may need to patch instead.
Wdym it can't be defined? Isn't there a field in draw_card() for the card being drawn?
It's optional.
it can be nil
Well, how does the game draw the card if it's nil then?
The else bit.
Ohh, wait, so it's nil if it doesn't have a specific card it's targeting?
Am I understanding that correctly?
uhh sorry if i interrupt or somthin i can't for the life of me figure out the Lua LSP part, i do atleast have VS code with lua extension.
If the specific card is not defined, it picks the top card of the cardarea and sets that as card.
what have you tried
i can't use the F1 method as it hasn't found anything that matches of what should be searched for.
Wait but hold on a minute, if it sets the top card of the cardarea as card if card isn't already defined, then what causes the card to be nil? Is that just if there's nothing to draw?
card is an optional argument. However, if the cardarea to pull from is empty, card will stay nil.
Ok, so to my understanding, if the card is specified originally then it's defined, and if it's not specified but it's able to pull from the cardarea then it's defined. The only case where it's nil is if no card was originally specified and there's nothing to pull from the cardarea. Is that correct?
Yeah.
I mainly use it in this function for stuff.
also i can't seem to get what the laurc.json method is
Ohhhh ok, I think I get it now
So the reason I need to use an injection is so that I can access the data from card to check if it's nil? (Or just to check the drawn variable I guess)
Patch, but if you wish to be able to examine any given card that is being drawn, then yeah. Otherwise, my hook is enough.
Yeah, I need to check if it's a mult card
Or you could iterate over SMODS.drawn_cards to check.
you add it to your mod's folder
But the patch will be a bit easier to manage, I guess.
As in check the last entry in SMODS.drawn_cards each time the context is called?
...I suppose? Never really used that yet.
-# And, frankly, I am not in the mental mindset to be able to mod... despite needing to take hospital things off of my mind. x.x
I'm sorry, if these questions are bothering you I can figure it out
Barely functioning. You are free to look at my mod's code for stuff if need be.
Ok, thanks for all of your help! :)
so this right?
yes
How can I destroy a card before scoring?
What's the variable that stores the total money you get on the cashout screen?
i still get warnings and errors, am i missing some steps?
it's .luarc.json
Does every sprite in the game need 1x and 2x or do some only need 1x?
Both.
check the wiki, there's also some examples in the example mod.
dont use steamodded example mods PLEASE...
https://github.com/nh6574/VanillaRemade/blob/main/VanillaRemade.lua use vanillaremade as reference instead
this info_queue is crashing when it's drawn, which is really strange to me:
info_queue[#info_queue+1] = {key = "m_mode_flesh_zygote", set = "Enhanced"} my localization is set up like how it's supposed to for enhancements, like return { descriptions = { Enhanced = { m_mode_flesh_zygote = {...}}}} It says cfg is nil, which, i'm not even sure what cfg means here
im aware. i mean in this context
its missing the loc vars because of the way you added the info queue
the flesh doesnt have loc vars
you should instead do info_queue[#info_queue+1] = G.P_CENTERS.m_mod_flesh_zygote works toobtw
oh
well then idk
Oh, right, forgot about that one as well
I started a run to try out my joker in action and it crashed, seems like something slip through VS Code's warnings. and it's something about the thatcher effect, can someone please lend me a hand?
send the crash log too
yep
well the error says that there is not such file/directory so if i had to assume you have the incorrect file path in your atlas definition
and it says that there is no main.lua file before the crash
but it is already
umm if that would be a nested folder then the .luarc.json fails to find the correct path.
got only the images
although i do have some warnings at VS Code but they lead to Lovely
Why do I get this error when I want to look at my blind in my collection?
oh wait! i do get some warning a ln: 29Col 29 & Ln 137 Col 29.
i don't get it, why does it do that with the word "mult"?
oh god it should have been "Mult"
did you do mult = <value> outside of the return...
because it shouldnt give that error
unless you do
also its not a warning its like info or whatever vscode calls it
a blind references an atlas that doesnt exist
you can disable this warning if you want, balatro has a lot of lowercase globals
i found your issue
dont
do that?
why is there a function in the return of your calculate
just return mult = card.ability.extra.mult
missing the =
check vanillaremade it does that
NVM
lol
Makes no sense to me...
key = "slots",
path = "chips.png",
px = 34,
py = 34
})```
and `atlas = "slots",` in my `SMODS.Blind`
did i miss something
Joker = {
j_farceur_stanczyk = {
name = {
"Stańczyk"
},
text = {
"{C:inactive}(no effect added)"
}
}
}
that looks fine
descriptions
Where do I do that?
in the atlas
thanks
Like this?
key = "slots",
path = "chips.png",
atlas_table = 'ANIMATION_ATLAS',
px = 34,
py = 34
})```
thank you!
No, it's useless below Black Stake and probably won't do that much a lot of the time even in higher stakes
What if it inverted sticker effects to be beneficial instead?
Rental - Gain $3 at end of round
Eternal - Can be sold but not destroyed
Perishable - I'm not sure here. Maybe it can't be debuffed? Maybe after 3 rounds of owning the Joker it increases in strength? Maybe every 3 rounds / hands / triggers it retriggers once?
bump
I don't know how difficult that would be to implement but that might feel more Legendary
I feel the same. I sent my mod to my friend for his birthday and he really enjoyed it now I'm just taking a break. My hard work paid off at least. I want to do more but I need to slow my pace somewhat
its more that i spent like the last few weeks just spending most of my free time and i think this isn't for me like i only have a few ideas
at least i tried and made me appreciate the game even more
Babalatro!
worst 3 hours ive ever had in balatro modding but we got there in the end
bump2
How can I destroy playing cards before they're scored?
aw darn if I had woken up earlier I could've helped
my dice do exactly what you're trying to do; upon use they explicitly don't destroy themselves, so they can just calculate normally and destroy themselves in the calculate function
i just decided to update smods
after hacking at a hook for 2 hours
and getting undescribable bugs
ye global calculate works too
maybe try loc_txt = {
oh nvm you already had it solved lmao
Is there a way to create cards into the "discard pile", or wherever the cards go after being scored? I.E. not added to hand or shuffled into the deck
Anyone know if there's a way to destroy playing cards before they score?
bump3
destroy them in context.press_play
I guess there's no overlap between context.press_play and context.scoring_hand?
no, i think it's G.hand.highlighted
It gives me an error
Potentially dumb question about stake cosmetics. I set shiny to true, but the sprite doesn't appear as shiny. When checking whether or not the shader function returned by get_stake_sprite is different (and therefore set by the lambda in the function), it is different from stakes 1-7 (which are equal to each other), and different from gold (9), yet I still don't get the shiny effect.
Can anyone think of anything else I can do to diagnose why it's not working?
yeah just add them to G.discard
Sorry to bother you again, but why do you need to check if the source and destination are playing card areas?
i coded something, you guys think that this works?
I think it should be math.max(G.GAME.hands.level)
no, discard doesnt have scoring_name and the syntax for max is wrong
well guess what... it didn't lol
yo how can i get started with balatro modding
i have a dumb idea for a joker
and i know basic code
check the pins in modding-chat
you might also want to check out the smod examples repo, vanilla remade repo, and the wiki of both.
still occasionally useful but vanillaremade is definitely much more helpful
Maybe it's just an issue with my code, but it seems that nothing happens when I return remove in context.press_play.
well i tried to figure out what needs to be gotten.
you need to use SMODS.destroy_cards instead
check burnt joker
i see
key = 'crystalline',
config = {
extra = {
}
},
loc_vars = function(self, info_queue, card)
return { vars = { } }
end,
in_shop = false,
shader = 'crystalline'
}```
I have a file `assets/shader/crystalline.fs` but i get this error:
oh damn this game is programmed in lua? i don't know this language
lua is pretty simple imo
oh, nice
i didnt know lua before starting its really easy
what language do you know
does anybody want to hear my joker idea
literally one of the simplest dw
It's easy, the only things that are gotchas are 1-indexing and the existence of metatables.
fairly limited honestly. visual basic
just to check how difficult it'll be to implement
what's the idea?
i mean i was able to mod the game without knowing lua just from my experience in python
the docs for modding the game are very helpful too
thats where like 99% of my lua knowledge comes from tbh
Oker
x999,999 mult
1 in 10 chance to crash the game
easy to implement
or maybe a higher chance
that's good then
probably not the best joker in the world tho
the point isn't to make good or balanced jokers for me. the point is to make whatever joker comes up in my mind
maybe a subway surfers joker that does nothing but plays a subway surfers gameplay video
ha
beautiful
well now the thing with get highlighted works yet, even if i used Glowing0v3rlord's idea the max is nil...
you need to loop through G.GAME.hands and get the highest level manually
that would be a for in method right?
O: X 1.8e308 multi (1 in 2 chance to corrupt your game files and delete the folder) 
Yeah I was wrong, I didn't fully read what you had put there
(He appears in the store after Oker closes game Like Cavendish)
horrible idea. i love it
okay now i need to learn how to create balatro mods
That's what I have the most.
my idea is to reference the game's pre-existing jokers as a basis for my code. i can learn. i can adapt.
I help you 
thank you. how may i begin?
hold on...the hands table should work like a array perhaps i could use a size getter for this
vanillaremade
is good
It is a "mod" that recreates jokers etc. from the base game using smods.
why would the size of the table help
also it's not an array
I learned a lot from him.
i would rather just code them myself, honestly
It's a good point of reference
I would recommend learning the basics about SMODs and seeing Vanillaremade, so you can see how jokers work and change values here and there to understand.
Let's say you want to do something that is already made in vanilla, you can always look there and learn from that
oh, i see
vanillaremade is there for reference because there are a lot of undocumented things
yeah
google brings nothing because search engines all suck now
I've seen a site that does balatro mods with block programming, like Scrath, but it's not my beach.
JokerForge?
thanks
to get the Integer/ Value for the in part.
I don't remember exactly the name, but I've been saving it somewhere.
i have still not found the problem in my object type, by the way
I found Q very well done, for those who want more basic things like creating only a few wildcards for fun, etc., but I prefer to do it myself.
use pairs
whats that
2 values in a variable, you can make a vector where each IT holds 2 values together (more or less this).
(If that's what I'm thinking)
And you can make pairs of pairs.
X1 mult for every hour of subway surfers watched
this is not true for lua
I don't know much about lua, sorry.
I imagined it might not be that.
would you perhaps be able to useth thy knowledge to helpeth me?
whats wrong with this here code
key = "Passive Items",
default = "j_bali_breakfast",
cards = {},
inject = function(self)
SMODS.ObjectType.inject(self)
self:inject_card(G.P_CENTERS.j_bali_sadonion)
self:inject_card(G.P_CENTERS.j_bali_innereye)
self:inject_card(G.P_CENTERS.j_bali_spoonbender)
self:inject_card(G.P_CENTERS.j_bali_cricketshead)
self:inject_card(G.P_CENTERS.j_bali_myreflection)
self:inject_card(G.P_CENTERS.j_bali_numberone)
self:inject_card(G.P_CENTERS.j_bali_bloodmartyr)
self:inject_card(G.P_CENTERS.j_bali_brotherbob)
self:inject_card(G.P_CENTERS.j_bali_skatole)
self:inject_card(G.P_CENTERS.j_bali_haloflies)
self:inject_card(G.P_CENTERS.j_bali_magicmush)
self:inject_card(G.P_CENTERS.j_bali_thevirus)
self:inject_card(G.P_CENTERS.j_bali_roidrage)
self:inject_card(G.P_CENTERS.j_bali_heart)
self:inject_card(G.P_CENTERS.j_bali_rawliver)
self:inject_card(G.P_CENTERS.j_bali_skelekey)
self:inject_card(G.P_CENTERS.j_bali_dollar)
self:inject_card(G.P_CENTERS.j_bali_boom)
self:inject_card(G.P_CENTERS.j_bali_trans)
self:inject_card(G.P_CENTERS.j_bali_compass)
self:inject_card(G.P_CENTERS.j_bali_lunch)
self:inject_card(G.P_CENTERS.j_bali_dinner)
self:inject_card(G.P_CENTERS.j_bali_dessert)
self:inject_card(G.P_CENTERS.j_bali_breakfast)
self:inject_card(G.P_CENTERS.j_bali_rotten)
self:inject_card(G.P_CENTERS.j_bali_spoon)
end,
})
I know Pair for C++.
when does that happen
is the object type defined before or after the jokers
after
no idea
ill paste code for a booster pack
okay so vanilla remade has just made a duplicate of every deck i can play
maybe thats the problem?
and everything in the collection.
like merging my save file with a new one
remind me what this is meant to do?
key = 'p_bali_itempack1',
loc_txt = {
['name'] = 'Item Pack',
['text'] = {
"Choose {C:attention}1{} out of {C:attention}3{} {C:gold}Item Cards{}"
}
},
atlas = 'customBoosters',
pos = {
x = 0,
y = 0
},
config = {
extra = 3,
choose = 1
},
create_card = function(self, card)
return {
set = "Passive Items", area = G.pack_cards, skip_materialize = true, soulable = true, key_append = "bali"
}
end,
discovered = false,
draw_hand = false,
group_key = "bali_itempacks",
cost = 4,
} ```
Did you download it as a mod😭
vanillaremade isn't meant to be a mod you play, it's a reference for how to use SMODS's tools
if you want to reproduce a certain functionality of vanilla content (e.g. "how do i make my joker give +mult"), you can look at VR's implementation of the basic Joker and borrow that
yes
oh, i see. so i essentially just reference the code
ye
guess i need to look into the source code
category of what?
jokers, decks, tarots, etc.
YESSS I EXPORTED PARSER TO BALATRO
https://github.com/thenumbernine/lua-parser/ lua parser
I know exporting a module Is simple but I took a long time figuring it out 😭
now I can parse code though
oh, i see
NOW I CAN DO THAT TALISMAN FIX
sorry if i sound dumb, but how specifically do i access the source code?
mods are just text files with code
I'LLLLLLLLLLLLLLLLLLLLLLLLLLL FIX TALISMANNNNNNNNNNNN
found it. chose "Open archive" with 7zip
oh you mean the balatro source code?
i recommend checking the files on Mods/lovely/dump instead
those are the source code after lovely patches
youve got one, installed right into your head
lua files are text files
Also recommend setting up a Lua LSP https://github.com/nh6574/VanillaRemade/wiki#3-set-up-the-lua-lsp
thanks
Even notepad++ is better (still bad tho)
notepad++ is fine
i'm in a superposition of understanding and not understanding
i've been writing my mod in it for the past 8 months now
This for in method has a tiny little flaw, yippie
it would be G.GAME.hands[i].level
or v.level
In a for loop like that, the v is just short for G.GAME.hands[i]
also you what the comparison in the if below to be the key of the hand, not the max level
Take your time
Trying to learn everything at once can be overwhelming
you're right
Is there a way for a joker to check if it's been destroyed?
specifically destroyed?
Yes
you can maybe use the new context.joker_type_destroyed but idk if its passed to itself
i dont think it is
i think somethingcom had a snippet for this but i cant find it
would've been really nice if i could get the highest level in one line... but what do you mean with the if segment?
get_max is a number G.FUNCS.get_poker_hand_info returns a string
(well it has multiple returns, idk if it works in the if condition)
well i tried avoiding that since the VS Code tells you if a var swaps from a value to something else and vise versa
oh
you mean the if section after the for in ended, right?
yes
does selecting a card count as pre-discard? since thats whenever i'm crashing since i added the post for in compairision.
no, its probably crashing in the loop because its not in a context
this is how i would do it
if context.pre_discard then
local get_max = 1
local max_key
for key, v in pairs(G.GAME.hands) do
if v.level > get_max then
get_max = v.level
max_key = key
end
end
local scoring_name, _ = G.FUNCS.get_poker_hand_info(G.hand.highlighted)
if scoring_name == max_key then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
end
end
you also had the wrong syntax in pairs
Any calculate function code that is not within a specified context, will instead run under ALL contexts.
imma test your theory there, if i may.
So that is working yet i also wanted to make it add normal Mult yet it does not change the mult.
What is it doing instead? N's code was entirely about changing the mult.
if your stake is not shiny but you have set shiny = true in the SMODS.Stake definition, what might be going on?
is it possible to change collection order? tried setting order on the card centers but it doesnt seem to do anything
oh apologies, i meant it does change the jokers mult albeit the Hand mult is unchanged
it depends on what order the SMODS.Joker functions are called
could just say no lmao
i can't change the load order or it messes shit up
that's really scary edward.
You should probably have each joker more independent
why would it mess shit up?
If I want to reorder jokers in my mod, I just reorder a list.
(because each joker is in its own file)
because one of my jokers needs every other joker to be loaded first in order to work
Did you remove the joker_main part of your code? Because that was perfectly fine and should still be there.
ykno thats like, common sense
if i cant reorder shit one probably needs to be later?
probs
that's not really common sense...
i have re-added it let's see if that works
its common sense that messing with the order would only mess shit up if the order mattered lol
What exactly does that particular Joker do? There could be an alternate solution that removes it from any strict load order requirement.
im already looking into the other solution because of the lack of any helpful info lmao
it does work yet, i tried giving it a message to let the player know it gained some mult.
A separate return statement, with just that message, in the pre_discard context should work for that.
trying to mod a joker with this tutorial but it's not appearing in my collection
STEAMODDED 1.0.0
A tutorial on how to make a modded Joker.
https://github.com/art-muncher/Example-Mod -- EXAMPLE MOD
https://github.com/Steamopollys/Steamodded -- STEAMODDED
https://github.com/WilsontheWolf/DebugPlus -- DEBUGPLUS
-----------------------------------------------------...
this card just sucks dude
Bro doing bunch of nothin
It would be op If It worked
it works on some other cards
Hey steve
just fuckin gives up on salon for some reason
On occasions 😭
no clue what this means
It takes a lua string
and give a table which you can change to change code easily
then you call a function
and it transforms back to lua code
I'm gonna use that for automatic scaling detection and fixing talisman
you can do lot of stuff with that
cuz u can easily replace code
GASP
i do have issues but can we stick to the mod please
okay in all seriousness
Fixing talisman
yes
do you want to see my code and joker asset files
Yes
You may be a descender from the gods
joker would probably help the most if its not loading at all
so a patch
basically a patch but 1000x better
I’ll ban myself if this shit works
Missing pos
In smods.joker
that wouldnt stop it from loading
He doesn’t say it doesn’t load he said it doesn’t appear
Mhm
WHERE’S THE JSON FILE
also pos defaults to 0,0
oh. it's not showing up in the collection... probably explains it
Json file where
also you should probably be using visual studio code instead of n++
oh my bad
one second let me try and find it
this is rapidly devolving into a shitshow
Yeah that shit has no colors vscode just better
Should be under your mod folder along with the main lua file
also you shouldnt need that header if you have a metadata json file
nothing here @candid elbow
Inside
Smods doesn’t even load the header now
It just ignores it
Lol
there's only assets and main.lua
you need a json file with your mod metadata
Use this example as a template
Eris let me cook man goddamnit 😭
why would you link to an smods example mod instead of just to the docs....
fair
okay
thank you
what do i call you
kate?
put the metadata into the json file @candid elbow
Yea that works >-<
nice
Not like this
Tale the json file from here and change the values
(That’s the old format)
oh sorry
It’s okay trial and error is what makes you better >-<
nice :>
mmmm lunch
i won't
anyway the mod itself is being recognised in the mods section, but it cannot be launched because it can't find the file main.lua
which is weird, since the file containing the joker template is called main.lua
Silly fred
You named it
Main.lua.txt
It’s not lua its txt
Hehe
Also the json file
See here
That’s why vscode is goated
this will have to do, this shit doesnt wanna work no matter how hard i try lmfao
big nerf to bird but what ever
hmmmmm
Close your lua file code
It’s open
Probably needs a , after loc_txt
And in atlas
After key
Missing ,
okay. added the commas in. trying now
whats wrong
Yeah syntax is fucked
commas are used to seperate table entries, just like with arrays and such in most other languages
It’s just every item in a table needs to be separated with a ,
YESSSS
Hell yeah
GOOD JOB FRED
Now add atlas=“your atlas key”, and pos{x=0,y=0}, to your joker code
Add discovered=true , id you don’t have debug plus (please install it )
Bros a genius
If you have debug plus hover over it and press ctrl +2
I’m just good at reading
don't worry i have debug plus
i should get it you are correct
i am fine with using notepad++ but i guess it's better
Trust me it’s way better + support all languages and theme customizable and highlights your variables / syntax
It makes everything easier visually
Oker is birthed
i see
i took computer science. i know IDEs are better
(sorry if that sounds arrogant. was not the intention)
It's ok, I still use Vim
Wrong sprite size
yeah
I understand if you don't want to VS Code
It should be
71x95
Pixels
1 pixel border (empty)
Check the mod repo i sent you earlier it has a sprite example and everything
For editing I recommend aseprite if you can afford it (by all means ) or kirita (good free alternative)
libresprite is an aseprite clone from the same code base
You can compile aseprite for free
Oh, then I'll do that then
i copied the joker image incorrectly
There’s plenty of tutorials online
Hehe
should work now
Hands crossed
my child is born
now it's time to program the actual mechanics at half past midnight 🔥
thank you for your help, kate. you were pretty much my bridge across a valley
No problem >-<
i think i can do this if i just look through more code
currently implementing only the 999,999 mult
is there a context for debuffing a card?
Okay if you don’t understand something or what does something do ping me
I don't see anything in the docs for it, only stuff about playing a debuffed hand
Can i see the code
Look in calculate
sorry to eat up so much of your time
Card
Not center
And replace center with card
In loc_vars
center**,**ability lmao
Shut up bepis
oh, i guess the tutorial i'm using is a bit outdated
if u checked #1349064230825103441 there would be a specific line telling you NOT to use center
3:
Pfff
still crashing
Who reads
Card.ability.extra.xmult
yeah that's what i just did
i forgot to ping, whats wrong here, this looks fine
Calculate Functions right?
i changed the function because the old one stopped working :]
mm ic
good news, it's not crashing. bad news, it's not working.
it just doesn't apply mult
what's the calculate code
Wait it’s not thzre
Lol
I swear i saw ig
It
Missing the calculate function
is this correct for detecting steel cards and making them give x chips when held in hand?
calculate = function(self, card, context)
if context.individual
and context.cardarea == G.hand
and not context.end_of_round
and SMODS.has_enhancement('m_steel') then
if context.other_card.debuff then
return {
message = localize('k_debuffed'),
colour = G.C.RED
}
else
return {
x_chips = card.ability.extra.huntress
}
end
end
end,
ah. my mistake
you got it
i'll try it rq
Lmao
thank you, it worked
oh yeah im pretty sure you dont need the debuff check
-# though i might be wrong
that might be true, i was just following vanilla remade
oh maybe not then lol
then what is it? i couldn't find anything like that in vanilla remade
i trust N'
I trust N and S with my life
So i while i tried out the free fall jokers i made with some help.
I encountered one in the shop
Should the stats of it stay this way?
how can i make it so that if a specific joker is present, the x chips amount is different?
calculate = function(self, card, context)
if context.individual
and context.cardarea == G.hand
and not context.end_of_round
and SMODS.has_enhancement(context.other_card, "m_steel") then
if context.other_card.debuff then
return {
message = localize('k_debuffed'),
colour = G.C.RED
}
else
return {
x_chips = card.ability.extra.huntress
}
end
end
end,
Can anyone tell me why per-card discard effects like Ramen are able to pause other actions for a moment? I'm trying to pause in a similar way for a custom individual card draw context and I can't get it to work (all of the actions just happen after the cards are done drawing)
Likely a G.E_MANAGER call in my experience, check out https://github.com/nh6574/VanillaRemade/blob/caf49367a7b58a4ad6f6bf36cd23fae3bb5e9d26/src/jokers.lua#L2916
oh my fucking god i'm getting tired of this shit
Seems like it just returns like normal though
my joker is giving the message of the mult without affecting the score
i've followed this tutorial to the letter
The G.E_MANAGER call is just for the joker being eaten I think
Oh yeah i forgot to read LMAO
include xmult = card.ability.extra.Xmult, in your return statement
My guess is that discard effects add a delay automatically while draw effects dont, maybe you could try delay(num)?
which line?
idk what your code looks like but here's an example:
if context.cardarea == G.jokers and context.joker_main and context.scoring_hand and card.ability.extra.xmult > 1 then
return {
message = localize{type='variable',key='a_xmult',vars={card.ability.extra.xmult}},
xmult = card.ability.extra.xmult,
colour = G.C.RED
}
end
my bad
also you dont need to specify the message
it finally worked. thank you, @timid zinc
it puts an X# message on it already
i think i'll add the 1 in 6 chance to crash the game tomorrow
do xmult, not xmult_mod. xmult does the message automatically
hope it isn't too hard to implement
either works tho, so it's not that big a deal imo
i imagine i just need to set something up, similar to wheel of fortune
xmult_mod is like old tho
if i can find it in the code, i'll replicate some of it and include the line that closes the program if it triggers
how would i set up a new variable to be saved? im trying to set something up like G.GAME.Voucher_Mult, but it doesn't seem to be working
im really curious as to how a joker can just crash the game, like does it close to game or cause an error screen like when you mess up code?
i've had jokers crash the game when they pop up, no clue how but it can happen
but was that the intended? like how that guy wants the game to purposefully crash
close the game
that's what i mean
i think saying it "crashes" the game sounds better though
apparently the number one way to crash the game is to call a nil value according to my absolute dogshit coding so maybe do that?
i think i'll just make it close the game
actually, in fact, 1 in 6 is too lenient. why not 1 in 2
You can probably check cryptid's ://CRASH card to see how it does it (might be somewhat complicated though because it has other crashes that are "fake" crash animations)
i'm gonna be making abysmal dogshit
btw this makes 3 days trying to get my custom joker text into the game : D
the humble os.exit()
what the fuck is an os.exit()
immediately closes the game
thanks for this, i'll remember it later
ah
yknow makes sense that os.exit exits the game
plus if i make it a 1 in 2 chance, i'll punish an oops all 6s
what do you think of this idea
I still can't figure this out, is there anyone who can help?
not sure if theres a calc function in order to do this though
how can i modify the judgement tarot to summon jokers from a specific pool? like i list the jokers i want in that pool and it randomly creates one
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
play_sound('timpani')
SMODS.add_card({ set = 'Joker', edition = 'e_negative' })
card:juice_up(0.3, 0.5)
return true
end
}))
delay(0.6)
end,
https://github.com/nh6574/VanillaRemade/wiki#whats-a-poolset this might be a good start
thank you, i'll try that
bump?
this might be what i am looking for
let me try a jiggle animation to see if thats possible if not it would be something like banner where it will give you the chips when scoring
okay i got the mult system working, but the messages dont seem to be updating, any help? heres my current function:
local old = SMODS.calculate_individual_effect
SMODS.calculate_individual_effect = function(effect, scored_card, key, amount, from_edition)
-- ...
if (key == 'mult' or key == 'h_mult' or key == 'mult_mod') and amount then
if effect.card and effect.card ~= scored_card then juice_card(effect.card) end
local effective = amount
if G.Mult_50 then
effective = amount + amount * 1.5
end
-- give 50% more mult based on effective yeah
mult = mod_mult(mult + (effective))
update_hand_text({delay = 0}, {chips = hand_chips, mult = mult})
if not effect.remove_default_message then
if from_edition then
card_eval_status_text(scored_card, 'jokers', nil, percent, nil, {
message = localize{type = 'variable', key = effective > 0 and 'a_mult' or 'a_mult_minus', vars = {effective}},
mult_mod = effective,
colour = G.C.DARK_EDITION,
edition = true
})
else
if key ~= 'mult_mod' then
if effect.mult_message then
card_eval_status_text(effect.message_card or effect.juice_card or scored_card or effect.card or effect.focus,
'extra', nil, percent, nil, effect.mult_message)
else
card_eval_status_text(effect.message_card or effect.juice_card or scored_card or effect.card or effect.focus,
'mult', effective, percent)
end
end
end
end
return true
end
return old(effect, scored_card, key, amount, from_edition)
end
what do you think the rarity should be? i can try with some other jokers real quick
if i need to tweak it to be more balanced as well you let me know too
using blueprint/brainstorm on record increases the chips it looks cursed
it worked tysm!
here's in slow speed if you want to see
so three questions that the community can suggest on (democracy wins)
- the rarity
- if 12 chips per trigger is balanced and if not what would be a better option (try to keep it music related)
- should i patch this oversight but either not counting itself, blueprint/brainstorm, or any other joker like that
Thinking on having the joker art not only be random from an atlas (not sure how to do that) but based off actual covers. which ordination do you prefer? (the sleeve is to protect the vinyl on my sheets just in case it won’t appear in the art, unless you want that)
What's the easiest way to define a new color and make it usable in localization?
https://github.com/Steamodded/smods/wiki/Text-Styling#named-colours-dictionary-gargsloc_colours this could be a good start
Thanks
Odd to me that SMODS doesn't have a SMODS.Colour function to automatically add a new colour to LOC_COLOURS
there's a PR for it but I think it doesnt really make sense for something that takes 2 lines to do
i mean, there's a few days to do it. i do it with a hook 
yea i feel like it doesn't really need an object
at most it'd have 3 parameters- the color itself, the name of the color, and if it should count as a "UI" color or not (and that doesn't particularly sound like something that users should have easy access to)
Even if it is simple, it would definitely save people like me some time trying to figure out how to do this. Still not sure how to fully do it even with Nope's example.
hey if only there was a wiki i wrote that explains things like that!
Thanks! Still, I feel like that should be at least mentioned in the SMODS wiki if they aren't gonna add that function.
is that coming from the cards that gain? let me try with some other jokers
looks like static jokers goes towards the plus which does help with the display but a card like castle is weird visually
it looks like the post joker function will allow cards like castle not go uncounted
still not sure which rarity should the card be and any documention on how to make it where i can make an atlas of different albums where it picks one randomly when it spawns in the shop or via judgement
and oh yeah! i plan to have the design like this where the sticker has the joker itself (might have where each one is based off the designs of the vanilla jokers
so if you have an album art suggestion feel free to suggest
Apologies for the delayed reply. Is "CirnoMod" the id of your mod?
no, it's just the name of my global mod variable
so your prefix?
no
literally just a global variable
the point is, i have a table i stuff colours in
the hook checks against that table to see if the string in {C:colour}
is a key present in the table. if so, it returns the colour. otherwise it just does the function normally
Gotcha
Is there a destruction equivalent of context.selling_self?
Yes, but it's not a context.
What is it and how do I use it?
triggering my desire to collect records
In remove_from_deck you would check if not G.CONTROLLER.locks.selling_card
https://www.pricecharting.com/offers?seller=inavxd3jd225wp6s37rssex3tm&status=collection i also collect video games and home media of shows and movies
See psyduck's Entire Collection Including the Total Value
not sure how to do the atlas random thing yet might look at it either tomorrow or the weekend
So if I want something to trigger if sold or destroyed, I could just put the effect in remove_from~deck instead of checking if contex.selling_self as well as what you suggested?
Yes.
if i were to add a custom enhancement and wanted a joker to apply it to a card at random when played what would i use to do so, i was able to do glass cards using m_glass but for a custom enhancement what is it
what do you think of this idea? basically it doesn't appear normally in shops, boosters, or via judgement, but spawns in (and self destructs after scoring) similar to the aftermention perk in the fallout series
could rename it to "mysterious joker"
but the main thing is i'm not sure if that's possible since unlike something like rift raft
Maybe make it tied to another card? Maybe something like a tarot that allows the stranger to appear for x turns? The only reason I suggest this is that it can be potentially harmful depending on the build (e.g. stencil Joker) and could end up as a nuisance instead of a benefit.
i could make the card negative which shouldn't hurt cards like stencil joker
"can't spawn normally": set in_pool to always return false for the joker itself. ez
"can spawn in at random": you'll probably want to hook whatever function runs when you press play and handle the spawning code there
wait nvm discord's text pointed out the problem
yea I saw it too lol
vscode didn't point it out so that's a bit weird
vscode doesnt help at the most random times
can probably have it in the code where if its over the joker limit or you have a joker like stencil joker make it negative or i can make it always negative
Probably better to always make it negative for consistancy
just wondering if the joker limit was reached how would it add the card or would the game see it as negatie as a first thing and allow it to be added to hand
What does the new smods update bring? I would also like to ask where i can check
its a dev update not a full release
if you want to take advantage of the features and bugs you have to copy/clone/download the repo
might make it even more mysterious™ i can def do the retriggering and disappearing/self destructing code but gonna have to learn about hooks to do the appearing
bump
just the hook itself which is something i need to look into later
even got the in pool thing down which was easy peasy lemon squesy
How can I check if a joker belongs to a set?
elaborte
An objecttype, my bad