#💻・modding-dev

1 messages · Page 394 of 1

wild escarp
#

bump

keen totem
#

functions & events a.k.a. how to make OOP not OOP

#

whats the goal for this joker

wild escarp
#

Destroy the played card if it has a modifier and create two copies.

keen loom
#

ok, i added brackets to the text too, but it's still crashing my game, telling me that my loc_txt isn't closed

keen loom
# keen totem new code?
    key = 'tarot24',
    set = 'Tarot'
    loc_txt = {
        name = 'Carnival of Shadows'
        text = {
        'Creates 3 random {V:1}Negative{}'
        '{C:attention}Tarot{} cards.'
        },
    },
}```
#

oh wait, it says the first bracket isn't closed

keen totem
#

are you doing this in an IDE?

#

or just in like

#

notepad

keen loom
#

notepad

keen totem
stark geode
#

.

keen totem
#
return {
                    message_card = context.other_card,
                    xmult = card.ability.extra.mult,
                    extra = {
                        message_card = context.other_card,
                        message = "Cured!",
                        colour = G.C.BLUE,
                        func = function()
                            G.E_MANAGER:add_event(Event({
                                blockable = false,
                                func = function()
                                    print("setting to base")
                                    context.other_card:set_ability(G.P_CENTERS.c_base, nil, true)
                                    return true
                                end
                            }))
                        end,
                    }
                }

(tried this with the :set_ability being to both context.other_card and another variable that is context.other_card)

#

why doesnt this set the enhancement to base

keen loom
#

still crashing

keen totem
stark geode
#
SMODS.Consumable {
    key = 'tarot24',
    set = 'Tarot',
    loc_txt = {
        name = 'Carnival of Shadows',
        text = {
        'Creates 3 random {V:1}Negative{}',
        '{C:attention}Tarot{} cards.'
        },
    },
}
keen totem
# keen loom still crashing
SMODS.Consumable {
    key = 'tarot24',
    set = 'Tarot',
    loc_txt = {
        name = 'Carnival of Shadows',
        text = {
        'Creates 3 random {V:1}Negative{}',
        '{C:attention}Tarot{} cards.'
        },
    },
}

turns out you were missing even more commas

stark geode
#

@keen loom

#

yeah

#

there were several commas missing

#

vs yelled at me

stoic fulcrum
#

this seems to only check if the card exists in the mod, not if i have it in my deck

keen loom
#

oh, so every line break needs a comma

stark geode
#

what youre working in is a lua table

#

each new entry needs a comma

keen totem
#

yuh

#

and the last doesnt

wild escarp
#

Still can't get this to work properly with hologram.

keen totem
#

but it can

stark geode
#

generally i do

keen totem
#

is the text style tagging the same as vanilla's system

stark geode
#

yeah

keen totem
#

ok

#

SURELY

#

{X:mult,C:white} being Xmult

#

was on purpose

#

B: wouldve worked fine

stark geode
#

@red flower can you help me with somthing

#

do you know if i can make a bp die when it copies a joker

elfin stratus
#

im reading trough documentaion (smod and vanillaremade) but i still cant figure out how to destroy a specific rank of cards after they are scored

stoic fulcrum
#

is there an easy way to make a joker check if a specific joker is in your deck?
SMODS.find_card just seems to check if the joker exists in the mod itself, instead of your current deck

wild escarp
#

e.g

if context.destroy_card:get_id() == 2 then
    return
    {
        remove = true
    }
end
elfin stratus
#

thanks bill cipher

keen totem
#

why is this not setting the enhancement to base

nova epoch
#

i keep on getting this error when booting up the game, did i fuck somthing up in the code? because it keeps on saying "attempt to indext globsl 'card' [a nil value]"

SMODS.Joker{
    key = 'gamexplain',
    loc_txt = {
        name = 'GAMEXPLAIN',
        text = {
            'When a King and Jack is in a scored hand,',
            'gain a {C:mult}+#2#{} Mult'
        }
    },
    atlas = 'Jokers',
    pos = { x = 0, y = 0 },
    config = { extra = { mult = 6.9 } },
    loc_vars = function(self,info_queue,center)
        return { vars = { card.ability.extra.mult } }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if context.othercard:get_id() == 13 and context.othercard:get_id() == 11 then
                return {
                    mult = card.ability.extra.mult
                }
            end
        end
    end
}
keen totem
#

othercard is just a local var that = context.other_card btw

wild escarp
nova epoch
#

alr it booted up thanks

keen totem
#

wokrs now

nova epoch
#

alr now i have this error and i think its because it changed 'or' to 'and' from the example i was using

    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if context.othercard:get_id() == 13 and context.othercard:get_id() == 11 then
                return {
                    mult = card.ability.extra.mult
                }
            end
        end
    end
}
red flower
stark geode
#

thanks tho

nova epoch
#

oh fuck im stupid

#

i forgot the underscore in other_card

#

ok so now the game loads the card and i can put in into play without crashing

#

but its not applying the mult

elfin stratus
#

im not smart enough

#

😭

keen loom
#

how do you add the description of "negative" when viewing the card's description?

red flower
elfin stratus
#

basically

elfin stratus
#

the joker is supposed to destroy queens and kings after being scored

#

but

#

im dumb

red flower
#

can i see the code

elfin stratus
#

this is so bad that i dont want to show it

red flower
elfin stratus
#

ohhhh

#

now i see what i did wrong

#

thanks

#

i got (context.destroy_card:get_id() == 12 or context.destroy_card:get_id() == 13) this part wrong

#

probably due to my non existent lua skills

lyric blade
#

Ok guys uhm I'm using score_card() to score a card in Balatro (I have no other way), but it ignores all jokers, it just scores the card without the joker abilities. How do I calculate the jokers?
Is it just something like calculate_joker()?

keen loom
# red flower info_queue

so... like this?

    key = 'tarot24',
    set = 'Tarot',
    loc_txt = {
        name = 'Carnival of Shadows',
        text = {
        'Creates 3 random {C:dark_edition}Negative{}',
        '{C:tarot}Tarot{} cards.'
        },
    },
    atlas = 'smtarot',
    pos = {x = 0, y = 0},
    loc_vars = function(self, info_queue, card),
        info_queue[#info_queue+1] = G.P_CENTERS.m_dark_edition,
}```
red flower
#

G.P_CENTERS.e_negative

keen totem
#

can you put regular code inside of the func of a return

red flower
#

but also thats not the correct formatting

keen totem
#

basically

#

after being cured

#

viruses can infect again

red flower
#

yes it's just going to be run at the same time as the previous stuff

keen totem
#

so can i put it in an event to wait?

red flower
#

yeah

keen totem
#

ok

#

time to try that

lyric blade
#

How do I take joker abilities in consideration when using score_card()?

red flower
#

i dont think it's that easy

#

what are you trying to do?

keen totem
red flower
#

let's goo

keen totem
#

what the hell have i done

lyric blade
# red flower what are you trying to do?

