#💻・modding-dev

1 messages · Page 315 of 1

steady smelt
#

i want to have multiple frames shown on top of each other layered but not by setting multiple sprites

faint yacht
#

Layered... need to add more layers to be drawn then.

steady smelt
#

so like x=1, y=1 and x=1, y=2 both layered on top of each other combined in-code

then the combined sprite set as card.children.center

#

but not by setting multiple sprites

faint yacht
#

-# Not sure about such being a possibility in the way you imply it, then.

gusty iron
#

-# a little help here please

blissful lance
#

Maybe you can change the sprite and draw the card each time you change it?

steady smelt
#

i know there are ways to do it natively in other languages but not sure about lua or if there's something built in to balatro

steady smelt
faint yacht
gusty peak
#

trying to find the color scheme

#

in vanila code

dapper sun
#

how do i unlock a joker from inside another?

gusty iron
#
loc_vars = function()
  return {
    vars = {
      G.GAME.hands["JCJ_fullerhouse"].level,
  colours = { 
    G.C.HAND_LEVELS[math.min(7,
      G.GAME.hands["JCJ_fullerhouse"].level
    )]
  }
      G.GAME.hands["JCJ_fullerhouse"].l_mult,
      G.GAME.hands["JCJ_fullerhouse"].l_chips
    }
  }
end,

does this work?

stiff locust
#

how do I change the rank of a playing card

blissful lance
#

is there a way to manually trigger the "x1.5" message for the jokers for example, because I'm making a joker kinda like glass joker

gusty peak
stiff locust
gusty iron
stiff locust
#

the code ran but it did nothing

#

asserting them caused crashes and doing it without asserting only works on jokers

#

i need to do this during a deck's apply function

#

i wanna change the starting deck

red flower
#

idk much about decks but maybe the problem is the timing, are you doing it inside an event?

gusty peak
#

try this

gusty iron
#

which line do i replace

gusty peak
#

in colours

spiral hawk
#

I might need help with a custom joker

gusty iron
#

JIPPIE

gusty peak
#

try upgrading hand

stiff locust
#

am i supposed to do that/not supposed to do that

red flower
#

youre supposed to do it

stiff locust
#

okay

#

well then idk

red flower
#

yeah its weird

gusty iron
#

i totally matched the style

#

okay time to make the other 3 hands

tall kestrel
#

what are you going to call them?

midnight coyote
#

how can i make an enhancement check if it’s getting taken away

tall kestrel
#

man I don't know modding but i think this will have the answers you need

steady smelt
#

how would i make a joker that prevents cards from being debuffed? should i just iterate through all cards on context.first_hand_drawn and un-debuff them or does that work?

daring fern
red flower
#

you can also return { prevent_debuff = true } in context.debuff_card i think

steady smelt
#

this doesn't seem to work, i'm assuming the boss blinds set them constantly to make stuff like wild cards enhanced during the round still be debuffed

steady smelt
#

well actually i want the card to be debuffable if you remove the joker and that's permanent no? so i don't think that would work

red flower
steady smelt
#

okay, how would i actually set that then? like where do i return it

stiff locust
#

where's the code for challenges

#

if i could just lift the whole deck from the ride the bus challenge that would be convenient

steady smelt
red flower
#

context.debuff_card is the card as well if you need to do any checks

stiff locust
#
deck = {
            cards = {{s='D',r='4',},{s='D',r='5',},{s='D',r='6',},{s='D',r='7',},{s='D',r='8',},{s='D',r='9',},{s='D',r='T',},{s='D',r='J',},{s='D',r='Q',},{s='D',r='K',},{s='D',r='J',},{s='D',r='Q',},{s='D',r='K',},{s='C',r='4',},{s='C',r='5',},{s='C',r='6',},{s='C',r='7',},{s='C',r='8',},{s='C',r='9',},{s='C',r='T',},{s='C',r='J',},{s='C',r='Q',},{s='C',r='K',},{s='C',r='J',},{s='C',r='Q',},{s='C',r='K',},{s='H',r='4',},{s='H',r='5',},{s='H',r='6',},{s='H',r='7',},{s='H',r='8',},{s='H',r='9',},{s='H',r='T',},{s='H',r='J',},{s='H',r='Q',},{s='H',r='K',},{s='H',r='J',},{s='H',r='Q',},{s='H',r='K',},{s='S',r='4',},{s='S',r='5',},{s='S',r='6',},{s='S',r='7',},{s='S',r='8',},{s='S',r='9',},{s='S',r='T',},{s='S',r='J',},{s='S',r='Q',},{s='S',r='K',},{s='S',r='J',},{s='S',r='Q',},{s='S',r='K',}},
            type = 'Challenge Deck'
        },

yeah this doesn't help

steady smelt
red flower
#

yeah in calculate

#

forgot the return 😛

steady smelt
#

but yeah it's not in a helpful format lol

stiff locust
#

i mean i know what the deck is

#

but i don't think that helps me when making a custom deck

#

i just want a deck with a lot of face cards man

#

destroying the cards and recreating them ended up with random deck layouts and changing the ranks hasn't worked

red flower
#

can you paste the code here i want to test it

steady smelt
steady smelt
#

ohh gotcha so if context.debuff_card is just checking that there is a debuffed card at all

#

sry missed that message

red flower
#

no, it goes through every card even if its not debuffed

#

(im pretty sure)

stiff locust
# red flower can you paste the code here i want to test it

this should replace 2s with jacks, 3s with queens and 4s with kings
currently it does nothing

G.E_MANAGER:add_event(Event({
            func = function()
                for index, value in pairs(G.playing_cards) do
                    if not value:is_face() and value:get_id() <= 4 then
                        if value:get_id() == 2 then
                            SMODS.change_base(value, nil, "11")
                        elseif value:get_id() == 3 then
                            SMODS.change_base(value, nil, "12")
                        elseif value:get_id() == 4 then
                            SMODS.change_base(value, nil, "13")
                        end
                    end
                end
                return true
            end
        }))
sleek siren
#

How do I destroy certain cards scored after the cards are played?

steady smelt
#

so like

    calculate = function(self, card, context)
        if context.debuff_card then
            if context.debuff_card.is_suit(SMODS.Suits.Hearts) then
                return { prevent_debuff = true }
            end
        end
    end

should make it not debuff just hearts yeah?

red flower
#

:is_suit but yeah

steady smelt
#

right yeah

sturdy monolith
#

how can i make cards highlightable in the collection?

gusty iron
steady smelt
faint yacht
#

Also, "Jack", "Queen", "King" respectively iirc.

stiff locust
spiral hawk
#

Fuck, I never coded in lua before, damn

stiff locust
#

also you have to use numbers for face card rank changes don't you

red flower
faint yacht
#
This function returns nil if it fails, with the second argument being a string with an error message. It is recommended to always wrap calls to it in assert so errors don't go unnoticed.
red flower
#

tested it with queen and worked

stiff locust
#

when you search for them with get_id() you have to search for 13 to get king

#

what

spiral hawk
red flower
#

13 is the id "King" is the key basically

faint yacht
#
function SMODS.change_base(card, suit, rank)
  ...
  local _rank = SMODS.Ranks[rank or card.base.value]
  ...
end
faint yacht
#

That automatically converts to the right internal ID.

stiff locust
#

finally....

#

well i'm pissed about the solution

#

but thanks

#

i can move on now

spiral hawk
#

Hey, uhh…

#

I have a question

stiff locust
#

misprint uses dynatext

#

that's how it does the text

red flower
spiral hawk
#

If I only want to make the ace of hearts count, how can I do that in Lua?

red flower
#

You want to make only the ace of hearts score?

