#Want to start modding.

1 messages · Page 1 of 1 (latest)

unborn badger
#

Ive never modded anything myself before, but after sinking hours into vanilla and modded, Balatro seems like a great place to start. I do make games as a hobby, however only through UE5's BP System, meaning the tutorials online on how to mod balator seem daunting. How would i go about starting?

lapis bear
#

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

shrewd thicket
lapis bear
#

you can unpack the balatro.exe using 7zip or the like

shrewd thicket
#

ok I'm looking around, i don't really understanding what I'm looking at though, where would I find Joker and their abilities

lapis bear
#

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)

shrewd thicket
#

ok thank you

lapis bear
#

No problem

shrewd thicket
#

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

shrewd thicket
#

is there a toutorial/guide to do this?

lapis bear
#
  1. you can use debug mode
#

for the other, once again look at other mods code or the docs in the github wiki

devout kite
#
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 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

little agate
#

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

devout kite
devout kite
#

i did modify that context