Well it is a joker that retriggers a lucky card until it triggers (Gives Mult or Money)
I wish I could use return repetitions but I can't, because that way I can't know if the retrigger was lucky this time or not (When I use context.repetition, because it doesn't go through it twice)

#

While not context.lucky_trigger (or something like that) is unusable as well because it would only base around the context of the first scoring of the card (Which means it's an infinite loop)

keen totem
#

it better be

lyric blade
#

No, it's uncommon, because the lucky cards have a 50% chance to be destroyed after that

keen totem
#

ah

#

fair enough

lyric blade
#

So practically a glass cannon, but it's not glass lol

keen totem
#

glass cards are also glass cannons

lyric blade
#

I have heard that one way to do it is to somehow copy the seed and then predict when the next lucky trigger will be, and then do the return repetitions based on the number of retriggers required but that's way too complicated for me and I think there's an easier way, which I found, with score_card()

nova epoch
#
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if context.other_card:get_id() == 13 or context.other_card:get_id() == 11 then
                return {
                    mult = card.ability.extra.mult
                }
            end
        end
    end
}

alright so ive gotten the card effect to work but it only applies when its '...== 13 or context... ' but i want it to trigger specifically when its both a king and jack. is there any way to make it like that or am i just stuck here

red flower
lyric blade
nova epoch
#

i tried

#

i never gave the mult

daring fern
nova epoch
#

so i assume it has to be or

lyric blade
#

Or do I miss something?

red flower
nova epoch
nova epoch
#

not individually

lyric blade
#

Ah ok nvm

nova epoch
#

i did try other contexts

red flower
#

use joker_main and loop through context.scoring_hand

lyric blade
nova epoch
#

ill go do that rq

keen loom
#

my text isn't shrinking

        'Creates 3 random',
        '{C:dark_edition}Negative{} {C:tarot}Tarot{}',
        'cards.',
        '{s:0.8}{C:tarot}Carnival of Shadows{} excluded{}'
        }```
red flower
#

{s:0.8,C:tarot}

wild escarp
#

bump

nova epoch
red flower
wild escarp
#

Yes

keen loom
tight notch
#

what's the difference between the before and after sections?

nova epoch
red flower
tight notch
#

alr

keen loom
#

ok, now "excluded" seems to appear in normal size instead of small

#

nvm, i think i got it

red flower
# wild escarp

for the after scoring part just move the calculate_context call outside the event i think
i don't understand the other problem

nova epoch
red flower
nova epoch
#

right

wild escarp
red flower
keen loom
#

i'm reading the documentation, and i can't figure out what lines to add to make the tarot card spawn cards

wind steppe
#

what do yall think a madeline (food) would do as a balatro joker? i cant think of any ideas but i have to have one for consistency

keen loom
red flower
#

oh

#

SMODS.add_card{set="Tarot", edition="e_negative"} 3 times

#

excluding itself is kinda hard tho

keen loom
wind steppe
#

infinite tarots

tight notch
# tight notch alr

since what i'm trying to do is make all shop jokers have an edition, would i pick before or after?

red flower
red flower
#

I would patch create_card_for_shop instead honestly

#

it's easier

nova epoch
# red flower yes, you probably want to set a flag when you find one of them and a flag for th...

ok so would something like this work? (sorry if its scuffed as fuck im new to coding as a whole)

calculate = function(self, card, context)
    if context.joker_main then
        for i = 1, #context.scoring_hand do
            if context.scoring_hand[i]:get_id() == 13 or context.scoring_hand[i]:get_id() == 11 then
                 if context.scoring_hand[i]:get_id() == 11 or context.scoring_hand[i]:get_id() == 13 then
                    return {
                    mult = card.ability.extra.mult
                    }

i did the ...or... statement again bc i remembered earlier you guys said that the game was looking for a card that was both a king and jack when i had it set to 'and'

nova epoch
#

i figured

tight notch
wild escarp
red flower
tawdry shale
#

lineup so far

wind steppe
red flower
keen loom
#

man, i hate that the documentation is kinda vague

uncut cloud
red flower
# nova epoch i figured
local king = false
local jack = false
for _, pcard in ipairs(context.scoring_hand) do
    if pcard:get_id() == 13 then king = true end
    if pcard:get_id() == 11 then jack = true end
end
if king and jack then return { mult = 10 } end
keen loom
#

i am reading it several times and can't find anything about creating other cards

tawdry shale
keen totem
uncut cloud
keen loom
uncut cloud
#

i usually just search examples of it in the discord if im doubting smthn im not gonna lie

red flower
tawdry shale
uncut cloud
tawdry shale
#

there's a card for that for every suit

#

only four

#

so

nova epoch
# red flower ```lua local king = false local jack = false for _, pcard in ipairs(context.scor...

alright so should this work?

    calculate = function(self, card, context)
        if context.joker_main then
            for i = 1, #context.scoring_hand do
                local king = false
                local jack = false
                for _, pcard in ipairs(context.scoring_hand) do
                    if pcard:get_id() == 13 then king = true end
                    if pcard:get_id() == 13 then king = true end
                end
                if king and jack then return {mult = 10 } end
            end
        end
    end
}

(im gonna assume i replace the mult = 10 with the value i want)

red flower
keen loom
red flower
#

i replaced it with ipairs

midnight coyote
#

how do i iterate over each card in a played hand

red flower
nova epoch
red flower
rough furnace
nova epoch
#
SMODS.Joker{
    key = 'gamexplain',
    loc_txt = {
        name = 'GAMEXPLAIN',
        text = {
            'When a {C:attention}King and Jack{} is in a scored hand,',
            'gain a {C:mult}+#2#{} Mult'
        }
    },
    atlas = 'Jokers',
    pos = { x = 0, y = 0 },
    config = { extra = { mult = 6.9 } },
    loc_vars = function(self,info_queue,card)
        return { vars = { card.ability.extra.mult } }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            local king = false
            local jack = false
            for _, pcard in ipairs(context.scoring_hand) do
                if pcard:get_id() == 13 then king = true end
                if pcard:get_id() == 13 then king = true end
            end
            if king and jack then return { mult = 10 } end
        end
    end
}

alr if everything here is correct then im gonna test it rq

rough furnace
red flower
wild escarp
red flower
nova epoch
#

i may be stupid

#

thanks for that call out lol

#

it worked!

#

thanks alot

red flower
# wild escarp Sorry, but I just do not understand what I should be doing.

hmm you kinda have to change multiple things
but the problem is that you're calling calculate_context multiple times so hologram scales in increments, you need to compile all the cards you create in a list and call it then, you're kinda doing that but you have an outer loop that you're not accounting for

sorry i would mock up the code if i was on my pc lol

nova epoch
#

all i gotta do now is fix the nil on the tooltip

oblique pond
nova epoch
#

oh

#

wonder why the example i used has a 2 instead

oblique pond
#

it's currently looking for the 2nd thing in loc_vars to put there, but nothings there, so it gives you nil

nova epoch
#

ah

#

thanks

stoic fulcrum
#
    key = "bruhiosr",
    blueprint_compat = false,
    loc_txt = {
        name = 'testm',
        text = {"{C:red}+#1#{} hand size,",
            "Earn {C:money}$#3#{} at",
            "end of round.",
            "If {C:red}testfire{}",
            "is in your deck,",
            "{C:red}+#2#{} hand size,",
            "Earn {C:money}$#9#{} at",
            "end of round."}
    },
    pos = { x = 0, y = 0 },
    rarity = 2,
    atlas = 'mindaexperiment',
    blueprint_compat = false,
    cost = 6,
    config = { extra = { h_size = 1, money = 3 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.h_size, card.ability.extra.money, card.ability.extra.money_test} }
    end,
    add_to_deck = function(self, card, from_debuff)
        if context.other_joker.ability.name == 'testfire' then G.hand:change_size(card.ability.extra.h_size+1)
        else G.hand:change_size(card.ability.extra.h_size) end
    end,
    remove_from_deck = function(self, card, from_debuff)
        if context.other_joker.ability.name == 'testfire' then G.hand:change_size(-card.ability.extra.h_size+1)
        else G.hand:change_size(-card.ability.extra.h_size) end
    end,
    calc_dollar_bonus = function(self, card)
        local bonus = 0
        if context.other_joker.ability.name == 'testfire' then
            bonus = bonus + card.ability.extra.money+6
          else
            bonus = bonus + card.ability.extra.money
        end
        if bonus > 0 then return bonus end
    
    end
}```

is there something wrong with how i'm checking for the specific joker? (in this case "testfire")
when i write it like this, it crashes saying that context is a nil value
sturdy compass
#

You don't use context checks in add_to_deck/remove_from_deck

stoic fulcrum
#

how do i do the additional check to change the base values, then?

wind steppe
sturdy compass
#

You don't need to check for the joker name

stoic fulcrum
#

the idea is that "bruhiosr" gives +1 hand size and $3 at the end of round on its own, but with "testfire" in your deck it gives +2 hand size and $9 at the end of round

stoic fulcrum
sturdy compass
#

Then you'd use SMODS.find_card()

#

you specify a string in that call that is the joker's key (being 'j_[MOD PREFIX]_[JOKER NAME]')

stoic fulcrum
sturdy compass
#

It should work

stoic fulcrum
#

it applied the bonus effect without the second joker being in my deck

sturdy compass
#

That's because that function returns an array of cards matching that type, and since it's an array it will always be true

#

You should wrap the function call in a next() wrapper, which checks if the array has contents or not and returns a boolean accordingly

keen loom
#

yeah, i just can't figure out this thing, man:

    key = 'tarot24',
    set = 'Tarot',
    loc_txt = {
        name = 'Carnival of Shadows',
        text = {
        'Creates 3 random',
        '{C:dark_edition}Negative{} {C:tarot}Tarot{} cards.',
        '{s:0.8,C:tarot}Carnival of Shadows{}{s:0.8} excluded{}'
        },
    },
    atlas = 'smtarot',
    pos = {x = 0, y = 0},
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue+1] = G.P_CENTERS.e_negative
    end
    for i = 0, 2 do
        SMODS.add_card{set="Tarot", edition="e_negative"}
    end
}```
#