spiral hawk
#

For X3 mult, yeah

red flower
#

you have a joker that makes each ace of hearts give X3 mult?

spiral hawk
#

Hold on

rugged pier
#
    config = {extra = { xmult = 1, mult_mod = 0.1, debuffed_cards = {} } },
    calculate = function(self, card, context)
        if context.setting_blind then
            for k, v in ipairs(card.ability.extra.debuffed_cards) do
                if v ~= nil then
                    v:set_debuff(true)
                end
            end
        end

line 26: v:set_debuff(true)
what am i doing wrong here?

spiral hawk
#

There we go

red flower
#

ohh

spiral hawk
#

Yeah

red flower
#
if context.joker_main then
    for _, scored_card in ipairs(context.scoring_hand) do
        if scored_card:get_id() == 14 and scored_card:is_suit("Hearts") then
            return {
                xmult = 3
            }
        end
    end
end
#

something like that

rugged pier
#

think they want full_hand

#

description says played hand

spiral hawk
#

Something like that

rugged pier
#

i want to store some cards every round that im debuffing and at the start of the round i want to re-debuff them (since debuffs are reset after each round)

#

but those cards could potentially get destroyed

stiff locust
#

how do i access a suit color again

rugged pier
#

becoming nil in the debuffed_cards table

red flower
#

you can use context.debuff_card

#

idk how you would save them properly tho

spiral hawk
stiff locust
#

remove that property from all cards that have it if you get rid of it

red flower
#

maybe yeah

gusty iron
#

2 questions:

How do i make a joker have an unlock requirement
How do i check the sticker a joker has

red flower
#

idk how that works on reload tho

stiff locust
rugged pier
#

ah

stiff locust
#

you can then search for cards that have that value

#

to save a group of cards

rugged pier
#

right but if another joker sets a debuff, i dont want to interact with those cards

#

i suppose i could create a card property of my own?

#

and just loop through all playing cards

red flower
#

thats what she was saying yes

rugged pier
#

oh i thought prefix_debuff is an existing property

stiff locust
#

nope

rugged pier
#

ahh

#

perfect

#

thank you so much!

stiff locust
#

you can create your own values whenever

#

just add your mod prefix

rugged pier
#

gotcha

#

yup

stiff locust
#

some vanilla cards do this

stiff locust
#

like ceremonial dagger uses card.getting_sliced and vamprie uses card.vampired iirc

stiff locust
#

get_joker_win_sticker(center)

gusty iron
#

waht if i want to check a different joker's sticker

stiff locust
#

unless you mean perishable/rental/eternal as in stickers

gusty iron
stiff locust
#

you put the center of the joker whose sticker you wanna check

#

if you know the key of the joker you can do it like this
G.P_CENTERS.j_splash

#

but if you don't know the key you can do
G.P_CENTERS["j_splash"]

#

which is the same as the first one, but you can use a variable to enter that value

#

it returns as a string in all lowercase

daring fern
stiff locust
#

mb

gusty iron
#

so how would i check for gold sticker

#

gold stake sticker, that is

stiff locust
#

if get_joker_win_sticker(G.P_CENTERS.j_splash) == "gold" then

#

that said

#

some mods add other stakes

#

most notably cryptid adds a fuck ton of stakes above gold

stiff locust
daring fern
stiff locust
#

no doesn't get_joker_win_sticker return a string

#

what do you mean you can make it return a number

wintry solar
#

it can return both iirc

gusty iron
#

so would this be right

    check_for_unlock = function(self, args)
        return get_joker_win_sticker(G.P_CENTERS.j_JCJ_jr, true) >= 8
    end
bright axle
#

how can i use a label when i return a message?

daring fern
bright axle
#

i what to use a localized mensage

daring fern
gusty iron
#

im changing its ability, but jippie

bright axle
#

can i retun a messege anywhere i want?

worldly thicket
#

Is there a way to check if the blind that is being set is the Boss Blind?

stiff locust
hasty mist
#

is it possible to animate the round score when it increases in the same way chips or mult are animated?

willow plinth
#

okay, so apparently interrupting the loading screen breaks G.E_MANAGER? anyone else experienced this?

hasty mist
#

right now it just sorta instantly gets set to the number, while chips and mult bounce slightly when increased

willow plinth
hasty mist
#

this is the first one!

#

this is the code, it needs refinement though

willow plinth
#

you might be able to use juice_up

#

nvm, that seems to be for cards only - sorry, just learning the game's code as well thinktensifies

hasty mist
#

mhm

weak brook
#

any advice for finding origins of memory leaks?

#

apparently we got some in cardsauce but i have no idea where id start looking for that

worldly thicket
#

Is there a way to add cards to the deck during a boss blind but remove them after the boss blind is complete

hasty mist
#

it only does it after the increase, not during

daring fern
hasty mist
#

how do i format this?

#

i think i got it acrually

stiff locust
#

do decks not have calculate function

daring fern
hasty mist
#

okay uhh

stiff locust
#

do I need to change the parameters like how sleeves use calculate(self,sleeve,context instead of calculate(self,card,context)

#

i'm assuming that is the issue

#

is it as simple as self,deck,context

daring fern
stiff locust
#

ahh isee

hasty mist
stiff locust
#

round score is a different variable i have it somewhere here

daring fern
stiff locust
#

G.GAME.chips or G.GAME.blind.chips i think is the value for current score

#

one of those is current score, the other is required score

#

i can't remember

#

i'm guessing blind.chips is required score

faint yacht
#

ye.

stiff locust
hasty mist
stiff locust
#

wow

#

fucked up ui shit i guess

#

classic

daring fern
pseudo current
#

Question, are these 2 Jokers posible to make?

stiff locust
#

ferris wheel has been done twice by vouchers

#

one in rift raft one in betmma vouchers

pseudo current
#

o so it is?

stiff locust
#

yeah but be careful

daring fern
stiff locust
#

they can cause conflicts with each other

daring fern
lucid owl
#

why are 3oak jokers not triggering? 4oaks are

worldly thicket
daring fern
stiff locust
#

bladedancer from morefluff also creates temporary cards

#

2 steel cards every time blind is selected

hasty mist
worldly thicket
#

I probably should've seen if it's ever been done before, I need to come up with more original joker ideas

willow plinth
stiff locust
faint yacht
#

...per chance, are G.deck calculations enabled in the optional features?

stiff locust
#

i

#

I have to enable them???

#

how the hell do I do that

faint yacht
#
SMODS.current_mod.optional_features = function()
    return {
        cardareas = { deck = true },
    }
end
#

That's why (G.deck and G.discard optionally enabled) is mentioned.

stiff locust
#

i put that in the top of my mod's main file and it still doesn't work

daring fern
stiff locust
#

like if context.context == "context.end_of_round" this?

daring fern
stiff locust
#

oh okay

faint yacht
stiff locust
red flower
stiff locust
#

but if I do just one then it'll trigger 8 times cause end of round stupid shit

red flower
#

you're checking if context.context is two different values at the same time

stiff locust
#

i'm aware

#

and I am out of options

faint yacht
#

-# Did you try my suggestion?

pseudo current
#

Is this Joker posible to make?

daring fern
pseudo current
daring fern
stiff locust
faint yacht
#

¯_(ツ)_/¯

thorn pumice
#

hii, is this the right place to ask for a little modding help?

stiff locust
#

it

#

it worked.

rugged pier
#

can we force trigger a joker?

rugged pier
#

so first time it updates flag to true/false however youve set up

daring fern
rugged pier
#

and then doesnt trigger again

stiff locust
#

for jokers

#

and it won't do that

#

that doesn't work for decks though, apparently

rugged pier
#

oh lol

#

did not know you could do that

stiff locust
#

yeah it's a bettercalc thing

rugged pier
rugged pier
daring fern
bright axle
#

how can i add a generated card to deck?

calculate = function(self, card, context)
        if context.cardarea == G.play then
            return {
                message = "Sacrifices a card to create 4 upgraded cards!",
                colour = G.C.BLUE,
                card = card,
                func = function()
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            local hand_cards = {}
                            for _, v in ipairs(G.play.cards) do
                                if v.ability.playable then
                                    table.insert(hand_cards, v)
                                end
                            end

                            if #hand_cards > 0 then
                                local removed_card = pseudorandom_element(hand_cards, pseudoseed('creadora'))
                                removed_card:start_dissolve()

                                for i = 1, 4 do
                                    local new_card = create_card('Playing Card', G.P_CARDS, nil, nil, nil, nil, nil,
                                        'creadora')
                                    new_card:set_ability(pseudorandom_element({'m_glass', 'm_steel', 'm_stone'},
                                        pseudoseed('creadora_seal')))
                                    new_card:set_edition(pseudorandom_element({'holo', 'foil', 'polychrome'},
                                        pseudoseed('creadora_edition')), true)
                                    G.hand:emplace(new_card)
                                    new_card:juice_up(0.5, 0.5)
play_sound('tarot2')
play_sound('glass1')

                                end

                                
                            end
                            return true
                        end
                    }))
                end
            }
        end
