#Want to start modding.
1 messages · Page 1 of 1 (latest)
Read other mods code, read the Balatro source code, and simply ask in #⚙・modding-general or #💻・modding-dev if it's more about the code directly. Also take a look at the docs in the Steamodded wiki, although its quite sparse
how do you look at Balatro's source code?
you can unpack the balatro.exe using 7zip or the like
ok I'm looking around, i don't really understanding what I'm looking at though, where would I find Joker and their abilities
Use an IDE such as Visual Studio Code which allows searching through all files in the folder; with that you can just look for the Joker name and find it's mechanisms (although for this, looking at other people's mod code might be a bit easier to understand)
ok thank you
No problem
ok so i been looking though the code of I know what i want to do for my mod
1.add card I made as a new joker with name and ability description
2.add Joker's ability to work to in game (destories heart cards and adds X muilt to the card)
3. add a way to test the card, maybe a challenge or deck
is there a toutorial/guide to do this?
- you can use debug mode
for the other, once again look at other mods code or the docs in the github wiki
SMODS.Joker { -- Adding a Joker to the game
key = 'my_joker',
loc_txt = {
['default'] = {
name = 'My New Joker',
text = {'Jokers ability'},
},
},
-- This section is used whenever the Joker's text needs to change during the run (ex. Red Card)
-- loc_vars = function(self, info_queue, card)
-- return {vars = {}}
-- end,
config = {extra = {my_var = 0}}, -- This config section is used if you want each joker to have some local variables
rarity = 1, -- 1 common, 2 uncommon, 3 rare, 4 legendary
pos = {x = 0, y = 0},
-- soul_pos = {x = 1, y = 1},
atlas = 'my_jokers',
cost = 3, -- Cost in the shop
-- Self explanatory section now
unlocked = true,
discovered = false,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
calculate = function(self,card,context)
-- Feel free to use these functions, modify or delete them if you don't use them
if context.setting_blind then
myJoker_RoundStart()
end
if context.joker_main then
myJoker_HandCalc()
end
if context.end_of_round and context.game_over == false then
myJoker_RoundWon()
end
if context.using_consumeable then
myJoker_ConsumeableUsed()
end
end,
}
-- Here you implement the joker's ability inside these functions
function myJoker_RoundStart()
end
function myJoker_HandCalc()
end
function myJoker_RoundWon()
end
function myJoker_RoundWon()
end
modify this template or write your own
this is the way I do it
if you want to add other way your joker can work (ex. activating for each scoring card) check https://discord.com/channels/1116389027176787968/1247703015222149120
If you have steamodded installed, your file needs to have a header in the first lines of the code, you can find it on the Steamodded wiki
make sure your code works before posting a template
if context.end_of_round and context.game.over == false then
this line is flawed
for one, it's context.game_over and not context.game.over
and then it also isn't obvious why that excludes individual and repetition contexts which also use end_of_round (which doesn't mean it doesn't work, it's just not a great example at that)
and your myJoker_Whatever functions aren't being passed any arguments
i specifically said "modify these functions to make your joker"
it's the one I use, and it works
i did modify that context