i'm likely doing something really wrong here

sturdy compass
#

Yes you are

#

you do not have a calculate function defined

stoic fulcrum
sturdy compass
#

You'd do exactly what you're doing inside the if. Unlike vanilla where the game checks for a card's type on calculate, SMODs card objects work on a per-object basis and thus don't need a check like that

keen loom
sturdy compass
#

Oh it's a consumable whoops

#

In your case you would define a use function then

keen loom
sturdy compass
#

Another thing I just noticed: Lua indexes at 1 and not 0

wind steppe
#

more approachable for people that know less coding but god i hate it

#

how do i do ^chips with talisman?

sturdy compass
keen loom
sturdy compass
#

You'll also need a can_use function which returns a boolean
can_use = function(self, card)

sturdy compass
daring fern
keen loom
#

yeah, i think i still don't get it

    use = function(self, card, area, copier)
    if can_use
        for i = 1, 3 do
            SMODS.add_card{set="Tarot", edition="e_negative"}
        end```
wind steppe
#

how would i return two messages on one joker?

red flower
#
return {
    message = "msg",
    extra = {
        message = "msg2"
    }
}
mystic river
#

-# i might have something slightly off there cause I'm typing this from memory on a phone but the basic idea is that functions have two formats

midnight coyote
#

if im applying custom music during a boss blind, how do i make it turn back off afterwards

prime stone
#

Is there a way to prevent playing cards from giving chips? I was gonna use card.debuff but im not really happy with that solution.

#

I guess really the question is should I be using :take_ownership

upbeat bronze
#

does anyone have the keybinds for debug+?

#

they seemingly got rid of the ingame menu showing all the usable keybinds

prime stone
#

holding tab doesnt show them?

upbeat bronze
#

ah

#

forgot it required holding tab

#

thanks

keen loom
#

crashing again

    key = 'tarot24',
    set = 'Tarot',
    atlas = 'smtarot',
    pos = {x = 0, y = 0},
    loc_txt = {
        name = 'Carnival of Shadows',
        text = {
        'Creates 3 random',
        '{C:dark_edition}Negative{} {C:tarot}Tarot{} cards.',
        '{s:0.8,C:tarot}Carnival of Shadows{}{s:0.8} excluded{}'
        },
    },
    config = {
        extra = {
            tarots = 3
        },
    },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue+1] = G.P_CENTERS.e_negative
        return { vars = { card.ability.extra.tarots } }
    end,
    use = function(self, card, area, copier)
        for i = 1, math.abs(card.ability.extra.tarots) do
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                        SMODS.add_card({set = 'Tarot',edition="e_negative"})
                    end
                    return true
                end
            }))
        end
        delay(0.6)
    end
    can_use = function(self, card)
        return true
    end
}```
midnight coyote
#

it keeps playing

#

for as long as the game is open

vestal yew
#

hey gang- im working on my first mod and i keep getting this error. im checking my code against another mod and everything seems to work in theory but when i try running my mod it crashes.

midnight coyote
#

urgh

#

i need a mod that messes with music

#

see what they do

sturdy compass
#

Cryptid areyoustupid

wind steppe
#

cryptid does that with jimball

midnight coyote
#

oh alright

vestal yew
midnight coyote
#

still confused

sturdy compass
wind steppe
#

you could hook it instead

sturdy compass
#

That's probably better

#

idk why but I'm like hardwired to consider patches faster than hooks and it's a problem 😭

wind steppe
#

i mean ive never used a patch so we're both biased

keen loom
#

um... i don't think it was supposed to be an endless, loop, lol

sturdy compass
# vestal yew

What does your file structure in your assets folder look like?

sturdy compass
#

rename jokersLarge to just jokers and remove your atlas pointing to jokersLarge

prime stone
midnight coyote
#

OH

#

i see how the game does it

#

cryptid checks IN the sound

#

it checs for the joker

wind steppe
# prime stone is there anywhere I can readup on patches and hooks
Klei Entertainment Forums

In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...

midnight coyote
#

so i could in theory check for Mafioso and Debt collector

sturdy compass
prime stone
#

thaaaank you

sturdy compass
vestal yew
#

yeah*

sturdy compass
#

hmm

stoic fulcrum
#
    key = "twotestsr",
    blueprint_compat = false,
    loc_txt = {
        name = 'testm',
        text = {"{C:red}+#1#{} hand size,",
            "Earn {C:money}$#3#{} at",
            "end of round.",
            "If {C:red}bruhiosr{}",
            "is in your deck,",
            "{C:red}+#2#{} hand size,",
            "Earn {C:money}$#9#{} at",
            "end of round."}
    },
    pos = { x = 0, y = 0 },
    rarity = 2,
    atlas = 'mindatest',
    blueprint_compat = false,
    cost = 6,
    config = { extra = { h_size = 1, dollars = 3, h_sizetest = 2, dollarstest = 9 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.h_size, card.ability.extra.dollars, card.ability.extra.h_sizetest, card.ability.extra.dollarstest  } }
    end,
    calculate = function(self, card, context)
        if next( SMODS.find_card("j_bruh_bruhiosr") ) then
            card.ability.extra.h_size = card.ability.extra.h_sizetest
            card.ability.extra.dollars = card.ability.extra.dollarstest
        end
    end,
    add_to_deck = function(self, card, from_debuff)
        G.hand:change_size(card.ability.extra.h_size)
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.hand:change_size(-card.ability.extra.h_size)
    end,
    calc_dollar_bonus = function(self, card)
        return card.ability.extra.dollars
    end
}```

i managed to get it to detect when the second joker is in hand, but it doesn't seem to detect when it gets *removed* from the deck (to reset the bonus back to normal). and for some reason, the bonus for adding hand size doesn't work, just the -2 hands from selling the joker while the second joker is active
#

it basically gives a permanent bonus instead of a conditional one (and it doesn't add extra hand size because ????????)

sturdy compass
vestal yew
sturdy compass
#

Your SMODS.load_file call should look like this
assert(SMODS.load_file('path'))()

keen loom
#

ok, so my code works, but instead of 3 negative tarots, it's spawning infinitely

    key = 'tarot24',
    set = 'Tarot',
atlas = 'smtarot',
pos = {x = 0, y = 0},
    loc_txt = {
        name = 'Carnival of Shadows',
        text = {
        'Creates 3 random',
        '{C:dark_edition}Negative{} {C:tarot}Tarot{} cards.',
'{s:0.8,C:tarot}Carnival of Shadows{}{s:0.8} excluded{}'
        },
    },
loc_vars = function(self, info_queue, card)
        info_queue[#info_queue+1] = G.P_CENTERS.e_negative
end,
use = function(self, card, area, copier)
        for i = 1, 3, 1 do
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                        SMODS.add_card({set = 'Tarot',edition="e_negative"})
                    end
            }))
        end
        delay(0.6)
    end,
    can_use = function(self, card)
        return true
end
}```
upbeat bronze
#