stiff locust
#

value:set_seal("purple") is this not how you add a purple seal to a card

daring fern
stiff locust
#

case sensitive

#

damn it

#

it still didn't work

#

oh i know why it didn't

rustic swallow
#

how would i level up a hand if all cards in the played hand are blue seals

daring fern
worldly thicket
#

The joker I'm making here will do something different based off the number the pseudorandom, am I doing it right?

daring fern
worldly thicket
daring fern
lucid owl
#

i know you can change the default blind requirement with decks, but how would one only change the requirement of boss blinds?

plain apex
#

chat is there a better way to list this? because this takes up way too much space

SMODS.Joker{
  key = 'BP',
  loc_txt = {
    name = 'Battle Pass',
    text = {
      "Gain {X:mult,C:white}X#1#{} Mult for every {C:attention}different{} hand type played",
      "When {C:attention}all hand types{} have been played gain {X:mult,C:white}#2#X{} Mult and {C:attention}reset{}",
      "{C:inactive}Currently {X:mult,C:white}X#3#{C:inactive} Mult",
      "{C:inactive}Unplayed: {C:attention}#4#"
    }
  },
  rarity = 3,
  atlas = "Jokers", pos = {x = 3, y = 0},
  cost = 10,
  unlocked = true,
  discovered = false,
  eternal_compat = true,
  blueprint_compat = true,
  perishable_compat = false,
  config = {
    extra = {
      Xmult_add = 0.2,
      Xmult_reset = 3,
      Xmult = 1,
      played_hands = {} -- tracks unique hands
    }
  },
  loc_vars = function(self, info_queue, card)
    local extra = card.ability.extra
    local played = extra.played_hands or {}

    local all_types = {
      "High Card",
      "Pair",
      "Two Pair",
      "Three of a Kind",
      "Straight",
      "Flush",
      "Full House",
      "Four of a Kind",
      "Straight Flush",
      "Flush Five",
      "Flush House"
    }

    local unplayed = {}
    for _, hand in ipairs(all_types) do
      if not played[hand] then
        table.insert(unplayed, hand)
      end
    end

    return {
      vars = {
        extra.Xmult_add,
        extra.Xmult_reset,
        extra.Xmult,
        table.concat(unplayed, ", ")
      }
    }
  end,
  calculate = function(self, card, context)
    if context.cardarea == G.jokers and context.before and not context.blueprint and context.scoring_name then
      local extra = card.ability.extra
      extra.played_hands = extra.played_hands or {}

      -- Treat Royal Flush as Straight Flush
      local scoring_name = context.scoring_name
      if scoring_name == "Royal Flush" then
        scoring_name = "Straight Flush"
      end

      -- Define the full set of required hands
      local all_types = {
        ["High Card"] = true,
        ["Pair"] = true,
        ["Two Pair"] = true,
        ["Three of a Kind"] = true,
        ["Straight"] = true,
        ["Flush"] = true,
        ["Full House"] = true,
        ["Four of a Kind"] = true,
        ["Straight Flush"] = true,
        ["Flush Five"] = true,
        ["Flush House"] = true
      }

      -- Track the new hand if it's in the required list
      if all_types[scoring_name] and not extra.played_hands[scoring_name] then
        extra.played_hands[scoring_name] = true
        extra.Xmult = extra.Xmult + extra.Xmult_add

        -- Check if all types have been played
        local completed = true
        for hand in pairs(all_types) do
          if not extra.played_hands[hand] then
            completed = false
            break
          end
        end

        if completed then
          extra.Xmult = extra.Xmult + extra.Xmult_reset
          extra.played_hands = {} -- Reset progress
          return {
            message = "Battle Pass Complete!",
            colour = G.C.Mult,
            card = card
          }
        end

        return {
          message = localize('k_upgrade_ex'),
          colour = G.C.Mult,
          card = card
        }
      end
    end

    if context.joker_main then
      return {
        message = localize{type='variable', key='a_xmult', vars={card.ability.extra.Xmult}},
        Xmult_mod = card.ability.extra.Xmult
      }
    end
  end,
}
plain apex
#

was hoping they would tell me how to do that lol

#

only thing i've used those for are like enhancements and editions

daring fern
urban wasp
#

i have two pieces of code, both trying to have this effect:

"Played cards with Diamond suit give ^1.2 Mult when scored"

they both do the effect but have one of either of these bugs:

  1. bg of the ^mult is red, not dark_edition

  2. the joker wiggles twice when a diamond is scored

SMODS.Joker {
    key = "greedy1",
    config = { extra = { e_mult = 1.2 } },
    rarity = "cry_exotic",
    atlas =  'gbl_jokers',
    blueprint_compat = true,
    pos = { x = 0, y = 0 },
    soul_pos = { x = 1, y = 0, extra = { x = 0, y = 0 } },
    cost = 50,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.e_mult } }
    end,
    calculate = function(self, card, context)
        if context.individual then
            if context.cardarea == G.play and context.other_card:is_suit('Diamonds') then
                return {
                    e_mult = card.ability.extra.e_mult,
                    card = card
                }
            end
        end
    end
}
SMODS.Joker {
    key = "greedy2",
    config = { extra = { e_mult = 1.2 } },
    rarity = "cry_exotic",
    atlas =  'gbl_jokers',
    blueprint_compat = true,
    pos = { x = 0, y = 0 },
    soul_pos = { x = 1, y = 0, extra = { x = 0, y = 0 } },
    cost = 50,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.e_mult } }
    end,
    calculate = function(self, card, context)
        if context.individual then
            if context.cardarea == G.play and context.other_card:is_suit('Diamonds') then
                return {
                    message = localize({ type = "variable", key = "a_powmult", vars = { card.ability.extra.e_mult } }),
                    Emult_mod = card.ability.extra.e_mult,
                    colour = G.C.DARK_EDITION,
                }
            end
        end
    end
}
daring fern
urban wasp
#

i see; i assume it's not able to be fixed on my end then?

daring fern
urban wasp
#

fun

plain apex
stiff locust
#

anyone know why ghost cards appear in the hand permanently after adding cards during a spectral pack (e.g through grim or cryptid)

plain apex
#

thank you chat gpt very cool

worldly thicket
#