anyone have any idea why my game refuses to show scoring animations now even though i have the setting disabled in talisman?

#

like its really confusing me

wind steppe
#

reset game

#

reinstall talisman

upbeat bronze
#

alright

sturdy compass
upbeat bronze
keen loom
wind steppe
#

if you reinstall it you have to turn it off again btw

upbeat bronze
#

i did

wind steppe
#

idk then

#

talisman is a mess

upbeat bronze
#

or do you mean like

#

uninstall, open without talisman, close, reinstall, then try it?

#

is that what you mean?

wind steppe
#

no that shouldnt make a difference

#

may as well try it though

upbeat bronze
#

oop i got it

keen totem
upbeat bronze
#

for some reason saturn was disabling them

keen totem
#

the last one is the increment, which defaults to 1 if not specified

midnight coyote
keen totem
midnight coyote
limber obsidian
#

Yo, uh... how? How do i even make mods o-o

sturdy compass
limber obsidian
#

Aight

#

Thanks

#

Brb

manic rune
sturdy compass
sturdy compass
#

Put a return true on the line after your add_card

high sinew
#

feels good to figure out how to add button to shop😅

sturdy compass
#

YOUR button

high sinew
#

huh?

rough dew
#

My Button

#

🗣️

high sinew
#

oh the name lol

keen totem
#

is there an infoqueue description for boss blinds?

high sinew
#

it gives $100 😭

manic rune
#

i dont think so, no

keen totem
#

how would i pull up the infoqueue of an enhancement?

sturdy compass
keen loom
rustic swallow
#

anyone know why this is giving this error?

stoic fulcrum
# sturdy compass Your calculate is very messed up. The way you have it now is every time a contex...

yeah i'm well aware, lol. i don't really know how to complete the function properly
i tried doing this, but all it seems to accomplish is that the bonus effect isn't triggered unless the second joker is already in my deck

        if next( SMODS.find_card("j_bruh_bruhiosr") ) then
            card.ability.extra.h_size = card.ability.extra.h_sizetest
            card.ability.extra.dollars = card.ability.extra.dollarstest
        end
        if not next( SMODS.find_card("j_bruh_bruhiosr") ) then
            card.ability.extra.h_sizetest = card.ability.extra.h_size
            card.ability.extra.dollarstest = card.ability.extra.dollars
        end
    end,```
sturdy compass
#

Dynamically changing hand size with presence of a second joker the way you want I can see getting hairy very quickly

#

I'm not necessarily saying it can't be done, it just won't be fun

keen totem
#

do tarots that change an enhancement have the infoqueue of said enhancement?

sturdy compass
#

They should

manic rune
#

if you coded it to do so, then yes

#

and i would suggest doing the same for clarity

keen totem
manic rune
#

yes

stoic fulcrum
unborn bay
#

setting a blind?

#

playing a hand?

stoic fulcrum
#

and removed when sold

sturdy compass
stoic fulcrum
sturdy compass
#

Oof understandable

unborn bay
#

use context.card_added

#

for checking if a joker is added

wind steppe
#

is this balanced

sturdy compass
unborn bay
#

yeah you'll probably have to hook onto card:remove

plain apex
#

true my coding is very bad but it works sometimes

unborn bay
#

or just make the joker thats required for that check for it on their side instead

stoic fulcrum
#

also holy shit haya i just realized that's you

#

small world goombakart

wind steppe
unborn bay
#

yes i mod balatro now

sturdy compass
#

haya kinda cracked at it I cannot lie

unborn bay
#

i got sick of ring racer after dynamite derby for a bit

plain apex
tawdry shale
#

working on a joker that gives x.1 mult if hand is the same as the last played hand but it doesn't seem to be working bc it always goes to "if context.scoring_name ~= G.last_hand_played"

wind steppe
#

its through a tag now anyways

manic rune
tight notch
#

attempting to make a joker that gains xmult when a holo card/joker triggers, but so far it's not working. it just refuses to gain the xmult

sturdy compass
plain apex
#

anyway hi chat any ideas for my shitty fortnite mod

sturdy compass
midnight coyote
#

i wonder how i can make a pool for a certain type of joker

#

i wanna make a group for a very specific, yet small pool

plain apex
midnight coyote
manic rune
#

be racist

tawdry shale
sturdy compass
wind steppe
#

1 in 2 chance to say something obscene and destroy itself

tawdry shale
#

ohh

manic rune
#

save the hand's name to card.ability.lastPlayedHand for example

sturdy compass
#

I def could've worded that better originally, my bad lol

timid parrot
tight notch
wind steppe
keen loom
#

ok, i can't figure out a way to make the tarot card not spawn itself, so i might add a condition to spawn 1 tarot when it's negative

wind steppe
#

maybe a little stronger than vanilla but for the most part i want to keep vanilla balance

timid parrot
#

I don’t think exponential mult will ever be “balanced” in the context of vanilla

midnight coyote
#

oh i see

wind steppe
#

rate the balance from 1 to 10 where 1 is "worse than jens almanac" and 10 is "vanilla"

timid parrot
#

Exponential mult multiplies your es

tight notch
# midnight coyote wh

add something similar to the first image in your main lua file and then you can add it to the pools section

plain apex
wind steppe
#

(translation: temperance value)

sturdy compass
tight notch
keen loom
#

how do i add a condition for when the self card is negative?

timid parrot
tawdry shale
#

updated but now i'm getting this error (i'm trying to make a joker that gains x.1 mult if the current hand is the same as the previous hand)

wind steppe
manic rune
midnight coyote
#

its a two time joker

#

that i made

#

for my mod

midnight coyote
#

cough

tight notch
#

sry when i see someone in a fandom i'm in my 2 braincells start cheering

manic rune
#

relatable

timid parrot
wind steppe
#

real

midnight coyote
manic rune
#

forsaken jokers

unborn bay
#

whats a roblox

wind steppe
manic rune
#

in life

#

theres roadblocks

wind steppe
#

but thats just a "win more" button

#

because you cant rely on it

tight notch
manic rune
#

dunno about that, theres no context about playing cards being triggered afaik

#

context.individual and context.cardarea == G.play probably works tho?

plain apex
#

need more fortnite fans to play my horrible creation fr

wind steppe
midnight coyote
#

so when i SMODS.add_card() do i say 'set = "charcuterie_mafia"'

tight notch
#

i have another joker that does the same thing but it's foil instead of holo, and instead of gaining xmult it gives you $1

manic rune
#

oh, but also

tight notch
midnight coyote
#

okie

tawdry shale
manic rune
#

i would probably check editions by using edition.key == "e_holo" instead

manic rune
#

-# i find keys more reliable personally

tawdry shale
plain apex
keen loom
#

how do i check if the self card is negative or not?

wind steppe
# tawdry shale whar

obelisk rewards you for playing different hands and this joker rewards you for playing the same ones

manic rune
#

card.edition and card.edition.key == "e_negative"

#

-# forgot to reply

timid parrot
#

so that's the balance side

tawdry shale
wind steppe
timid parrot
#

in terms of mechanics, there's too many numbers and I had to reread the thing 3 times to understand it

wind steppe
#

baron is balanced in the context of ante 8

timid parrot
#

in the context of ante 8 picking up that food joker wins the next two blinds easy

timid parrot
#

yeah so what's the point of it exactly?

wind steppe
#

cant just roll for it with 30 bucks to your name

wind steppe
#

i needed to add it for consistency

timid parrot
#

XD you're the designer

timid parrot
wind steppe
#

im adding jokers based around the foods bonnie (from in stars and time) gives you and i may as well commit

plain apex
#

pizza consumable can technically beat naneinf if you get there but it also degrades over time so a perkeo build wouldn't keep you in forever

timid parrot
#

did it need to be designed as a rare?

wind steppe
#

probably not

#

i dont have other ideas for what a fish head would do though

timid parrot
#

there are no rare food jokers in vanilla because that 5% chance is too low to be worth throwing effectively a consumable in the pool

#

in an average run, you wouldn't see it until you have a full joker roster

#

and the version you designed is powerful, yes, but it also burns itself after 2 rounds

wind steppe
#

probably lower the decreases

timid parrot
#

if you want a rare food joker, focus on a unique effect other than scoring that can serve as a slow burn

#

rather than just boom, high score, oh it's gone already

midnight coyote
strange wasp
#

Hi, I am somewhat new to modding and I am starting to learn how to make a joker. I have a couple questions to ask. First off, how do I set the code to scale with chips instead of mult?
What coding software is best when coding with SMODS?

Thank you

midnight coyote
#


SMODS.ObjectType = {
  key = "mafia",
  cards = {
    ["j_charcuterie_made_man"] = true,
    ["j_charcuterie_britalian"] = true,
    ["j_charcuterie_debt_collector"] = true,
    ["j_charcuterie_bunny"] = true,
  }
}```
manic rune
#
  1. in return, change mult to chips
  2. preferably vsc (visual studio code)
midnight coyote
#

what could i have possibly done wrong

keen loom
#

trying to add a condition where it'll spawn 1 normal tarot if it's negative, but it's crashing

    key = 'tarot24',
    set = 'Tarot',
    atlas = 'smtarot',
    pos = {x = 0, y = 0},
    loc_txt = {
        name = 'Carnival of Shadows',
        text = {
        'Creates 3 random',
        '{C:dark_edition}Negative{} {C:tarot}Tarot{} cards.',
        '{s:0.8,C:tarot}Carnival of Shadows{}{s:0.8} excluded{}'
        },
    },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue+1] = G.P_CENTERS.e_negative
    end,
    use = function(self, card, area, copier)
        for i = 1, j = 3 do
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    if self.edition = "e_negative" then {
                    SMODS.add_card({set = 'Tarot'})
                    j = 3
                    } else {
                    SMODS.add_card({set = 'Tarot',edition="e_negative"})
                    }
                    return true
                end
            }))
        end
        delay(0.6)
    end,
    can_use = function(self, card)
        return true
    end
}```
tight notch
manic rune
#

do you not have lua extension installed

strange wasp
#

Okay. I have vsc. But it's underlines smods

manic rune
#

in fact, why do so many people code without it

#

sob

midnight coyote
strange wasp
#

I do have the Lua extension on.

keen loom
manic rune
#

:3

wind steppe
keen loom
strange wasp
midnight coyote
manic rune
#

open the entire mods folder in vsc

midnight coyote
#

i see no documentation

manic rune
#

but also, i wouldnt recommend using uppercase in your keys

#

for various reasons

#

-# that i cant remember

prime stone
# sturdy compass You'd prolly need a patch for that. The function that provides the chips is `Car...

Ok I ended up doing it like this since returning the old function in the hook crashed because it didn't like Self. Is this alright to do lol ```lua
if context.before then
function Card:get_chip_bonus()
return 0
end
end

    if context.after then
        function Card:get_chip_bonus()
            if Card.debuff then return 0 end
            if Card.ability.effect == "Stone Card" then
                return Card.ability.bonus + (Card.ability.perma_bonus or 0)
            end

            return Card.base.nominal + Card.ability.bonus + (Card.ability.perma_bonus or 0)
        end
    end
manic rune
#

please don't do that

sturdy compass
#

What in the world

prime stone
#

gulp!

midnight coyote
#

😨

sturdy compass
#

Also I know how to fix that crash. Along with the regular args in the reference function, you can also just pass in self

manic rune
#
local gcb_ref = Card.get_chip_bonus

function Card:get_chip_bonus()
   if #SMODS.find_card("joker key") then
      return 0
   end
   local ret = gcb_ref(self)
   return ret
end
manic rune
#

put that outside of everything else, btw

prime stone
#

should I be passing in self anyway even if it doesn't have parameters

manic rune
#

yes

prime stone
manic rune
#

might have some typos i didnt see in there cuz i typed on phone, sooo

#

:3

midnight coyote
#

the correct way is Card.get_chip_bonus()

manic rune
#

...no?

midnight coyote
#

calling it with the : will call the func

#

which, you do not want to do

manic rune
#

its Card.get_chip_bonus, not Card:get_chip_bonus

strange wasp
#

Oh. The documentation. I'm learning as I go. As of right now I'm just following along with the YT video on how to make a joker.

midnight coyote
manic rune
#

Card.get_chip_bonus wont call the function, you are just grabbing it

manic rune
midnight coyote
#

yeah im an idiot sorry

manic rune
#

i think both . and : work here, if yours works

manic rune
midnight coyote
#

how do i define this objectype ughghg

tawdry shale
#