how can I add chips when the blind is selected (I'm already checking for if the boss blind is selected)

rugged pier
rugged pier
#

if you want to do it while setting a blind then wrap it in an if context.setting_blind

worldly thicket
#

like this?

#

I want it to add 85 chips to the scored chips

rugged pier
willow plinth
#

anyone know what this lil bro is called and why it doesn't move along when i call G.FUNCS.change_tab? is it set_button_pip? because somehow that also doesn't work for me...

worldly thicket
rugged pier
sleek siren
#

is there a way to make specific jokers appear more often for a back?

daring fern
tired wharf
#

im currently trying to use this to check if a card has the steel enhancement but this is not working what did I do wrong here

rugged pier
sleek siren
rugged pier
#

card would be the joker

worldly thicket
#

It didn't do anything but idk how I would check if something went wrong

#

is there a way to trigger a joker with DebugPlus

sleek siren
#

ahhh fair

daring fern
tired wharf
worldly thicket
tired wharf
lucid owl
#

how would one modify the chip numbers present on this screen?

daring fern
sleek siren
willow plinth
lucid owl
hasty mist
#

what are the contexts for playing a hand and discarding a hand

tired wharf
thorn pumice
#

would anyone happen to have consumables knowledge and be able to help me cause mine is giving me a funky error lol

daring fern
tired wharf
daring fern
tired wharf
#

alr

daring fern
tired wharf
#

it worked :D

tired wharf
willow plinth
# lucid owl yeah

you could set G.P_BLINDS.bl_small.mult, G.P_BLINDS.bl_big.mult, and so on to something else than the default value - but i don't know if that's recommended

#

for example i set the small blind's mult to 10 and got this

unkempt thicket
#

I think that refers to the multiplication of the blind requirements.

hasty mist
#

what is wrong here

daring fern
hasty mist
#

i didn't know the context for playing a hand

#

is it hand_played or something

daring fern
hasty mist
#

i see

rapid stag
#

that's funny, i kinda wanna make a mod that adds context.hand now. when is it called?

...when hand.

#

actually

#

@tall wharf

#

context.hand

#

probably could do something with it

hasty mist
#

how do you ensure it can't go below X1

daring fern
rapid stag
#

wait is math.min a thing cirDerp

red flower
#

yes but you want the max between 1 and the variable

rapid stag
#

ahhhhhhhhhhhh

#

for some reason i was thinking it worked like a clamp

#

i mean, i guess it does

hasty mist
#

how do i implement that

willow plinth
#

you can combine min and max to do clamps

rapid stag
#

i was thinking it worked in the way that i think a clamp works

reef belfry
#

you can do that? i just make a check that it isnt 0

rapid stag
daring fern
hasty mist
#

alright thank you

surreal coral
#

is there a way to change where a card spawns if you don't give it an area

rapid stag
#

value = math.max(1, value - 1)

#

i think is what they're looking for

daring fern
red flower
rapid stag
#

yes, but it needs to decrease if it isn't 1

daring fern
reef belfry
#

thats just brutal

#

X0 score

rapid stag
#

gains X1 on hand, decreases on discard

reef belfry
#

oh actually yeah it just resets

rapid stag
#

without - 1, it'll just go up

unborn bay
#

note that x0 won't do anything since calculate functions regard 0 as just not having mult lmao

daring fern
hasty mist
#

true but i'm not working with mult

unborn bay
#

to have TRUE x0 you have to actually set the mult to 0 manually

red flower
#

X0 does work

hasty mist
#

i'm working with score

red flower
unborn bay
#

also yeah it's math.max(1, value - 1)

#

math.max returns the largest value

surreal coral
#

well I've made a joker that can give you stuff when you select a blind, one of those things is vouchers, and right now, it looks like this

rapid stag
red flower
surreal coral
red flower
#

what's your code?

hasty mist
#

ok so i definetely did that wrong

willow plinth
#

@hasty mist pseudo code: if played => joker.score_mult = joker.score_mult + 1; else if discard => joker.score_mult = math.max(1, joker.score_mult - 1)

tired wharf
#

currently getting this error when I use the consumable as it is supposed to be used

rapid stag
surreal coral
#

myRedeem is a modification of the Redeem function in card.lua

daring fern
tired wharf
#

ah alr

hasty mist
#

i just dont understand how to implement the math.max thing

#

idk where to put it

reef belfry
#

how does one change the hand type of played hand

red flower
hasty mist
#

i see that makes sense

#

thank you

red flower
hasty mist
#

this works perfectly now, ty!

surreal coral
red flower
#

i think the best you can get is looking at the areas defined in Game:start_run

#

oh its G.vouchers

stray warren
#

I have a boss blind that flips over all non-face cards. However, when I press play, the cards get scored face-down. I checked the code for The Mark and it seems exactly the same. Is there something I'm missing here?

  stay_flipped = function(self, area, card)
    if not card:is_face() then
      return true
    end
    return false
  end,
lucid owl
stray warren
surreal coral
# red flower oh its `G.vouchers`

No clue where that area actually is lol. I'm playing around with it now. I think you've got me pointed in a direction tho, maybe it's the right one. Thank you

#

Wait its the card in the deck on the bottom right what the

hasty mist
#

also, is context.discard for each discard, or each card discarded?

surreal coral
wooden nexus
#

Hey odd question

#

There's a color I wanna use in localization that's in base game, but idk how I'd access it

#

Since it's in a set

#

Could I do... C:secondary_set.tarot or something?

rapid stag
#

eh, why not, i'll post it here
we recently crossed the 100 vanilla joker reskins threshold in the mod i'm working on - and in that same push, now also have reskins for every joker on the first page of collections cirComfy

tall wharf
willow plinth
lucid owl
rapid stag
sturdy compass
lucid owl
#

on a related note, is there a way to fix blinds having incorrect backgrounds when set by a mod? i'm really not sure why this is happening but it is

rapid stag
# sturdy compass The random clippy is awesome lmao

i made clippy the base joker primarily because the game over screen uses the base joker graphic and it would be funny to have clippy show up and say stuff to you when you die. but i also made it like that for half joker, so half joker literally just says "looks like" and is cut off girldmSmugheh

we have a lot of fun here

sturdy compass
#

LMAO

rapid stag
#

you could then have a joker or smth that's like "when hand, X" and people will just look at it and go... "wdym 'when hand?' like... when i play a hand? when i have a hand?"

#

how is that not an aiko vibe

reef belfry
#

i should really make one off jokers rather than complicated ones since ive only made like 4.5 full jokers after like 1 month

knotty skiff
#

Put a blueprint next to them

See who wins the staring contest

faint yacht
#

If only I could grab the actual blinking frames... then I'd make him blink here and there, actually. 😂

rapid stag
#

can't you just draw with the eyes closed

#

and then make an animation atlas out of that

lucid owl
#

why is my deck's apply function not actually... applying? this variable isn't being changed (default false)

#

ah whatever, i'll just make a new global

daring fern
faint yacht
#

I already have a Joker that changes the floating sprite - and that's Rover.

rapid stag
iron haven
#

how do I fix this?

daring fern
iron haven
#

hold on.

plain apex
iron haven
wooden nexus
iron haven
#

oh I forgot an and

wooden nexus
#

huh...

plain apex
#

huh so it can be used in a message but not in joker text?

#

thats weird

paper zealot
iron haven
#

ok so. I have two logic errors. one in G and one in I.

paper zealot
#

In your case it's just {C:tarot}

wooden nexus
#

but C:tarot gives me the dark purple

#

oh wait

#

i was thinking purple

paper zealot
#

purple and tarot are slightly different, tarot is lighter

iron haven
#

I can wait.

wooden nexus
#

Okay yeah i think it matches now

daring fern
iron haven
iron haven
#

so the logic errors are in G and I.

daring fern
iron haven
daring fern
slate bison
#

anyone knows how can i check to see if a player has spend money ?

#

like everytime he spends money something happens

shell timber
#

you could hook into ease_dollars maybe

iron haven
slate bison
shell timber
#

ease_dollars is the function that gets called whenever your money changes

slate bison
#

ohhhh i see

plain apex
daring fern
knotty skiff
#

I wanna make a Joker that gives 1.5x mult for every specific joker (example: like 1.5x for every DNA)

I'm not really sure how to do though-

iron haven
#

damn it, now it upgrades for each card you hold.

knotty skiff
daring fern
iron haven
iron haven
plain apex
# knotty skiff I wanna make a Joker that gives 1.5x mult for every specific joker (example: lik...

you could probably do something similar to my joker fashion show

SMODS.Joker({
    key = 'Fashion',
    loc_txt = {
        name = 'Fashion Show',
        text = {
            "Jokers with Editions each give {X:mult,C:white}X#1#{} Mult",
            "Idea: BoiRowan",
        }
    },
    rarity = 2,
    atlas = "Jokers",
    pos = {x = 0, y = 25},
    cost = 9,
    unlocked = true,
    discovered = false,
    eternal_compat = true,
    blueprint_compat = true,
    perishable_compat = false,
    config = {
        extra = {
            Xmult = 1.75,  -- Multiplier for editions
        },
    },

    loc_vars = function(self, info_queue, card)
        return {
            vars = {card.ability.extra.Xmult}  -- Correctly reference the multiplier
        }
    end,

    calculate = function(self, card, context)
        -- Ensure the card has an edition and check if it matches the specified conditions
        if context.other_joker and context.other_joker ~= card and context.other_joker.edition and context.other_joker.edition.type then
            return {
                x_mult = card.ability.extra.Xmult,  -- Apply multiplier to the current card
                card = card
            }
        end

        return nil  -- No multiplier if the card isn't linked with another joker having an edition
    end,
})

and instead of checking for editions you would check for a specific joker id

daring fern
knotty skiff
#

tysm!

iron haven
slate bison
#

anyone knows a good way to implement a joker that gives an upgraded voucher everytime you buy a voucher?

plain apex
iron haven
#

I's logic error is that when you play a straight, all the cards you play triggers I.

#

this should trigger I once.

daring fern
plain apex
#

great card skins lol

iron haven
#

my card skins?

plain apex
#

yeah

open forum
#

Wait

plain apex
open forum
#

Hold

daring fern
open forum
#

Ic

#

Wait Lovely is in there

#

Shouldn't that be yeeted

iron haven
#

this should trigger I.

#

and it doesn't

daring fern
daring fern
open forum
#

I fear the samer problem occurs

iron haven
open forum
#

Ohhhh

slate bison
#

anyone knows how i can randomly add a voucher to the run?

daring fern
# iron haven

Next time you upload the file instead of copying the whole file and pasting it could you just upload the lua file?

daring fern
# iron haven ok

You need to remove the context.individual and context.cardarea == G.play checks.

iron haven
#

ok did that. it works now.

cobalt vector
#

For some reason, my joker isn't giving me chips

            elseif gamba == 2 then
                return {
                    chips_mod = card.ability.extra.chips,
                    message = '+' .. card.ability.extra.chips,
                    colour = G.C.CHIPS
                }
#
    config = {
        extra = {
            chips = 40,
            mult = 4,
            Xmult = 4,
            money = 4,
        }
    },
    loc_vars = function(self,info_queue,center)
        return { vars = { --#1# is replaced with card.ability.extra.Xmult
            center.ability.extra.chips,
            center.ability.extra.mult,
            center.ability.extra.Xmult,
            center.ability.extra.money,
            G.GAME and G.GAME.probabilities.normal or 1}
            }
    end,
#

Mult, Xmult, and money work just fine

daring fern
cobalt vector
#

so I don't need "message = " ?

daring fern
willow plinth
#

what do i do if the game crashes without any crash report?

#

am i cooked?

daring fern
willow plinth
#

hm :/

#

can anyone reproduce latest talisman version crash on card select?

daring fern
cobalt vector
willow plinth
daring fern
willow plinth
#

Lovely 0.7.1
smods 1.0.0~BETA-0416b-STEAMODDED
Talisman 2.2.0a

daring fern
willow plinth
#

yup, i can do a screen recording if it helps

#

but i'll try with a new profile, one sec

#

nope, also happens on a newly created profile

daring fern
willow plinth
#

just a sec

daring fern
willow plinth
#

the log only displays this while/after it crashes: SteamInternal_SetMinidumpSteamID: Caching Steam ID: [redacted in case this doxxes me] [API loaded no]

#

i'll try

#

i'll try a complete cleanup of the folder where the mods folder is in

#

nope, nothing helps

willow plinth
# willow plinth nope, nothing helps

i have to add here: i already found out the talisman commit 0d60d48447d34b4599896d62b74e90e760377bfa (merge commit) broke things, going back further "fixes" this issue for me

daring fern
dense adder
#

can anyone see why this will not return to the local variable last_spectral

function set_last_spectral(card)
  if card.config.center_key and card.ability.consumeable then
    if card.config.center.set == 'Spectral' then 
        G.E_MANAGER:add_event(Event({
          trigger = 'immediate',
          func = function()
            G.E_MANAGER:add_event(Event({
              trigger = 'immediate',
              func = function()
                last_spectral = card.config.center_key
                  return true
              end
            }))
              return true
          end
        }))
      end
    end
    G:save_settings()
  --funct end
  end```
willow plinth
daring fern
dense adder
#

this is called outside the main block of code, its independent, its not in any SMODS function, but it is in an independent .lua calling from the main .lua

#

hard to describe

daring fern
dense adder
#

yep its a hook in the consumable its working with

dense adder
#

when eval it pulls up

willow plinth
tall wharf
#

it is inside an event.

dense adder
#

let me take out the events and try it

daring fern
tall wharf
#

also last spectral is not a local

willow plinth
#

with the crash

daring fern
dense adder
slate bison
#

anyone knows a way to give a random voucer everytime a voucher is bought?

tall wharf
#

local as in

#

file local

willow plinth
dense adder
#

removing the events has not helped, the function set_last_spectral is being called but it is not returning last_spectral

daring fern
dense adder
#

this is based on how last_tarot_planet functions in set_consumable_usage and it will work if i do that but i can't as it will break the normal fool card, i could do a simple fix of take_control and add it as a personal patch but i would rather do so as a last resort

slate bison
#

anyone knows a way to give a random voucer everytime a voucher is bought?

willow plinth
daring fern
daring fern
slate bison
daring fern
slate bison
#

oh

slate bison
rustic swallow
#

does someone know how would i update the xmult of a joker everytime a card is destroyed

copper lion
#

@crisp coral I love your lob corp mod but I wanted to ask you a quick question cause I'm playing a run with lob corp as the only content mod and it crashes my game every time I go into the shop on my current run (and it's very early so I know it's not just a gazillion jokers killing the game)

Putting this in dev chat cause it is a crash log

#

The question being, which abno would do this

crisp coral
#

damn i need to fix ff

copper lion
#

I've got fairy festival and pbird, opening the shop crashed my game

copper lion
#

mosb ate all the cards as plague doctor blessed them

#

is it intentional for destroying blessed cards before the whitenight fight to not count towards lowering his req as they haven't become apostles yet?

#

Cause plague doctor turning into whitenight when I only had 1 blessed card in my deck really screwed me

copper lion
copper lion
crisp coral
#

please stop pinging me

tall wharf
#

myst

#

why is the in pool function not working for some

copper lion
manic rune
#

myst how do i do my IELTS test

tall wharf
#

IELTS

crisp coral
manic rune
#

myst mysting everymyst

copper lion
copper lion
zealous glen
manic rune
#

hi victin

#

im fine, waiting to do the speaking section of my ielts test

#

-# and since im an introvert, this will absolutely go SO wrong

zealous glen
#

Good luck

tall wharf
#

good luck

manic rune
#

:3 thanks guys

tall wharf
#

i used to do IELTS

manic rune
#

i hope i get at least 8, since thats my aim rn

manic rune
tall wharf
#

crazy

#

average 7

zealous glen
#

I did an official English language test once which has already expired

manic rune
#

icic

zealous glen
#

I’m lucky I haven’t needed one

tall wharf
#

that was like 4 years ago tho

manic rune
#

but not sure about writing and speaking :3

tall wharf
#

are you doing the academic one

manic rune
#

mhm

manic rune
#

are they hard

tall wharf
#

i got 8.5 in reading

manic rune
#

def getting 6 on reading since im a balatro player

#

zealous glen
#

And I aced it

#

So that’s about what I can say about it

manic rune
#

i see

#

thats really cool :D

true jasper
#

I'm trying to use take_ownership on a joker from another mod and I can't figure it out, I'm trying to change the art

manic rune
#

i got a toeic practice book as a present

#

but it was really hard

runic pecan
#

This sticker was applied normally but neither of these print functions ran when testing (nor did they give +mult), where/what did I do wrong?

manic rune
#

the reading questions got 5 answers, and most of them are really ambiguous

manic rune
#

like - what does the author mean by saying this?

#

😭

#

im not them, why tf u asking me dawg

zealous glen
#

I tend to have that opinion over tests in general

manic rune
zealous glen
#

And instructions for how to get a visa

zealous glen
#

And I think they played it all at once, then all at once again?

tall wharf
#

my English final exam with audio that plays once:

zealous glen
#

Luckily I have barely needed to certificate that I can speak English

manic rune
#

same goes for my national test too

zealous glen
#

The Brazilian national exam didn’t have listening questions

#

But it also only has like

manic rune
#

its your average TED video audio thats like, x1.5 the speed + purposely bad quality

zealous glen
#

5 foreign language questions

manic rune
zealous glen
runic pecan
manic rune
#

isnt it supposed to be all in brazilian?

#

since english national contest over here all has english questions at least

#

i cant imagine having to learn another language for freakin english national test

zealous glen
manic rune
#

damn.

zealous glen
#

It’s like 9 hours of exam over two days

manic rune
#

😭

#

wtf crazy

#

ours is only 2-3 hours at most

zealous glen
native zinc
#

this was so annoying to make fml

zealous glen
native zinc
#

Blind.get_loc_debuff_text right'

zealous glen
#

No

native zinc
#

d ang

zealous glen
#

Stuff like context.debuff_hand

#

@native zinc SMODS added many Blind functions as contexts

native zinc
#

oh this was a challenge

#

so i just kinda usede the vanilla ish code

zealous glen
#

It could use an invisible Joker to do it ;P

#

I should make gamerules

native zinc
zealous glen
#

Why

native zinc
#

feels very tacky lmao

copper lion
#

pbird specifys sold, not destroyed

#

I wanna use price of silence to kill QoH before she breaches

crisp coral
#

no

copper lion
crisp coral
#

fixed

copper lion
# crisp coral fixed

like, just now? or on one of the previous version/version you sent me when FF crashed my game? cause I'm still on the version you sent me

crisp coral
#

just now

copper lion
#

downloading latest

copper lion
faint yacht
#

Is it not G.P_CENTERS['m_gold'].config.weight to get the weight?

#

G.P_CENTERS['m_gold'].weight, oop.

wintry solar
#

I don’t believe vanilla editions have a weight

zealous glen
#

Do you mean Enhancements?

#

I don’t think they have weights either

#

Editions have weights but they might be hardcoded

#

If you want the odds of a card having an Enhancement at all, that might also be hardcoded

faint yacht
#

As the default weight for SMODS.Enhancement is 5, I'll just add that as the failsafe.

#

-# Or am I overthinking it for having a pool of specific enhancements being reconstructed as a weighted random table?

faint yacht
#

For a consumable to have a pool of specific enhancements to choose from, but with the weight in mind.

zealous glen
#

SMODS provides an utility function to compute/select the available Enhancements, with weights

faint yacht
#

-# doh.

#

My SRB2 modding experience coming back to overcomplicate things. 😂

tribal wasp
#

how do i disable blue stake as in it doesnt give -1 discard anymore

stiff locust
#

select white stake

#

then you don't get -1 discard

faint yacht
#

...or you patch the if self.GAME.stake >= 5 then self.GAME.starting_params.discards = self.GAME.starting_params.discards - 1 end line. 🍞

tribal wasp
#

thanks dude

stiff locust
#

that's a lot of work

unborn bay
faint yacht
#

Or, actually, as SMODS redefines it, take_ownership of it and change the modifiers function of it.

faint yacht
wintry solar
zealous glen
#

What about changing Blue Stake to:

-1 Hand
+1 Discard

faint yacht
#

Just need to touch up the actual main table to include the { key = key, weight = weight } structure.

#

-# And probably do the actual table init after the GameObjects have been initialized.

crisp coral
#

harsher than you'd think

crisp coral
#

Minecraft copper situation

faint yacht
#

...yeah, that was an adventure getting set up.

icy oak
#

is it possible to check what position a joker is in relative to its duplicates

#

just asking

faint yacht
#

Iterate over the Jokers, find the duplicates and store their position, then return the distance calc.

#

-# Hum... maybe this is a tad much.

proud moon
copper lion
#

guys check out my new speedrun, cryptid crash%, I literally crashed on the large blind of ante 1 on modest with nothing unlocked or any other content mods without the crash card 😭

hasty mist
#

is there an exhaustive list of every context in smods? (or at least a majority of them)

#

not just a few examples

wintry solar
#

The wiki has the vast majority of them, I still need to get round to finishing updating it but motivation for writing docs is at an all time low

hushed field
copper lion
#

but it could be joker display

hushed field
#

ah, yeah, than it's just a cryptid crash

copper lion
#

I'm picking up the run after I wake up cause it's like 5 AM so I should go to bed

hushed field
#

I thought it might be JokerDisplay based on the create function, but that's creating cards, not a display object, I'm realizing now

red flower
# hasty mist is there an exhaustive list of *every* context in smods? (or at least a majority...

i wrote this message for the modded wiki discord

These should be all the other ones not on the wiki aside from starting_shop AFAIK

  • context.ending_booster
{
    booster = booster_obj
}
  • context.modify_scoring_hand
{ 
    other_card =  G.play.cards[i], 
    full_hand = G.play.cards, 
    scoring_hand = scoring_hand
}
return {
    add_to_hand = true,
    remove_from_hand = true
}

Blind calc

  • context.blind_disabled

  • context.blind_defeated

  • context.press_play

  • context.debuff_card

{ 
    ignore_debuff = true 
}
  • context.debuff_hand
{ 
    full_hand = cards, 
    scoring_hand = final_scoring_hand, 
    poker_hands = hand, 
    scoring_name = handname, 
    check = check 
}
  • context.stay_flipped
{ 
    to_area = to_area, 
    from_area = from_area, 
    other_card = card
}
  • context.modify_hand
{ 
    poker_hands = poker_hands, 
    scoring_name = text, 
    scoring_hand = scoring_hand, 
    full_hand = cards 
}
hasty mist
#

thank you

#

this is perfect

manic rune
icy oak
#

thats kinda what i need

faint yacht
#

Can, yeah.

icy oak
#

hmm

faint yacht
#

As card usually refers to the Joker itself that calls the calc, if a given entry of G.jokers.cards == card then you found itself.

manic rune
#

wait wait

#

isnt G.jokers.cards the table containing all jokers you have?

#

you would need a for loop to go through that

faint yacht
#

They mentioned the for loop already, so.

manic rune
#

oh, true

modern kindle
#

Bepiisss

manic rune
#

hi dilly

#

i took my ielts test today

#

:3

modern kindle
#

Hello

#

How did you do
And what are they

manic rune
#

some sort of international english examination

#

for a degree

modern kindle
#

Ooo icic

manic rune
#

i did pretty well for listening, reading and writing

#

but the examiner for speaking was an indian

#

so uh, no offense, but i could barely understand them

icy oak
#

in like, the same position as the first one

unborn bay
#

cards, even of the same type, are different from each other

maiden wraith
#

hey guys do u know hwo to make a joker compatible with blueprint?

#

welp, found it

#

<3

wintry solar
#

Jokers are by default compatible, you have to build the incompat in

maiden wraith
#

cuz it was, by default, incompatible

wintry solar
#

The flag just controls the ui

maiden wraith
#

Ah i see

wintry solar
#

Even if you set it to false your calculate function will still be copied

maiden wraith
#

thx for the clarification

icy oak
#

wait how do i check if two jokers are dupes, dang i thought i alr figured this out

faint yacht
#

Check if the <card>.config.center.key match.

icy oak
#

ah that one

#

ty

proud moon
dapper sun
#

how do i G.GAME.chips/G.GAME.blind.chips >= 10 without it complaining about me comparing a table to a number?

red flower
#

uninstall talisman

dapper sun
#

a

#

how do i make it work with talisman?

red flower
#

like that ^

dapper sun
#

ty

#

do i put the 10 in the to_big or the other part?

red flower
#

10, but there's no harm in doing both just to be sure

dapper sun
#

ok

icy oak
#

how do i make a joker that gives -1 discard

#

like the opposite of drunkard

red flower
ruby delta
#

Can someone explain how I could make the joker active it's second function when it checks that there is another joker, example is I want my joker to activate it's second function if it sees specific 4 jokers active

dapper sun
#

how do i overwrite the Find this Joker from the Soul card unlock text for legendary jokers?

hard needle
#

How can I change the cost of an item in the shop?

daring fern
hard needle
daring fern
hard needle
#

is it possible to iterate over every item in the shop

daring fern
hard needle
hushed estuary
#

Question about lovely
Is it possible to replace all instances of a string of code (not necessarily a line) with another?

daring fern
hard needle
daring fern
bright axle
#

anyone knows the way to know the most played hand of the round?

daring fern
bright axle
#

like this?

if context.end_of_round then
          local hand_counts = {}
          for _, hand in ipairs(G.play.cards) do
              local hand_key = hand:get_hand_key()
              hand_counts[hand_key] = (hand_counts[hand_key] or 0) + 1
          end

          local most_played_hand = nil
          local max_count = 0
          for hand_key, count in ipairs(hand_counts) do
              if count > max_count then
                  most_played_hand = hand_key
                  max_count = count
              end
          end

          if most_played_hand then
              local planet = nil
              for k, v in pairs(G.P_CENTER_POOLS.Planet) do
                  if v.config.hand_type == most_played_hand then
                      planet = v.key
                  end
              end

              local card = {
                  set = "Planet",
                  area = G.pack_cards,
                  skip_materialize = false,
                  soulable = true,
                  key = _planet,
                  key_append = "pl1"
              }

          end

      end
bright axle
#

well it doesnt

#

changed to this

calculate = function(self, card, context)
        if context.cardarea == G.play then -- replace G.play with G.jokers/G.hand as appropriate
         card.ability.extra.hand_counts[scoring_name ] = (card.ability.extra.hand_counts[scoring_name ] or 0) + 1

        end
        if context.end_of_round then
            local hand_counts = {}
            for _, hand in ipairs(G.play.cards) do
                local hand_key = hand:get_hand_key()
                hand_counts[hand_key] = (hand_counts[hand_key] or 0) + 1
            end

            local most_played_hand = nil
            local max_count = 0
            for hand_key, count in ipairs(hand_counts) do
                if count > max_count then
                    most_played_hand = hand_key
                    max_count = count
                end
            end

            if most_played_hand then
                local planet = nil
                for k, v in pairs(G.P_CENTER_POOLS.Planet) do
                    if v.config.hand_type == most_played_hand then
                        planet = v.key
                    end
                end

                local card = {
                    set = "Planet",
                    area = G.pack_cards,
                    skip_materialize = false,
                    soulable = true,
                    key = _planet,
                    key_append = "pl1"
                }

            end

        end
#

it chrashes

#
SMODS.Joker {
    key = 'rebeca',
    discovered = true,
    unlocked = true,
    rarity = 4,
    atlas = 'joker_sonas',
    config = {
        extra = {
            hand_counts = {}
        }
    },
    cost = 25,
    pos = {
        x = 0,
        y = 1
    },
    soul_pos = {
        x = 1,
        y = 1
    },
    loc_vars = function(self, info_queue, card)
        local extra = (card and card.ability and card.ability.extra) or {
            hand_counts = {}
        }
        return {
            vars = {extra.hand_counts}
        }

    end,
    calculate = function(self, card, context)
        if  context.cardarea == G.play then
            card.ability.extra.hand_counts[scoring_name] = (card.ability.extra.hand_counts[scoring_name] or 0) + 1
        end
        if context.end_of_round then
            local hand_counts = {}
            for _, hand in ipairs(G.play.cards) do
                local hand_key = hand:get_hand_key()
                hand_counts[hand_key] = (hand_counts[hand_key] or 0) + 1
            end

            local most_played_hand = nil
            local max_count = 0
            for hand_key, count in ipairs(hand_counts) do
                if count > max_count then
                    most_played_hand = hand_key
                    max_count = count
                end
            end

            if most_played_hand then
                local planet = nil
                for k, v in pairs(G.P_CENTER_POOLS.Planet) do
                    if v.config.hand_type == most_played_hand then
                        planet = v.key
                    end
                end

                local card = {
                    set = "Planet",
                    area = G.pack_cards,
                    skip_materialize = false,
                    soulable = true,
                    key = _planet,
                    key_append = "pl1"
                }

            end

        end
    end
}
#

i don't know why

runic pecan
#

bump

tall wharf
#

i think you just start dissolve it

runic pecan
runic pecan
runic pecan
runic pecan
heady glen
#

Hey guys, there’s a card concept that I have that I really want to work out the logic for. Essentially it measures triggers per second at the end of a hand and adds that to the mult. Do y’all think it’s possible? (I know there has to be some sort of formula for it since it’s exponential)

runic pecan
heady glen
#

Perhaps maybe I can calculate the total triggers during the hand and add 0.5+ mult for each of them

#

At least all the triggers until the said card is triggered and the triggers that happen afterward don’t effect it

runic pecan
tall wharf
#

it just observes the change in mult and chips

runic pecan
hard needle
#

is there a context for when a booster pack is bought?

runic pecan
midnight coyote
#

because if stuff like hallucination

tall wharf
#

i think so

runic pecan
hard needle
midnight coyote
#

should i code in the concepts for all the art ive done or should I make more art

#

ive got a blind, 2 vouchers, some jokers,

#

i think i code in everything

#

to catch up

#

heres my voucher btw :333

tall apex
#

Does anyone know if there’s a return argument which actually just makes you lose?

midnight coyote
#

so its just a doomed hand

tall apex
midnight coyote
#

there should be a way tho

tall apex
#

To quote the joker “Playing a pair actually just fucking kills you” LMAO

bright axle
#

if i have a planet key how whould i generate a planete card with that key

gaunt thistle
#

yes, use a Regex patch

hushed estuary
#

How do I make one

gaunt thistle
#
# Inject one or more lines of code before, after, at, or interwoven into one or more
# Regex capture groups.
# - I recommend you to use a Regex playground like https://regexr.com to build
#   your patterns.
# - Regex is NOT EFFICIENT. Please use the pattern patch unless absolutely necessary.
# - This patch has capture group support.
# - This patch does NOT trim whitespace from each line. Take that into account when
#   designing your pattern.
#
# USEFUL: For when the pattern patch is not expressive enough to describe how the
# payload should be injected.
[patches.regex]
target = "tag.lua"
pattern = "(?<indent>[\t ]*)if (?<cond>_context.type == 'eval' then)"
position = 'at'
line_prepend = '$indent'
payload = '''
local obj = SMODS.Tags[self.key]
local res
if obj and obj.apply and type(obj.apply) == 'function' then
    res = obj.apply(self, _context)
end
if res then
    return res
elseif $cond
'''
times = 1
``` is an example
hushed estuary
#

Yeah I'm going to need some more context as to what that pattern is

gaunt thistle
#

It's Regex

bright axle
#
if context.cardarea == G.play then
           for _, hand in ipairs(G.play.cards) do
               local hand_key = context.scoring_name
               sendInfoMessage(hand_key, "info")
               card.ability.extra.hand_counts[hand_key] = (card.ability.extra.hand_counts[hand_key] or 0) + 1
           end

       end

how can i make this triger after all cards have been scored?

#

bcs it trigers a bunch anf the contex.afte and before dont work

wintry solar
#

What’s it supposed to do?

hard needle
#

how can i replicate the glitched description in misprint

bright axle
#

that is covered but it miscacaculates bcs of the context

midnight coyote
#

is there a way for an enhancement to check if it's about to be changed

#

and to deny the changing if it happens

wintry solar
#

You shouldn’t need to do anything like that to work out the most played hand

bright axle
#

and how can i get the most played hand?

midnight coyote
wintry solar
#

Like you were shown earlier

bright axle
#

in what context is this?

wintry solar
#

Well it depends entirely on what you’re trying to do

wintry solar
#

The context makes no difference for calculating the most played hand

bright axle
#

at the end of the round i generate a negative planet card based on the most played card

wintry solar
#

Then you want context.end_of_round and context.main_eval

midnight coyote
#

hey whats a quantum enhancement

#

im looking through contexts and i think i found what i needed but whats a quantum enhancement

bright axle
hushed estuary
#

All time I think

bright axle
#

i only need the most played of the round

#

ok nvm i think G.GAME.current_round.most_played_hand is what i needed thx @wintry solar

#

ok it says the value is nil

#
calculate = function(self, card, context)
        if context.end_of_round and context.main_eval then
            local _handname, _played, _order = 'High card', -1, 100
            local hand_counts = {}
            for k, v in pairs(G.GAME.hands) do
                if v.played > _played or (v.played == _player and _order > v.order) then
                    _played = v.key
                    _handname = k
                end
            end
            G.GAME.current_round.most_played_hand = _handname
            local most_played_hand = G.GAME.current_round.most_played_hand
            sendInfoMessage(most_played_hand, "info")

            if G.GAME.current_round.most_played_hand then
                local planet = nil
                for k, v in pairs(G.P_CENTER_POOLS.Planet) do
                    if v.config.hand_type == most_played_hand then
                        local _planet = v.key
                    end
                end
                sendInfoMessage(planet, "info")

                local planet_card = create_card("Planet", G.pack_cards, nil, nil, true, true, _planet, 'pl1')
                planet_card:set_edition('e_negative', true)
                planet_card:add_to_deck()
                G.consumeables:emplace(planet_card)
                card.ability.extra.hand_counts = {}
            end

        end
    end
#

nvm i fixed it

formal parrot
#

@wintry solar sorry for ping

#

Do you know how can i check for double tag gained

midnight coyote
#

anyone

#

?

tall wharf
midnight coyote
#

i never put in a color

tall wharf
#

😭

midnight coyote
#

:3

#

i think i’m gonna add 9 more boss blinds

#

actually i’m gonna add more content until i think it’s done

#

i’m not gonna limit myself

hearty mesa
#

I'm trying to create a joker that when you reach 50% of the blind's score, it increases the blind size by 20% but decreases it by 10% for every subsequent hand, but for some reason it's triggering at 100% of the blind's score?
modify_blind() is a function I created that just changes a blind's size lol

calculate = function(self, card, context)
        if context.after and G.GAME.chips >= math.floor(G.GAME.blind.chips / 2) and card.ability.extra.reached_requirement == false then
            modify_blind(card.ability.extra.blind_increase)
            card.ability.extra.reached_requirement = true
            card_eval_status_text(card, "extra", nil, nil, nil, {message = "Active!"})
        end
        if context.before and card.ability.extra.reached_requirement then
            modify_blind(card.ability.extra.blind_decrease)
            card_eval_status_text(card, "extra", nil, nil, nil, {message = "Bleed!"})
        end
    end```
#

card.ability.extra.blind_increase and card.ability.extra.blind_decrease are 1.2 and 0.9 respectively

thick panther
#

Is there a context for entering a shop? I see one for ending a shop.

hearty mesa
#

There's a context for ending the round, context.end_of_round but you need to do context.end_of_round and not context.game_over and not context.individual and not context.repetition and not context.retrigger_joker to make it only trigger once

#

and also not trigger if you lose the run

red flower
hearty mesa
#

oh dang

#

thanks lol

thick panther
#

Weird it's not on the wiki

red flower
#

it's a new one, hasn't been documented yet

hearty mesa
red flower
hearty mesa
#

the effect is triggering at 100% of the blind's score instead of at 50% of the blind's score

thick panther
#

How would I check if a joker was bought and is in the joker slot? Is there a var for it? I know about add_to_deck, but Im looking for a var for an if-statement.

spiral hawk
#

i keep getting a "unexpected symbol near" message aaaaaaaaaaaaa

red flower
red flower
hearty mesa
spiral hawk
red flower
#

use vscode or something

#

it will tell you where syntax errors are

lucid owl
#

thanks autocomplete, definitely what i was going for

polar parrot
#

is there any good tutorial on how to make mods? i want to make a mod but i dont know how.

maiden phoenix
tall wharf
#

where do i put stuff that resets every ante

maiden phoenix
#

i tihnk

tall wharf
#

yea im using that and store last ante

#

im stupid lmoa

maiden phoenix
#

<@&1133519078540185692>

tall wharf
#

<@&1133519078540185692>

#

oops

grand violet
karmic creek
#

yeet

grand violet
#

skeet
delete

tall wharf
#

which one of you did ti

grand violet
#

vonnegut, I think

maiden phoenix
grand violet
#

I saw the message disappear before I clicked Ban

maiden phoenix
#

Those are becoming way more frequent tbh

red flower
# spiral hawk

yeah but a code editor highlights them in the code before running the game

tall wharf
#

vro is fast

thick panther
#

Is there a way to set the sell price of a joker in its calculate or update functions?

tall wharf
#

❤️

#

wrong sprite damn it

#

ill reword it