(i'm trying to make a joker that gains x.1 mult if the current hand is the same as the previous hand) mult is updating properly, resets when the hand is different, but it doesn't actually multiply the score

midnight coyote
#

what am i doing ???

hybrid shadow
tawdry shale
strange wasp
sturdy compass
#

Actually no wait

crisp coral
tall wharf
sturdy compass
stoic fulcrum
manic rune
#
local remove_ref = Card.remove

function Card:remove()
   local ret = remove_ref(self)
   --code
   return ret 
end
hybrid shadow
tawdry shale
#

yeah

#

lemme screen record

midnight coyote
#

are there any mods that implement object types

sturdy compass
stoic fulcrum
manic rune
#

if self.config.center.key == "jokey_key" then

keen totem
#

does talisman add ^ mult support?

manic rune
#

yes

keen totem
#

how

sturdy compass
keen totem
#

like how do i use it

sturdy compass
#

We all have ‘em, dw about it

manic rune
#

emult = ...

keen totem
#

ok

midnight coyote
#

HOW DO I MAKE AN OBJECT TYPE THAT CONTAINS CERTAIN JOKERS!!!! AUGGGGHHHHH

#

im this close

manic rune
#

no clue, never used it before

strange wasp
#

Is there a way to put smods into vsc?

signal rose
tawdry shale
#

roster so far (again)

keen loom
#

can anyone explain why is it crashing?

    key = 'tarot24',
    set = 'Tarot',
    atlas = 'smtarot',
    pos = {x = 0, y = 0},
    loc_txt = {
        name = 'Carnival of Shadows',
        text = {
        'Creates 3 random',
        '{C:dark_edition}Negative{} {C:tarot}Tarot{} cards.',
        '{s:0.8,C:tarot}Carnival of Shadows{}{s:0.8} excluded{}'
        },
    },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue+1] = G.P_CENTERS.e_negative
    end,
    use = function(self, card, area, copier)
        for i = 1, 3 do
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    if self.edition == "e_negative" then 
                    SMODS.add_card({set = 'Tarot'})
                    else 
                    SMODS.add_card({set = 'Tarot',edition="e_negative"})
                    return true
                end
            }))
        end
        delay(0.6)
    end
    can_use = function(self, card)
        return true
    end
}```
hybrid shadow
tawdry shale
#

yeah lmao

manic rune
#

jsjsnsnsn lua extension 😭

#

this is so easily solved if you have it

keen loom
manic rune
#

yes

sturdy compass
tawdry shale
#

me !

sturdy compass
signal rose
lapis night
#

y'all know how The Fool has that text box that shows the last used tarot/planet card? How is that special text box done?

manic rune
#

info_queue

keen totem
#

does anyone know how to get the length of a value stored in omeganum

limber obsidian
#

Um, why is it not loading?

#

Sorry for image quality

#

I dont know how to screen shot on my pc after i broke the prnt screen key

midnight coyote
#

i got it working

keen loom
keen totem
manic rune
#

the extension should show missing symbols and such

signal rose
strange wasp
limber obsidian
manic rune
#

try restarting vsc, and which lua extension did you fownload

midnight coyote
manic rune
#

download*

keen totem
#

we got forsaken in balatro before GTA 6

signal rose
keen loom
midnight coyote
manic rune
keen loom
#

yeah that

manic rune
#

restart your vsc then

keen totem
#

bepis

#

you know stuff about talisman right

scarlet imp
#

I have a Joker that's meant to retrigger certain cards, but whenever the retrigger is about to take place the game crashes, saying "attempt to call 'juice_up' (a nil value)"
so do I need to redefine 'juice_up' for my Joker

limber obsidian
signal rose
#

give me a sec to look over the code

limber obsidian
#

Also how do i even give myself jokers with debugplus

keen totem
limber obsidian
hardy viper
limber obsidian
keen totem
#

i also forgot uh

#

how it works

#

so ima look that up

scarlet imp
#

log() is the opposite of exponents. Exponents = repeated multiplication, log = repeated division

keen totem
#

ya

#

math.floor(log10(x)) is length right?

signal rose
strange wasp
limber obsidian
keen totem
#

log may be a very interesting thing for jokers

scarlet imp
#

yeah, log the chips and X the mult by the same amount or something

limber obsidian
keen totem
#

actually wait

scarlet imp
#

like a cursed Plasma deck almost

keen totem
#

what is the log thing in talisman

#

cause youd absolutely need a custom for that

limber obsidian
#

Uhh @signal rose let me get some better images

signal rose
#

it should say something like metadata issue if memory serves

scarlet imp
#
if context.repetition and context.cardarea == G.play then
    if context.other_card:is_suit(card.ability.extra.current_suit) then
        return {
            message = localize("k_again_ex"),
            repetitions = card.ability.extra.triggers,
            card = self
        }
    end
end

this retrigger code keeps throwing errors, saying its trying to call 'juice_up' which is nil

#

the errors aren't being thrown by my code directly, just as a result of trying to retrigger I think

signal rose
limber obsidian
#

This was from loading up the mods

keen loom
signal rose
#

can you copy paste what the metadata file has?

limber obsidian
signal rose
#

yeah

limber obsidian
#

Heres a closer image

signal rose
#

comma on the end of prefix

limber obsidian
#

And ill try to copy paste

signal rose
#

missing

limber obsidian
signal rose
#

lmao happens to us all

scarlet imp
#

if I had a nickel for every forgotten comma I might be as loaded as LocalThunk after making this game

limber obsidian
signal rose
#

load it up and see if its working

keen loom
# keen loom ok, it fixed the crashing, but the card is not working as intended

i made it so if the tarot card itself is negative, it'll create one normal tarot instead of 3 negative tarots, but it's not working

    key = 'tarot24',
    set = 'Tarot',
    atlas = 'smtarot',
    pos = {x = 0, y = 0},
    loc_txt = {
        name = 'Carnival of Shadows',
        text = {
        'Creates 3 random',
        '{C:dark_edition}Negative{} {C:tarot}Tarot{} cards.',
        '{s:0.8,C:tarot}Carnival of Shadows{}{s:0.8} excluded{}'
        },
    },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue+1] = G.P_CENTERS.e_negative
    end,
    use = function(self, card, area, copier)
        for i = 1, 3 do
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    if self.edition == "e_negative" then 
                        SMODS.add_card({set = 'Tarot'})
                    else 
                        SMODS.add_card({set = 'Tarot',edition="e_negative"})
                    end
                    return true
                end
            }))
        end
        delay(0.6)
    end,
    can_use = function(self, card)
        return true
    end
}```
limber obsidian
#

Uhhh

#

Kinda?

#

Text broke

#

DOOOR STUCK

#

DO- DOORS STUCK

#

Type stuff

scarlet imp
#

The numbersr between the hashtags work as arguments, so it should be the corresponding number listed in loc_vars

scarlet imp
#

so change it to #1# and put 69420 as the first argument in vars in your loc_vars function

limber obsidian
#

Same number

scarlet imp
#

ye

#

it says nil bc its looking for the 69420th argument yk

keen loom
limber obsidian
scarlet imp
#

indeed

#

works now?

signal rose
limber obsidian
#

Yep*

signal rose
#

should be if self.edition.negative if im remembering correctly

limber obsidian
#

Thanks guys

signal rose
scarlet imp
signal rose
#

lemme read the prior messages quickly

limber obsidian
#

Also in uh

#

Required mods

#

How do i make it require smod

#

I put steammodded

signal rose
#

should just be setting it as a dependancy

limber obsidian
limber obsidian
scarlet imp
# limber obsidian How do i make it require smod

I've been using SMODS.Joker and all that stuff for my Jokers without the dependency, it's definitely more secure that way but if you just want to test the Jokers rn I don't think you need it

signal rose
#
        "Steamodded (>=1.*)"
]```
#

that will make it require some version of steamodded at least

limber obsidian
#

Yeah, this was just my test joker

limber obsidian
signal rose
#

wait that will allow stable builds but not beta lol

limber obsidian
signal rose
#

that would straight up disallow beta as far as i can tell, probably a bad idea, just use this

        "Steamodded (>=1.0.0~ALPHA-0321b)"
    ],```
#

allows basically any usable version of steamodded

scarlet imp
#

better to make it work for any version, rather than making you redo work later potentially

hard vigil
#

garbshit

scarlet imp
#

just good practice

limber obsidian
#

Alright, everythings done

#

And now i gotta see if it scores

signal rose
scarlet imp
#

I'll get the exact error message one sec

signal rose
#

all gd

scarlet imp
#
functions/common_events.lua:1017: attempt to call method 'juice_up' (a nil value)

not my code, so something must be written wrong that makes the game think 'juice_up' is nil

signal rose
#

whats the full smods.joker code? (if thats what you're using)

scarlet imp
#
SMODS.Joker {
    key = "checkered_joker",
    loc_txt = {
        name = "Checkered Deck Joker",
        text = {
            "Retrigger each",
            "played {V:1}#1#{} card",
            "{s:0.8}suit swaps at end of round"
        },
        unlock = {
            "Win a run with the",
            "{C:attention}Checkered Deck"
        }
    },
    config = {
        extra = {
            triggers = 1,
            current_suit = "Spades"
        }
    },
    rarity = 3,
    pos = { x = 4, y = 1 },
    atlas = "jokers",
    cost = 8,
    unlocked = false,
    unlock_condition = {type = "win_deck", deck = "b_checkered"},
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true,

    loc_vars = function(self, info_queue, card)
        return {
            vars = {
                localize(card.ability.extra.current_suit, "suits_singular"),
                colours = {
                    G.C.SUITS[card.ability.extra.current_suit]
                }
            }
        }
    end,

    calculate = function(self, card, context)
        if context.end_of_round then
            if card.ability.extra.current_suit == "Spades" then
                card.ability.extra.current_suit = "Hearts"
            else
                card.ability.extra.current_suit = "Spades"
            end
        end

        if self.debuff then return end
        if context.repetition and context.cardarea == G.play then
            if context.other_card:is_suit(card.ability.extra.current_suit) then
                return {
                    message = localize("k_again_ex"),
                    repetitions = card.ability.extra.triggers,
                    card = self
                }
            end
        end
    end
}
#

its alot lol

#

everything else works perfect, just the retrigger causing crashes

keen loom
signal rose
keen loom
manic rune
#

can you take a ss of your code
-# im on phone so i cant read pasted code :3

keen loom
#

i added a new condition

scarlet imp
signal rose
scarlet imp
#

I copied the retrigger code from Hack, but I guess I should be copying from the SMODS rebuilt version instead which doesn't have that

signal rose
#

oh yeah definitely

scarlet imp
#

no the card variable is still there, just removed the two lines surrounding the repetitions line

keen loom
signal rose
#

bepis you want a screenshot of code or pasted?

manic rune
#

ss would be nice

#

i can read pasted code albeit very slowly

signal rose
#

not sure how to get the input_text box and the paste button to go inline with the text
i know the issues stems from the fact that create_text_input returns a column but i cant figure out how to get it to line up

#

i tried how it does it in the seeded run section but im pretty sure that only functions because its an object

keen loom
#

the game crashes if i click the card during gameplay

manic rune
#

i can see why

#

in can_use, dont use self, use card

#

and card.edition wont exist if it doesn't have an edition, trying to check .negative from which will crash

#

if not card.edition or card.edition.key ~= "e_negative" then

#

but also, you should be returning false or true

signal rose
scarlet imp
#

to make custom unlocks for things, we use the check_for_unlock function right

keen loom
#

and it's crashing

flat vine
#

Just started learning about modding.
Is there a way to test features real-time because I've been doing code edit and open the game and exit the game and repeat.

keen totem
#

we all just exit and reload

#

be happy you dont have to wait 5 minutes per update with balatro like with some games

#

just to find out

#

you have

#

a

#

syntax error

#

and you dont even have a console

#

to find out what happened

flat vine
#

I see, so I'm not insane for doing it this way, thanks a lot

keen totem
#

modding literally any other game made me realize just how ass pavlov is to mod

#

it takes 5 minutes per update, with no console, an entirely different device you have to test on, and all you have as feedback is the effects ingame

keen loom
flat vine
#

Oh there's a hotkey

#

How does one set it up

daring fern
stoic fulcrum
#

trying another method
is there any way i can change this for the check to work?

keen loom
keen totem
#

m

flat vine
#

Alright thank you

primal terrace
daring fern
stoic fulcrum
stoic fulcrum
keen totem
#

whats the joker with the buff's base and buffed effects?

keen loom
#

my game is crashing whenever i try to use the card

keen totem
#

is the one that buffs the other's only effect to buff that joker

#

and do you have an in_pool function if so?

stoic fulcrum
keen totem
#

its fine then

#

only need in_pool if a joker NEEDS another to work

#

what are the effects tho

stoic fulcrum
keen totem
#

like what is it before buff and after buff

keen totem
keen loom
stoic fulcrum
keen totem
#

alright

#

so

daring fern
keen loom
#

this tarot card creates 3 negative tarots, but 1 normal tarot if it's negative itself

keen totem
#

use an update function to change the vars of the first joker if the other is found

daring fern
keen totem
#

so you can get the first joker after the second and still get the buffs

#

(also its simpler)

keen totem
#

base never changes

stoic fulcrum
keen totem
#

changed = base * 2 if joker found

keen loom
daring fern
keen totem
#

uh

#

all you need in calc is the adding of $ and handsize

keen loom
keen loom
#

yeah, it's already in my code

#

so?

daring fern
#

Also you need to change the one at the bottom.

stoic fulcrum
keen totem
#

wait

#

when does this trigger

#

the money

stoic fulcrum
#

at the end of the round

scarlet imp
#

you want it to work like Golden Joker then? where the money received happens at the end of the round?

keen loom
stoic fulcrum
#

right now it only works if the second joker is bought after the first joker, but not in the opposite

#

and it's not properly debuffed if the second joker is sold or destroyed

scarlet imp
#

if you want it to work like Golden Joker use calc_dollar_bonus instead of calculate

keen loom
#

oh

#

lol

scarlet imp
#
calc_dollar_bonus = function(self, card)
        local dollar_bonus = card.ability.extra
        return dollar_bonus
    end

I have this for one of my Jokers and it works perfectly

stoic fulcrum
#

it's the value increase/reduction based on the ownership of the supporting joker that i'm having issues with

keen totem
#

how do you set hand size

#

one sec

stoic fulcrum
#

same way juggler works

#

on base, at least

keen loom
# daring fern

ok i replaced "or" with "and". now instead of crashing on use, it crashes on clicking the card. same error

daring fern
thorn furnace
#

how would I get a joker to trigger whenever a card is retriggered

keen loom
keen totem
#

yea i just ran into a problem

#

i was gonna try to code the joker youre trying to make

#

but you actually cant do update

#

bc change hand size is changing not setting

daring fern
keen totem
keen loom
#

ok, i just need to remove "not"

keen totem
#

yea you do have to do it whenever you sell or buy the other joker

daring fern
keen totem
#

but also do a check when you buy the first if the other already exists

stoic fulcrum
keen totem
stoic fulcrum
#

so the way i'm doing it, i'm stuck with not being able to trigger it the other way around?
the decreasing checks do work if the conditional also works, but i haven't found a way to make a conditional related to selling or destroying work yet

keen totem
#

lets say joker1 is the guy that gets buffed
joker2 is the guy that buffs him

keen loom
keen totem
#

yea idk i need to sleep youre on your own

daring fern
scarlet imp
#

trying to replicate the behavior of Observatory in a Joker, so I pretty much copy-pasted the code:

calculate = function(self, card, context)
        if self.debuff then return end
        if context.consumeable and context.other_consumable.ability.set == "Planet" and context.other_consumable.ability.consumeable.hand_type == context.scoring_name then
            return {
                x_mult = card.ability.extra.Xmult,
                message_card = context.other_consumable
            }
        end
    end

but it only procs once, even if multiple planet cards of the specified poker hand are held

stoic fulcrum
#
    key = "testfiresr",
    blueprint_compat = false,
    loc_txt = {
        name = 'testm',
        text = {"{C:red}+#1#{} hand size,",
            "Earn {C:money}$#3#{} at",
            "end of round.",
            "If {C:red}bruhio{}",
            "is in your deck,",
            "{C:red}+#2#{} hand size,",
            "Earn {C:money}$#9#{} at",
            "end of round."}
    },
    pos = { x = 0, y = 0 },
    rarity = 2,
    atlas = 'mindatest',
    blueprint_compat = false,
    cost = 6,
    config = { extra = { h_size = 1, dollars = 3, h_sizetest = 2, dollarstest = 9, h_sizereset = 1, dollarsreset = 3 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.h_size, card.ability.extra.dollars, card.ability.extra.h_sizetest, card.ability.extra.dollarstest,  card.ability.extra.h_sizereset, card.ability.extra.dollarsreset  } }
    end,
    calculate = function(self, card, context)
        if context.card_added and table.contains(bruhio, context.card.config.center.key) then
            G.hand:change_size(1)
            card.ability.extra.h_size = card.ability.extra.h_sizetest
            card.ability.extra.dollars = card.ability.extra.dollarstest
            if context.selling_card and not context.blueprint and context.card.config.center.key == "j_bruh_bruhio" then
                G.hand:change_size(-1)
                card.ability.extra.h_size = card.ability.extra.h_sizereset
                card.ability.extra.dollars = card.ability.extra.dollarsreset
            end
        end
    end,
    add_to_deck = function(self, card, from_debuff)
        G.hand:change_size(card.ability.extra.h_size)
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.hand:change_size(-card.ability.extra.h_size)
    end,
    calc_dollar_bonus = function(self, card)
        return card.ability.extra.dollars
    end
}```

i'll repost my code in case anyone can figure out the solution to this ![Prayge](https://cdn.discordapp.com/emojis/869136865201119275.webp?size=128 "Prayge") 
currently the "bruhio" buff works only if "bruhio" is bought second, but not if "bruhio" is already owned. when "bruhio" is sold, the conditional to reduce the buffs back to normal doesn't get applied (debuffing itself already works, it just doesn't have a proper conditional)
it's meant to be +1 hand size $3 at the end of round at base, and +2 hand size $9 at the end of round when buffed
daring fern
keen loom
signal rose
daring fern
signal rose
#

fair

thorn furnace
scarlet imp
daring fern
scarlet imp
#

hang on I mispelled it lmao

#

now its telling me I have an error in my loc_vars when it worked perfectly before 😭

daring fern
primal terrace
scarlet imp
#
loc_vars = function(self, info_queue, card)
    return {
        vars = {
            card.ability.extra.Xmult
        }
    }
end,

corresponding config:

config = {
    extra = {
        Xmult = 1.5
    }
},
scarlet imp
#

if more is need lmk

primal terrace
#

Not sure if there's a simpler way to do it in vanilla

scarlet imp
#

line 330 is the "card.ability.extra.Xmult" line btw

primal terrace
thorn furnace
#

is lua like python where you can just make up properties and as long as it's consistent then it's fine

scarlet imp
daring fern
scarlet imp
thorn furnace
scarlet imp
thorn furnace
#

o

daring fern
thorn furnace
# primal terrace

was just wondering if i would literally just have to swap the name of the property here

scarlet imp
#

new if:

if context.other_consumable and context.other_consumable.ability.set == "Planet" and context.other_consumable.ability.hand_type == context.scoring_name then
#

same issue as before

#

full joker code:

SMODS.Joker {
    key = "nebula_joker",
    loc_txt = {
        name = "Nebula Deck Joker",
        text = {
            "{C:planet}Planet{} cards in your",
            "{C:attention}consumable{} area give",
            "{X:red,C:white} X#1# {} Mult for their",
            "specified {C:attention}poker hand"
        },
        unlock = {
            "Win a run with the",
            "{C:attention}Nebula Deck"
        }
    },
    config = {
        Xmult = 1.5
    },
    rarity = 3,
    pos = { x = 1, y = 1 },
    atlas = "jokers",
    cost = 8,
    unlocked = false,
    unlock_condition = {type = "win_deck", deck = "b_nebula"},
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = false,

    loc_vars = function(self, info_queue, card)
        return {
            vars = {
                card.ability.Xmult
            }
        }
    end,

    calculate = function(self, card, context)
        if self.debuff then return end
        if context.other_consumable and context.other_consumable.ability.set == "Planet" and context.other_consumable.ability.hand_type == context.scoring_name then
            return {
                x_mult = card.ability.Xmult,
                message_card = context.other_consumable
            }
        end
    end
}
daring fern
scarlet imp
#

so rename the variable in config or create a local variable PlanetXmult in calculate

scarlet imp
daring fern
scarlet imp
#

yeah one sec

daring fern
#

Try removing the if self.debuff then return end

scarlet imp
#

situation:

#

playing a Pair only gives 1.5X mult when I should be getting 2.25x (1.5 * 1.5)

#

if I can't get it to work I'll just scrap the idea, I'm kinda upset that I can't get it to work though

nova eagle
#

im assuming this is the right way to check if cavendish is extinct... right?

daring fern
#

You would have to add it manually.

nova eagle
#

how would i do that?

daring fern
nova eagle
#

which one is easier?

nova eagle
nova eagle
#

huh... i didnt know that

scarlet imp
wintry solar
thorn furnace
#

How would you go about making code run at the end of your played hand
I wanted to reset the xmult my joker gained after each hand is played

nova eagle
#

i see what i have to add, i just have no clue how to add it

nova eagle
thorn furnace
daring fern
scarlet imp
daring fern
scarlet imp
#
SMODS.Joker {
    key = "nebula_joker",
    loc_txt = {
        name = "Nebula Deck Joker",
        text = {
            "{C:planet}Planet{} cards in your",
            "{C:attention}consumable{} area give",
            "{X:red,C:white} X#1# {} Mult for their",
            "specified {C:attention}poker hand"
        },
        unlock = {
            "Win a run with the",
            "{C:attention}Nebula Deck"
        }
    },
    config = {
        extra = {
            xmult = 1.5
        }
    },
    rarity = 3,
    pos = { x = 1, y = 1 },
    atlas = "jokers",
    cost = 8,
    unlocked = false,
    unlock_condition = {type = "win_deck", deck = "b_nebula"},
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = false,

    loc_vars = function(self, info_queue, card)
        return {
            vars = {
                card.ability.extra.xmult
            }
        }
    end,

    calculate = function(self, card, context)
        if self.debuff then return end
        if context.joker_main and context.other_consumable.ability.set == "Planet" and context.other_consumable.ability.consumeable.hand_type == context.scoring_name then
            return {
                x_mult = card.ability.extra.xmult,
                message_card = context.other_consumable
            }
        end
    end
}

modified code

daring fern
scarlet imp
#

same crash:
attempt to index field 'other_consumable' (a nil value)
occurs on the line containing context.joker_main

nova eagle
daring fern
wintry solar
nova eagle
scarlet imp
wintry solar
scarlet imp
#

thank you all so much for the help, this Joker was a nightmare lol

daring fern
nova eagle
#

ohhh

#

thats alot more simple than i thought

cinder cliff
#

Does anyone know how to create a custom booster pack? I am having trouble understanding the wiki

#

I don't want to add custom cards or anything to it

#

It would be like a standard pack but beefier

summer furnace
#

Is there a way to give a random amount of money between -20 and 20 after a round (with a joker)? I am having trouble understanding the example mods from the guide
This is my Function that crashes the game: SMODS.Joker { key = 'joker2', loc_txt = { name = 'Gold Gold Gold', text = { "Gain any Value between {C:money}-20${} and {C:money}20${}" } }, config = { extra = { money = 4 } }, rarity = 1, atlas = 'FunnyMod', pos = { x = 0, y = 0 }, cost = 6, calc_dollar_bonus = function(self, info_queue, card) return { vars = { math.Random(-20, 20)} } end, }
And the crash error log is in the txt

daring fern
#

Also you just do return pseudorandom("seed", -20, 20) in calc_dollar_bonus

thorn furnace
#

i feel like the game is gaslighting me at this point

summer furnace
#

Okay, I'll try that

keen loom
#

is it possible to change the rarity colors and names?

summer furnace
keen loom
daring fern
thorn furnace
#

it should
lemme triple check

#

time to count the amount of brackets my thing is using

#

it seems to have an ending yea

#

one sec lemme kill the whitespace

#
broken_record = {
        name = "Broken Record",
        text = {     
            "This Joker gains",
            "{X:mult, C:white} X#1# {} Mult each",
            "time a scored card is retriggered",
            "Resets at the end of hand",
        "{C:inactive}(Currently {X:mult, C:white} X#2# {C:inactive} Mult)"
        },
        config = { extra = { x_mult = 1, x_mult_gain = 0.1 } },  
        pos = { x = 0, y = 0 },
        rarity = 2,
        cost = 1,
        blueprint_compat=true,
        eternal_compat=true,
        unlocked = true,
        discovered = true,
        effect=nil,
        soul_pos=nil,

        calculate = function(self, context)
            if self.debuff then return nil end
            if context.joker_main then
                return {
                    Xmult = self.ability.extra.x_mult
                }
            end
            
            if context.individual and context.cardarea == G.play then
                if not context.blueprint then
                    if not context.other_card.retriggered then
                        context.other_card.retriggered = true

                    else
                        self.ability.extra.x_mult = self.ability.extra.x_mult + 0.1
                
                        return {
                            extra = {focus = self, message = localize('k_upgrade_ex')},
                            card = self,
                            colour = G.C.RED
                        }
                end
            end

            if context.after and self.ability.extra.x_mult > 1.0 then
                self.ability.x_mult = 1
                    return {
                        card = self,
                        message = localize('k_reset')
                    }
                    end
            end
        end,
        
        loc_def = function(self)
            return { self.ability.extra.x_mult_gain, self.ability.extra.x_mult }
        end
    }
cinder cliff
#

Hey guys, what kind do I use if I want to make a booster pack act like a standard one?

#

Or does it not matter?

keen loom
#

why is the color not changing?

    key = 'cr_common',
    loc_txt = {
        name = 'Common',
    },
    badge_colour = "#78412F",
    pools = {
    ["brave"] = true
    }
}```
summer furnace
#

could I set earned money from a round to 0?

summer furnace
cinder cliff
#

they use 'colour' all over the game

daring fern
summer furnace
keen loom
daring fern
keen loom
daring fern
thorn furnace
summer furnace
daring fern
cinder cliff
#

Hey guys, I am trying to make a custom booster pack, and I got this error:

#

oh wait I don't think I included loc_vars

#

oh I don't need them for a booster

summer furnace
daring fern
#

When you die you get no rewards when mr bones saves you.

summer furnace
#

in the code it just saves you, there isn't anything about money, atleast not anything I see