#💻・modding-dev

1 messages · Page 488 of 1

manic rune
#

why is it so low???

lament agate
#

@manic rune i need jelp

manic rune
#

hi

lament agate
#

this @manic rune

manic rune
#

no clue what that is

#

what happened

lament agate
brittle yacht
autumn brook
#

And how can i do that? 🥲 Sorry if this is an dumb question the only thing im good at is changing the sound

brittle yacht
#
    vol = 1,
    pitch = 1,
    key = "music_spamton1",
    path = "music_spamton1.ogg",
    select_music_track = function()
        return next(SMODS.find_card("j_silly_spambot")) and string.len(G.GAME.blind.name) > 0
    end,
})```
autumn brook
lament agate
#

this deck gives out negative tag

#

each round

#

but whenever i hover over a card

#

it shows that crash

brittle yacht
#

lord

fossil nebula
#

I can't find this in wiki

#

I would only like to check if it's a king

manic rune
manic rune
lament agate
#

that's really odd

manic rune
#

check SMODS.Joker documentation, it has that

keen atlas
lament agate
#

damn

autumn brook
#

is there somewhere a list of card.ability. ?

red flower
#

what are you trying to find

brittle yacht
#
    vol = 1,
    pitch = 1,
    key = "music_spamton2",
    path = "music_spamton2.ogg",
    select_music_track = function()
        return next(SMODS.find_card("j_silly_spambot")) and G.GAME.blind and G.GAME.blind:get_type() == 'Boss' = true
    end,
})
brittle tide
#

I've got this Joker to be completely functional whenever its being played in a game but whenever I check it in the collection on the main menu it crashes. I was wondering if theres a way to just get it to display 0 in the collection while still functioning in a game.

faint yacht
candid sleet
#

how would i change this so that it can't buff itself, just the other jokers

normal crest
brittle tide
normal crest
#

Cus that is outside the math.floor call

#

The stuff inside math.floor is nil when G.playing_cards doesn't exist

#

And that's why it crashes

#

It expects a number

brittle tide
#

ohh

#

mb

brittle yacht
#
    vol = 1,
    pitch = 1,
    key = "music_spamton1",
    path = "music_spamton1.ogg",
    select_music_track = function()
        return next(SMODS.find_card("j_silly_spambot")) and string.len(G.GAME.blind.name) > 0 and not G.GAME.blind:get_type() == 'Boss'
    end,
})

SMODS.Sound({
    vol = 1,
    pitch = 1,
    key = "music_spamton2",
    path = "music_spamton2.ogg",
    select_music_track = function()
        return next(SMODS.find_card("j_silly_spambot")) and G.GAME.blind and G.GAME.blind:get_type() == 'Boss'
    end,
})

this is supposed to play the 1st music in small and big blinds, and the 2nd music is suppsoed to play in boos blinds. right now, this only plays the boss blind's music in boss blinds, and the default balatro music in small and big blinds.

#

why that happen?

normal crest
#

In your first one not G.GAME.blind:get_type() == "Boss" remove not and replace == with ~=

fossil nebula
#

What is kings id?

normal crest
#

13

fossil nebula
#

thx

rotund sable
fossil nebula
#

well I run into another problem

#

I have this code that i frankensteined from what I could find

brittle tide
fossil nebula
#

It's propably wrong but what's most importantly it crashes the game

normal crest
fossil nebula
normal crest
fossil nebula
# fossil nebula

I have no idea how to do this I just put together pieces from example jokers

normal crest
#

And inside the return you can put a message or something if you want

#

Also what is the crash

normal crest
# fossil nebula

Oh I see, you are meant to pass context.other_card to modify_rank, not card

normal crest
brittle tide
fossil nebula
fossil nebula
normal crest
fossil nebula
#

Thx it works

bitter portal
normal crest
void sparrow
#

anyone has the card key for the soul spectral?

normal crest
#

c_soul probably

#

They're in Mods/lovely/dump/game.lua

void sparrow
#

oh thanks, i'll check

#

!!

wind steppe
#

is there an achievement argument for buying a joker

fossil nebula
#

but can I make it that queens turn into kings and kings turn into queens

drowsy acorn
#

the game is telling me that field is_poker_hand_visible is a nil value. anybody know why this is happening?

            local _poker_hands = {}
            for handname, _ in pairs(G.GAME.hands) do
                if SMODS.is_poker_hand_visible(handname) and handname ~= card.ability.extra.poker_hand then    --Returns  nil for some reason
                    _poker_hands[#_poker_hands + 1] = handname
                end
            end
            card.ability.extra.poker_hand = pseudorandom_element(_poker_hands, 'CosmicTomfoolery_warrior')
            return {
                message = localize('k_reset')
            }
        end```
drowsy acorn
#

that fixed it lmao

#

thank youuu

normal crest
fossil nebula
#

I figured how to do that

#

it works

vast bough
#

what are some good examples of mods that are simpler that use custom rarities so i can have a look at the code and see how its all done in more detail than looking at smods docs

normal crest
#

Try using hanging chad with it

brittle yacht
#

how can i detect if a boss blind has an A or S in it, and debuff it?

red flower
brittle yacht
vast bough
brittle yacht
#

plus would it work with modded ones too?

fossil nebula
# fossil nebula

Is it possible to make it that it has like a little animation of card changing/text appear?

#

and for it to go card by card

red flower
brittle yacht
#

its supposed to only work with boss blinds

red flower
red flower
#

check for boss blinds yourself beforehand

normal crest
red flower
fossil nebula
#

thx

normal crest
void sparrow
#

does anyone know how to remove those two lines on the borders? they aren't in any of my atlases :/

glass crown
#

does anyone know how to fix the problem of a custom booster pack giving a custom consumable having a bunch of green particles like floating around the consumable for some reason? i think ive heard that this is a problem others have had and im wondering if a way to fix it has been found

normal crest
#

Add skip_materialize = true

#

To where you create the cards

brittle yacht
#
    key = 'crt',
    loc_txt = {
        name = '{C:purple}C{}{C:attention}R{}{C:purple}T{}',
        text = {
            '"Hey folks, looks like the censors ARE gonna kill me!"'
        }
    },
    atlas = 'crt',
    pos = {x = 0, y = 0},
    rarity = 4,
    cost = 8,

    if G.GAME.blind and G.GAME.blind:get_type() == 'Boss' then
             G.GAME.blind:disable()
             message = 'Censored!'
    end
}```
red flower
#

where's the calculate

brittle yacht
#

shoot

#

mb

red flower
#

also i recommend looking at chicot

brittle yacht
glass crown
brittle yacht
#

nvm

#
    key = 'crt',
    loc_txt = {
        name = '{C:purple}C{}{C:attention}R{}{C:purple}T{}',
        text = {
            '"Hey folks, looks like the censors ARE gonna kill me!"'
        }
    },
    atlas = 'crt',
    pos = {x = 0, y = 0},
    rarity = 4,
    cost = 8,

    calculate = function(self, card, context)
    if  context.setting_blind and not context.blueprint and context.blind.boss then
             G.GAME.blind:disable()
             message = 'Censored!'
    end
}```
#

210 is the last line

normal crest
#

Missing an end

brittle yacht
#

yup

#

the message doesnt appear, is this easily fixable

#
    key = 'crt',
    loc_txt = {
        name = '{C:purple}C{}{C:attention}R{}{C:purple}T{}',
        text = {
            '"Hey folks, looks like the censors ARE gonna kill me!"'
        }
    },
    atlas = 'crt',
    pos = {x = 0, y = 0},
    rarity = 4,
    cost = 8,

    calculate = function(self, card, context)
        if context.setting_blind and not context.blueprint and context.blind.boss then
             G.GAME.blind:disable()
             message = 'Censored!'
        end
    end
}```
normal crest
#

You're not returning it

brittle yacht
#

mb again

normal crest
#

Hi something

brittle yacht
#

hold

#
    key = 'crt',
    loc_txt = {
        name = '{C:red}C{}{C:attention}R{}{C:red}T{}',
        text = {
            '"Hey folks, looks like the censors ARE gonna kill me!"'
        }
    },
    atlas = 'crt',
    pos = {x = 0, y = 0},
    rarity = 4,
    cost = 8,

    calculate = function(self, card, context)
        if context.setting_blind and not context.blueprint and context.blind.boss then
             G.GAME.blind:disable()
             return{
                message = 'Censored!'
                }
            end
        end
    end,
}
#

what wrong now

daring fern
brittle yacht
fossil nebula
#

because now they do it instantly

rotund sable
sonic cedar
#

....guys where's the probability context guide they were talking about am i stupid

sonic cedar
rotund sable
sonic cedar
#

oh yeah there it is thanks lmao

daring fern
fossil nebula
daring fern
#

And out of the return.

daring fern
fossil nebula
#

And where in the code do I put it?

daring fern
fossil nebula
#

Ok and then I refer to it in the return?

daring fern
fossil nebula
#

Like

#

I kinda don't get how they work

neat leaf
#

How do I get Balatro to ignore files with the .swp extension? I use vim and it creates swap files to save the buffer I'm working on, but starting Balatro with one of those present causes an immediate crash. I can disable swapfiles, but I'd rather find a way to keep them around.

#

Answer: add *.swp to .lovelyignore. Disregard. 🙂

brittle yacht
#
    key = 'crt',
    loc_txt = {
        name = '{C:red}C{}{C:attention}R{}{C:red}T{}',
        text = {
            'Reduces required scores by half, but has a 1 in 6 chance to crash the game'
        }
    },
    atlas = 'crt',
    pos = {x = 0, y = 0},
    rarity = 4,
    cost = 8,
    config = { extra = {chance = 6}},

    loc_vars = function(self, info_queue, center)
        return { vars = { G.GAME.probabilities.normal, center.ability.extra.chance }  }
    end,

    calculate = function(self, card, context)
    if context.setting_blind then
        if pseudorandom('crt') < (G.GAME.probabilities.normal / card.ability.extra.chance) then crashGame() end
        return {
            message = "Censored!"
        }
    end
end,
}```
#

why bug

neat leaf
#

How do I force a game save?

#
        return { vars = { G.GAME.probabilities.normal, center.ability.extra.chance }  }

replace with

        return { vars = { G.GAME.probabilities.normal, center.ability and center.ability.extra and center.ability.extra.chance or 0 }  }
#

actually 0 might not be the best value

brittle yacht
neat leaf
#

replace 0 with a value that says "will never happen"

#

like -1 maybe

brittle yacht
#

ok

neat leaf
#

my guess based on the error is that you're executing on an object without center.ability.extra

snow breach
#

Is there a way to "claim ownership" of the shop, such that rerolling does something without the use of jokers?

red flower
neat leaf
red flower
#

or hook the function that does that

snow breach
#

Can you elaborate any?

red flower
#

About what a hook is or why SMODS.calculate_context?

snow breach
#

What a hook is

red flower
#

It's a way to attach functionality to functions that already exist basically
https://forums.kleientertainment.com/forums/topic/129557-tutorial-function-hooking-and-you/

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...

snow breach
#

I don't fully understand this.

#

What part of the code is actually hooking it?

red flower
#

ignore the first if condition

snow breach
#

So like this?

normal crest
#

that's not hooking, that's overriding

snow breach
#

Oh

#

What do I do then-?

normal crest
snow breach
#

I'm so confused, where is the hook actuall occuring?

normal crest
#

maybe it's clearer now?

snow breach
#

Not even a little bit

red flower
#

SMODS_calculate_context_ref(context, return_table) runs the original function and saves the return to ret
you're basically adding stuff to the original

normal crest
#

You're saving what the function was before, then you're overriding the function, but making sure to use the reference to what the function was before inside, so you're essentially adding code to it

snow breach
#

Ohhhhhhh

brittle tide
#

Does anyone know whats causing this crash?

daring fern
brittle tide
#

I was digging around in this channel seeing if anyone had the same problem as me and someone did so I tried doing what they did to see if it'd work

#

I'm trying to double eor cash

daring fern
brittle tide
#

oh ok

#

That worked thank you

sonic cedar
#

it's.... it's beautiful.....

#

ok wait is mod_probability constant

#

like will it update the descriptions or

neat leaf
#

Where can I find documentation on the Balatro API?

sonic cedar
sonic cedar
normal crest
normal crest
#

yes

#

smods patches them

sonic cedar
#

oh ok nice

#

ill just have to update mine then

red flower
neat leaf
#

Darn, okay.

normal crest
#

What happens if multiple objects use fix_probability

red flower
red flower
normal crest
red flower
#

iirc it is from left to right like normal

normal crest
#

would it just be this order then

red flower
#

yeah

normal crest
#

And where do blinds come in

red flower
#

i think blinds are first? I was just gonna say that i would be nice to have the order of object calculations somewhere

wintry solar
#

I think blinds are towards the end iirc

#

with decks

normal crest
#

well fix_probability isn't that reliable then

#

from a user perspective

sonic cedar
#

the whole joker... contained within itself... damn you smods...

normal crest
#

I'd modify the denominator instead of numerator when halving tbh

#

0.5 in 2 doesn't look as good as 1 in 4

#

and by halving i mean reducing in general

neat leaf
#

How would I make a text input that only accepts numbers?

sonic cedar
snow breach
#

For G.GAME[key:lower() .. '_mod'] where do I put the number to modify it by

red flower
#

G.GAME.key_mod = number

snow breach
#

So I don't need to claim ownership of the rarities?

red flower
#

no

snow breach
#

It's saying cannot be used as a statement

red flower
#

can i see the code

snow breach
red flower
#

G.GAME.common_mod

#

also it's because you're missing the assignment (the = number part)

snow breach
#

Can you jusst type it out, I don't feel like decrypting that rn

red flower
#

i did????

pure salmon
#

you gotta put in a bit of graft man

snow breach
normal crest
#

G.GAME.common_mod = 33550336

red flower
snow breach
snow breach
#

There's nothhing to call that number.

red flower
#

it's a global that the game will later check when generating rarities

pure salmon
snow breach
#

It's literally not that deep

#

I main Python, JavaScript and Rust, not Lua.

modern kindle
#

Hello modding of the dev

red flower
#

hi dilly

modern kindle
#

How are you N

red flower
#

🛌

modern kindle
#

Dude
Im in bed too

#

Its like we're resting together

red flower
#

im getting up

modern kindle
#

:(

fossil nebula
#

I don't know how it should look

daring fern
fossil nebula
daring fern
# fossil nebula

You need to put context.other_card in a local variable outside of the event I think.

wild zinc
#

Okay, so this is to test card destruction based functionality. I thought it would count down each time a card is destroyed, per card destroyed, but it only counts down when card destruction occurs, how can I fix this?

placid star
#

with this i have card as my ref_table but it doesnt work and when i eval .config.ref_table its nil

red flower
red flower
fossil nebula
red flower
placid star
#

ill take a look rn

daring fern
placid star
red flower
#

it's a couple of lines up

#

the difference with regular blueprint is that it wont update as you drag it i think

fossil nebula
daring fern
placid star
sonic cedar
#

If I'm ownershipped into WOF for an unlock, but it's based off the base game one, which uses the old probability, do I have to change it?

sonic cedar
red flower
#

i dont trust take ownership

sonic cedar
#

wait you said hook, that means i dont need a joker

#

which function is it

red flower
#

SMODS.pseudorandom_probability

#

wof calls it with identifier 'wheel_of_fortune'

sonic cedar
#

to the overrides file!

lament agate
#

is there any better way to do this

red flower
#

pseudorandom("seed", min, max)

lament agate
#

somehow

normal crest
sonic cedar
#

oh no

normal crest
#

you want to check if key == 'wheel_of_fortune' then do stuff end

sonic cedar
#

oh duh lmao

#

nearly forgot the basics

pure salmon
#

context.main_eval now always equates to nil in ``context.joker_main` in newest smods release

#

it's been breaking all my damn jokers!!

normal crest
#

you were never meant to use those two together

fossil nebula
#

Can I make the message being send in this event, not after

sonic cedar
normal crest
fossil nebula
#

and when i put it in the event it dosn't work

sonic cedar
# normal crest what is your goal?

consecutive wheel fail counter that triggers an unlock at 3 in a row
previously done in an ownership but according to the update i shouldnt need to?

fossil nebula
#

i assume there is some other command to send messages inside of those

sonic cedar
normal crest
#

or is that farm

sonic cedar
#

as in farmer

sonic cedar
#

which was it resetting with each success, and incrementing with each failure

brittle yacht
#
    key = 'spambot',
    loc_txt = {
        name = '{C:purple}Spam{}{C:money}bot{}',
        text = {
            'Earn {C:money}3 Kromer{} at the end of a blind - UPGRADE IN [(#2#/#3#)] ROUNDS!'
        }
    },
    atlas = 'spambot',
    pos = {x = 0, y = 0},
    rarity = 2,
    cost = 6,
    config = { extra = { dollars = 3, round = 0, maxround = 6 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.dollars, center.ability.extra.round, center.ability.extra.maxround}}
    end,

    calc_dollar_bonus = function(self, card)
        return card.ability.extra.dollars
    end

    calculate = function(self, card, context)
        if context.setting_blind and not context.blueprint then
                local _msg = "UPGRADE"
                card.ability.extra.round = card.ability.extra.round + 1
                if card.ability.extra.round >= card.ability.extra.maxround then 
                    local _msg = "UPGRADED"
                    SMODS.destroy_cards(card)
                   end
        end
    end
}```
#

why bug?

sonic cedar
#

oh my goodness gracious

#

you forgot to say what the bug was

sonic cedar
#

that's more than a bug

red flower
brittle yacht
#

what i do wrong

fossil nebula
normal crest
#

you have a syntax error

#

please just use the lua extension, which willl tell you where it is

fossil nebula
#

is there a way that it goes before the score

brittle yacht
#

nvm i fixed

sonic cedar
#

turn it on 😭

brittle yacht
#

anyway new bug

#
    key = 'spambot',
    loc_txt = {
        name = '{C:purple}Spam{}{C:money}bot{}',
        text = {
            'Earn {C:money}3 Kromer{} at the end of a blind - UPGRADE IN [(#2#/#3#)] ROUNDS!'
        }
    },
    atlas = 'spambot',
    pos = {x = 0, y = 0},
    rarity = 2,
    cost = 6,
    config = { extra = { dollars = 3, round = 0, maxround = 6 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.dollars, center.ability.extra.round, center.ability.extra.maxround}}
    end,

    calc_dollar_bonus = function(self, card)
        return card.ability.extra.dollars
    end,

    calculate = function(self, card, context)
        if context.setting_blind and not context.blueprint then
                local _msg = "UPGRADE"
                card.ability.extra.round = card.ability.extra.round + 1
                if card.ability.extra.round >= card.ability.extra.maxround then 
                    local _msg = "UPGRADED"
                    SMODS.destroy_cards(card)
                   end
        end
    end
}```
sonic cedar
brittle yacht
#

i dont see any red squiggly lines bro

brittle yacht
sonic cedar
#

card

fossil nebula
brittle yacht
#

oh

sonic cedar
fossil nebula
normal crest
sonic cedar
fossil nebula
#

I'm sorry I'm really new to this 😭

#

Lua is like black magic to me

sonic cedar
#

i meant your formatting but

brittle yacht
normal crest
#

end
end
end
end

sonic cedar
#

to after the message

fossil nebula
#

the order is

#

The card is scored and at the same time changed

sonic cedar
#

no like
in a separate event

fossil nebula
#

and after the hand is finished the message appears

#

oh

fossil nebula
sonic cedar
fossil nebula
rotund sable
#

move the local into the if checkss

#

i think

sonic cedar
#

no that's fine

#

they're having a timing issue

sonic cedar
rotund sable
#

oh i didn't read up enough

sonic cedar
#

ur good 👍

fossil nebula
#

Now it just waits 1s before scoring and changing

#

Maybe it's because that it does both at the same time

rotund sable
#
G.E_MANAGER:add_event(Event({
  trigger = "after",
  delay = 0.5,
  func = function()
      -- code here
  end
}))

?

#

on the second event

fossil nebula
#

but I don't know how to change that

sonic cedar
fossil nebula
#

on which one?

sonic cedar
#

better idea here's what i usually do for multiple events

brittle yacht
#

why this batch of code no work?

#
        if context.setting_blind and not context.blueprint then
                do return{
                    message = 'UPGRADE'
                } end
                card.ability.extra.round = card.ability.extra.round + 1
                if card.ability.extra.round >= card.ability.extra.maxround then 
                    do return{
                        message = 'UPGRADED'
                    } end
                    SMODS.destroy_cards(card)
                    SMODS.add_card{ key = "j_silly_spambotNEO" }
                   end
        end
    end
}```
sonic cedar
brittle yacht
#

MY LUA EXTENSION ISNT PICKING IT UP

sonic cedar
brittle yacht
sonic cedar
brittle yacht
#

yes its installed

sonic cedar
fossil nebula
brittle yacht
#

it wont "upgrade"

glass crown
#

potentially nightmarish question, how would one go about making an edition that cant be destroyed or disabled? if the "destroyed" part is too much mmaybe just the disabled part ackackackack

fossil nebula
#

it's so weird

brittle yacht
sonic cedar
sonic cedar
brittle yacht
#

lord

normal crest
#

Which extension did you install

brittle yacht
#

the only thing it doesnt like is the ends

#
        end
    end
}```
#
    key = 'spambot',
    loc_txt = {
        name = '{C:purple}Spam{}{C:money}bot{}',
        text = { "Earn {C:money}3 Kromer{} at the end of a blind",
        "UPGRADE IN [(#2#/#3#)] ROUNDS!"},},
    atlas = 'spambot',
    pos = {x = 0, y = 0},
    rarity = 2,
    cost = 6,
    config = { extra = { dollars = 3, round = 0, maxround = 6 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.dollars, card.ability.extra.round, card.ability.extra.maxround}}
    end,

    calc_dollar_bonus = function(self, card)
        return card.ability.extra.dollars
    end,

    calculate = function(self, card, context)
        if context.setting_blind and not context.blueprint then
                return{
                    message = 'UPGRADE'
                } end
                card.ability.extra.round = card.ability.extra.round + 1
                if card.ability.extra.round >= card.ability.extra.maxround then 
                    return{
                        message = 'UPGRADED'
                    } end
                    SMODS.destroy_cards(card)
                    SMODS.add_card{ key = "j_silly_spambotNEO" }
                   end
        end
    end
}```
normal crest
#

You have two extra ends

brittle yacht
brittle yacht
normal crest
fossil nebula
normal crest
#

and you will see that your code is not doing what you want it to do, cus you have stuff all over the place

sonic cedar
#

dude i forgot about format document i need to do that

sonic cedar
normal crest
sonic cedar
#

i totally remember how to do that

#

wait a second i do remember how to do that

normal crest
#

it's a vscode setting

rotund sable
fossil nebula
#

it like goes on the end of the queue no matter what

sonic cedar
red flower
normal crest
fossil nebula
#

so what should i do

normal crest
#

Did you already try putting the modify_rank in an event, and the message in a return after the event

fossil nebula
#

Yeah that does the same thing

sonic cedar
#

jic

fossil nebula
#

before or at least at the same time

sonic cedar
rotund sable
#

why the hell is ui so confusing here 😭

normal crest
scarlet imp
sonic cedar
red flower
#

mac is the default for the screenshot plugin

normal crest
scarlet imp
#

oh I see

#

my mistake

rotund sable
#

on first glance

scarlet imp
#

well to be fair, most modders won't go straight into UI work when they make their first mod
I think it's fair to trust that anyone reading UI documentation is willing to thug it out

fossil nebula
#

it goes after the hand finishes

normal crest
#

Okay maybe you shouldn't use context.individual then

#

That is for doing something whenever a card scores

fossil nebula
rotund sable
#

though i wish i had a second monitor to make myself a cheat sheet

red flower
normal crest
fossil nebula
#

so what should be there

sonic cedar
#

but that's it right (pretend it's local in the ss and that i didnt forget to put it there)

normal crest
# fossil nebula so what should be there

Depends on what you want it to do exactly, do you want to modify the cards before the hand is played, after the hand is played, do you want the rank changes to take effect for the hand they're being played on

fossil nebula
#

Ok so it should go like that

fossil nebula
#

You play a hand, the cards change and message is sent at the same time, they get scored

sonic cedar
fossil nebula
#

They can also change after they get scored

#

the main problem here is that message is desynchronized from the change

normal crest
#

Can you send your code as a file

#

or just as text that I can copy, not a screenshot

rotund sable
fossil nebula
# normal crest or just as text that I can copy, not a screenshot
        local other_card = context.other_card

        if context.individual and context.cardarea == G.play then
            if context.other_card:get_id() == 13 or context.other_card:get_id() == 12 then
                if context.other_card:get_id() == 13 then
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            SMODS.calculate_effect({ message = "test" }, card)
                            return true
                        end,
                    }))
                    G.E_MANAGER:add_event(Event({
                        trigger = "after",
                        delay = 1,
                        func = function()
                            SMODS.modify_rank(other_card, -1)
                            return true
                        end,
                    }))
                    return
                    {
                    }
                else
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            SMODS.calculate_effect({ message = "test" }, card)
                            return true
                        end,
                    }))
                    G.E_MANAGER:add_event(Event({
                        trigger = "after",
                        delay = 1,
                        func = function()
                            SMODS.modify_rank(other_card, 1)
                            return true
                        end,
                    }))
                    return
                    {
                    }
                end
            end
        end
    end

}
normal crest
normal crest
# fossil nebula ``` calculate = function(self, card, context, other_card) local other...
calculate = function(self, card, context)
  if context.individual and context.cardarea == G.play then
    local other_card = context.other_card

    if context.other_card:get_id() == 13 or context.other_card:get_id() == 12 then
      if context.other_card:get_id() == 13 then
        G.E_MANAGER:add_event(Event({
          func = function()
            SMODS.modify_rank(other_card, -1)
            return true
          end,
        }))

        return {
          message = "boop"
        }
      else
        G.E_MANAGER:add_event(Event({
          func = function()
            SMODS.modify_rank(other_card, 1)
            return true
          end,
        }))

        return {
          message = "boop 2"
        }
      end
    end
  end
end

well, this works perfectly fine by me

turbid crystal
#

whats the difference between parts._2 and parts._all_pairs?

brittle yacht
#

how to add waiting in code

#

yknow like the usual wait() command?

#

it doesnt seem to work here

red flower
#

delay(seconds)

placid star
#

should this work?

normal crest
#

well, the literal one would be love.timer.sleep(1) that's in seconds, but that will freeze your entire game for a second, you want to use delay(seconds) alongside an event

placid star
normal crest
brittle yacht
#

so this code spawns 20 spambot neos when the regular card is spawned in the middle of a blind, so how do i fix this

#
    key = 'spambot',
    loc_txt = {
        name = '{C:purple}Spam{}{C:money}bot{}',
        text = { "Earn {C:money}3 Kromer{} at the end of a blind",
            "UPGRADE IN [(#2#/#3#)] ROUNDS!" }, },
    atlas = 'spambot',
    pos = { x = 0, y = 0 },
    rarity = 2,
    cost = 6,
    config = { extra = { dollars = 3, round = 0, maxround = 6 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.dollars, card.ability.extra.round, card.ability.extra.maxround } }
    end,

    calc_dollar_bonus = function(self, card)
        return card.ability.extra.dollars
    end,

    calculate = function(self, card, context)
        if context.setting_blind and not context.blueprint then
            return {
                message = 'UPGRADE'
                }
            end
            card.ability.extra.round = card.ability.extra.round + 1

        if card.ability.extra.round >= card.ability.extra.maxround then
                return {
                    message = 'UPGRADED'
                    }
                end
            SMODS.destroy_cards(card)
            SMODS.add_card { key = "j_silly_spambotNEO" }
            delay(2)
        end
}```
normal crest
placid star
normal crest
placid star
#

alll jokers that are loaded into the game

daring fern
normal crest
#

G.P_CENTERS is where they're loaded, but they're not jokers yet

#

They're just the skeleton of a future to be joker

daring fern
fossil nebula
#

thx for all the help

normal crest
#

glad to hear

brittle yacht
# normal crest Right click your code and click "format document" and you will see that your add...

would this work? i see tons of squiggly lines, but...

    key = 'spambot',
    loc_txt = {
        name = '{C:purple}Spam{}{C:money}bot{}',
        text = { "Earn {C:money}3 Kromer{} at the end of a blind",
            "UPGRADE IN [(#2#/#3#)] ROUNDS!" }, },
    atlas = 'spambot',
    pos = { x = 0, y = 0 },
    rarity = 2,
    cost = 6,
    config = { extra = { dollars = 3, round = 0, maxround = 6 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.dollars, card.ability.extra.round, card.ability.extra.maxround } }
    end,

    calc_dollar_bonus = function(self, card)
        return card.ability.extra.dollars
    end,

    calculate = function(self, card, context)
        if context.setting_blind and not context.blueprint then
            return {
                message = 'UPGRADE'
            } end
            card.ability.extra.round = card.ability.extra.round + 1
        end
        if card.ability.extra.round >= card.ability.extra.maxround then
            do return {
                message = 'UPGRADED'
            } end end
            SMODS.destroy_cards(card)
            SMODS.add_card { key = "j_silly_spambotNEO" }
            delay(2)
        end
    end
}```
normal crest
#

no, if you see squiggly lines your game will not launch

brittle yacht
#

so why wont it work?

normal crest
#

you probably want something like this

 calculate = function(self, card, context)
      if context.setting_blind and not context.blueprint then
          card.ability.extra.round = card.ability.extra.round + 1

          if card.ability.extra.round >= card.ability.extra.maxround then
              SMODS.destroy_cards(card)
              SMODS.add_card { key = "j_silly_spambotNEO" }
              delay(2)
              return
          end

          return {
              message = 'UPGRADED'
          }
      end
  end
#

🥄

brittle yacht
#

thank you kind soul

scarlet imp
#

bump

sonic cedar
#

so with pseudorandom_element gone, how would something like perkeo work?

normal crest
#

that function is not gone

#

the new probability stuff doesn't affect how you'd use that one

sonic cedar
#

it's not? cause it's not registering for me

#

everything else is fine

normal crest
#

probably just your extension going crazy

#

it definitely exists

sonic cedar
#

i can just leave that alone then awesome

lament agate
#

how would i implement pseudorandom to a sound function

lament agate
#

it keeps spawning 2 tags instead of 1

#

with no assigned repetition in console

daring fern
lament agate
lament agate
daring fern
lament agate
lucid owl
#

with the new probability changes, is there a way to specifically make only lucky cards have a higher probability?

sturdy compass
#

Yes

lucid owl
#

(for a joker that increases lucky card odds by 1 every time one succeeds)

#

resets at end of round obviously

sturdy compass
#

You can check if a roll is being performed on a lucky card by either checking context.identifier or context.trigger_obj

lucid owl
#

ah, okay i figured but wasn't sure if they were that specific

sturdy compass
#

I’d say go for trigger_obj since there are technically two identifiers for lucky cards

lucid owl
#

i assume lucky cards were patched to use smods probabilities

sturdy compass
#

Yup

lucid owl
#

sick, will try it out later

lament agate
#

bump

#

fuck

lament agate
brittle yacht
#

am i able to make the game speed faster than it should be when a joker is held?

brittle yacht
unborn bay
#

its a matter of changing a single variable really

#

one of my terrible commons literally just makes the game faster and thats all it does

limber blaze
limber blaze
#

i mean if its for a deck i dont think you need not context.blueprint but it shouldnt break stuff either

lament agate
#

Parakmi and Freedom

#

whats the context for

#

discarding a hand and selecting a card

daring fern
lament agate
#

that sucks

#

thanks

limber blaze
#

you could make your own selecting context pretty easily tbf

lament agate
daring fern
limber blaze
#
local highlight_ref = Card.highlight
function Card:highlight(is_highlighted)
   SMODS.calculate_context{card_selected = true, highlighted = is_highlighted, card = self}
   return highlight_ref(self, is_highlighted) --idk if this returns better to be safe ig though
end```
#

oops typo

#

you can really do this type of stuff for anything you want tbh

#

i have various custom contexts

limber blaze
#

basically

lament agate
#

more contexts for flashbang

lucid owl
#

is this correctly making lucky cards have +1 higher odds every time one triggers? it seems so but chance can be so finnicky that i really wanna make sure it looks right to other people

daring fern
lucid owl
#

shit, you're right

primal robin
limber blaze
#

that too

#

i was going to but i couldnt think of a purpose for more vars here

#

and generally you want to avoid more vars in general

#

since if multiple people do it then stuff breaks

primal robin
#

It's you think, but some guy theoretically can add own thing

limber blaze
#

well yes not breaking if someone does something weird is better

#

but i dont think every weird decision should be accomodated

primal robin
#

Who knows what cryptoposting guy will add tomorrow

limber blaze
#

its just really easy to do so here

primal robin
#

Okay, other case. When vanilla game will be updated and LocalThunk himself decide add smth to it?

limber blaze
#

i dont think thats gonna happen here

primal robin
#

But this can happen

#

You never know

limber blaze
#

i have a pretty good feeling its not gonna happen here

primal robin
#

But you have a lot more places patched like this. There's probability that in one of them somth will be added

#

So be better just be ready for unexpected things

#

Imagine debugging this kind of issue

lament agate
#

any ideas why are they unused all of the sudden

primal robin
#

If you can prevent issue theoretically, why not

daring fern
lucid owl
#

how could a blind modify probabilities with the new system? this is what i previously had for a blind that set all odds to 0:

lament agate
glass crown
#

whats the best way to apply an edition to all selected cards? (i actually need just 3 but i can do that part myself)

red flower
#

if you add any args to a function im getting you in real life

lament agate
#

WDYM

#

im trying to hook man

red flower
lucid owl
#

args being unused isn't an issue

lament agate
#

oh

red flower
lament agate
#

oh that scacres the fuck out of me

lucid owl
#

those named objects are just variables with set names that are used in the function

lament agate
#

@limber blaze game crashed btw

lucid owl
#

if you dont use em

#

you dont use em

daring fern
limber blaze
lament agate
lucid owl
red flower
#

they do

#

they have a calculate function

lucid owl
#

ohhhh you're right

lament agate
modern kindle
#

i was gonna say youre quite silly

lucid owl
#

i forgor

lament agate
#

everyone has contexts

modern kindle
#

nuh uh, i disabled them for me

lament agate
#

D:

red flower
#
SMODS.calculate_context = function() end
modern kindle
#

hi N 👉 👈

primal robin
red flower
#

hewwo

lament agate
#

hey folks

modern kindle
maiden phoenix
#

modding chat is having an aneurysm rn so I'm showing it here too

modern kindle
#

modding chat only ever has an aneurysm

maiden phoenix
#

Nowadays it just feel horrible..

modern kindle
#

ive always considered it very hectic, its why most of my messages are in here even if not specifically dev related

primal robin
#

Maybe I should make my own collection of UI components for all needs to make life others easier?

lament agate
#

civil war before Talisman 2 is crazy

red flower
modern kindle
#

im sure nobody would tell you to perish over a easier ui way of things

modern kindle
red flower
#

lets goo

modern kindle
#

ive decided i will fuck it we ball

primal robin
modern kindle
#

more power to you then

primal robin
#

In most cases I guess

#

Never work with info_queue btw

glass crown
#

how do you check what edition a card has?

daring fern
glass crown
#

thank you!

timid zinc
#

I'm trying to add a custom infobox to a joker

#

Am i Doing it wrong

scarlet imp
#

you shouldn't need type = variable. I have a variable tooltip that doesn't require that

normal crest
#

You will want to put it inside the Other set if you don't wanna mess with that

glass crown
#

okay, so, i have this bit of code for repetitions on a certain card edition, but the problem is that the game crashes if a card without an edition is played because its trying to index a nil value on the second line here

        if context.repetition and context.cardarea == G.play and context.other_card.edition.key == 'e_votd_indis' then
            return {
                repetitions = card.ability.extra.repetitions
            }
        end
    end,```
how would i go about fixing this?
normal crest
glass crown
#

got it, thank you!

scarlet imp
#

does SMODS.smart_level_up_hand accept negative values for its amount argument, or do I need to call a different function to decrease the level of a poker hand

normal crest
#

it will work

scarlet imp
#

ok thanks

granite flame
lunar silo
#

guys

formal quest
#

Is there a list of sound IDs?

lunar silo
#

i was going to ask to ask but i remember what i saw

#

so

#

i'll just give some context

#

i have a mod with 9 jokers

#

8 if you exclude blank joker, as it has a placeholder effect

#

but what matters is that

#

when i exported the mod

#

and put it in the mods folder

#

when i checked

#

there were only 4 jokers

#

the shining light, face joker, drawn joker and bidirectionality

scarlet imp
#

are they all in the same file?

lunar silo
#

the 'main' file

#

except the core stuff and assets

scarlet imp
#

what do you mean "core stuff"

daring fern
lunar silo
scarlet imp
#

were you able to successfully playtest them? like does the problem only occur after you export?

scarlet imp
#

did you ever see the Jokers in-game

arctic notch
#

This error pops up when I check my deck ingame. Short error: src in steammoded attempts to index a null value

#

Any insights?

lunar silo
#

yes

#

in the code there were the 9 jokers but in the game there were only 4

normal crest
#

Soooo, was there ever a time where you saw all 9 jokers ingame

lunar silo
#

no

scarlet imp
normal crest
#

or the entire main file if possible

scarlet imp
#

either works

#

but if there's a problem with one it might be wrong with all of them (that aren't appearing)

timid zinc
#

How do I detect if a Joker is being viewed in shop/in joker slots vs the collection?

normal crest
#

As well as your mods

lunar silo
#

give me some time

arctic notch
normal crest
timid zinc
#

thank you

normal crest
#

as for jokers slots if card.area == G.jokers then

lunar silo
#

test

#

huh

#

where are my messages

scarlet imp
#

if you're trying to send the file, sometimes the file size is too large for Discord

#

mad annoying

#

that's also why I suggested just sending the code for one of the Jokers, if you can't figure out how to send the file

scarlet imp
#

KB?

lunar silo
#

it doesn't say kb

#

it just says 14.753

scarlet imp
#

just send the code for one of them dog

#

my guess is that if we find a problem with one it will exist in the others as well

lunar silo
#
    name = "Mega Joker",
    key = "unknown_joker",
    config = {
        extra = {
            Xmult = 4
        }
    },
    loc_txt = {
        ['name'] = 'Mega Joker',
        ['text'] = {
            [1] = '{X:mult,C:white}x4{} Mult.'
        }
    },
    pos = {
        x = 1,
        y = 0
    },
    cost = 6,
    rarity = 3,
    blueprint_compat = true,
    eternal_compat = true,
    unlocked = true,
    discovered = true,
    atlas = 'CustomJokers',
    soul_pos = {
        x = 2,
        y = 0
    },

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

    calculate = function(self, card, context)
        if context.cardarea == G.jokers and context.joker_main then
                return {
                    Xmult = card.ability.extra.Xmult
                }
        end
    end
}```
#

wait

#

why is it called 'unknown_joker'

#

nevermind.

#

i found out.

scarlet imp
#

they all had duplicate keys?

#

copy-paste bug?

lunar silo
#

EVERY JOKER THAT DOESN'T APPEAR IS CALLED 'unknown_joker'

#

BECAUSE THE MOD CREATING ENGINE GOT AN UPDATE

scarlet imp
#

easy fix at least

lunar silo
#

and i was skeptical on how only the jokers i've altered were there

#

including the shining light, for some reason

#

now i know why

#

this could've been avoided if i was more attentional but thanks anyways

glass crown
#

how would i have a card apply eternal to itself?

daring fern
wild zinc
#

This thing seems to be ticking down(?) when I select a card instead of when cards are destroyed?

#

I'm dumb asl yall I basically copied the counting part from Jazzercise and I still fucked it up

normal crest
scarlet imp
#

change else to elseif and give it a condition

#
local hands = {}
for k, v in ipairs(G.GAME.hands) do
    if v.visible then
        table.insert(hands, k)
    end
end
for i = 1, 4 do -- The D8 picks 4 hands to change
    local index = math.random(1, #hands)
    SMODS.smart_level_up_hand(card, hands[index], false, math.random(-2, 2))
    table.remove(hands, index)
end

my CS professors are gonna be dissapointed in me
I just wanna pick 4 random hands with no duplicates, only allowing the discovered hands (so no Flush Five, Flush House, or Five of a Kind if they aren't visible)

wild zinc
#

like genuinely I'm still trying to learn lua as I go, so ik this is gonna sound dumb, but I don't know how it's every context except the one I want?

scarlet imp
#

basically, unless the first condition passes, the else will run

daring fern
#

Also have you tried looking at Immolate?

scarlet imp
#

I was using pseudorandom element before, but I don't want duplicates, and modifying the table by removing elements after they are chosen sounds like a bad idea

daring fern
scarlet imp
#

pseudorandom_element could potentially choose the same thing twice in a row if it's not removed from the table. I'm assuming you mean pseudorandom_element(G.GAME.hands) and I don't want to be removing elements from that

daring fern
#

And no, I don't mean that.

crimson dune
#

I am trying to take ownership of bunco's stakes so that they come after my own "persimmon stake" and before gold, but for some reason, come after ruby stake (originated in the new balanced cryptid branch) despite it not being specified. Is there some missing steps to this or are bunco's stakes just that bugged?

#

(yes iam using the jimbocarrot branch)

scarlet imp
# daring fern `pseudorandom_element` returns the index as the second output.
local hands = {}
for k, v in ipairs(G.GAME.hands) do
    if SMODS.is_poker_hand_visible(k) then
        table.insert(hands, k)
    end
end
for i = 1, 4 do -- The D8 picks 4 hands to change
    local _, index = pseudorandom_element(hands, reroll_type)
    SMODS.smart_level_up_hand(card, hands[index], false, math.random(-2, 2))
    table.remove(hands, index)
end

still isn't working properly

#

reroll_type is the seed, yes it is a string

formal quest
#

if context.after and G.GAME.chips < G.GAME.blind.chips
Why does this activate even when the hand is about to win? Check for remaining hands removed for clarity.

stiff locust
#

because context.after happens before the score is directly updated

stiff locust
#

so you need to use a context outside hand scoring

#

or I think you can get the current score

#

and add it to the round score

#

and check for that

formal quest
stiff locust
#

¯_(ツ)_/¯

#

thers a way

#

i just can't remember it

normal crest
#

either check hand_chips * mult or do whatever you need in context.final_scoring_step

scarlet imp
#

I'm actually going insane
G.GAME.hands can't be indexed by number? like what? why

scarlet imp
crimson dune
daring fern
scarlet imp
#

it looks terrible rn bc I'm debugging:

local hands = {}
print(G.GAME.hands[1])
for i = 1, #G.GAME.hands do
    print("REACHED")
    if G.GAME.hands[i].visible then
        table.insert(hands, #hands + 1, G.GAME.hands[i])
    end
end
pseudoshuffle(hands, pseudoseed(reroll_type))
print(hands)
for i = 1, 4 do -- The D8 picks 4 hands to change
    -- SMODS.smart_level_up_hand(card, hands[i], false, math.random(-2, 2))
end

line 2 prints nil

daring fern
scarlet imp
#

I'm just trying to copy the contents of the table but the table is always empty bc apparently you can't index G.GAME.hands by number

daring fern
#

Also you should be using SMODS.is_poker_hand_visible

scarlet imp
#

well earlier I tried this:

for k, v in ipairs(G.GAME.hands) do
    print(k)
    print(v)
    if SMODS.is_poker_hand_visible(k) then
        table.insert(hands, #hands + 1, k)
    end
end

and it never even reached the prints

scarlet imp
#

god I hate lua

#

so needlessly difficult to iterate through a damn table

unborn bay
#

ipairs iterates using integer keys

scarlet imp
#

I understand that, I was just frustrated

#

Lua is new to me and iteration through arrays/lists/tables in other languages almost always works with integers. It just kinda annoys me that Lua makes no distinction between arrays and maps like Java or Python does

tranquil gull
wild escarp
#

What would be the easiest way to give an upgraded version of a vanilla joker? I guess I'd need to get 1. Get the id of the joker to be upgraded, and then 2. Give a joker with the corresponding "upgraded" id. I just cannot think of how to connect the two right now, and I don't know if what I'm saying even makes sense.

scarlet imp
#

if you don't want to create a whole new card, you could modify the Joker's existing config

#

Like make Jimbo give +6 instead of +4 or something

wild escarp
#

It's going to be a whole new card.

daring fern
scarlet imp
#

you could copy the code of Invis Joker, how it becomes a new card, but it also modifies the card's existing config to be upgraded however you want it to be

daring fern
#

No, you would do card:set_ability("newkey")

daring fern
wild escarp
#

I'll have to come back to this in the morning, I'm far too tired for this.

lyric maple
#

i changed my code to be a bit simpler and talisman is still refusing to cooperate

SMODS.Joker {
    key = "tea_green",
    config = { extra = { xmult = 4 } },
    rarity = "kls_lingo",
    atlas = "Jokers",
    blueprint_compat = true,
    pos = { x = 2, y = 3 },
    cost = 7,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.xmult }}
    end,
    calculate = function(self, card, context)
        if context.joker_main and card.area == G.jokers then
            if G.jokers.cards[1] == card then
                return {
                    xmult = { card.ability.extra.xmult }
                }
            end
        end
    end
}
#

it still says attempt to compare number with table

#

i feel like it's the G.jokers.cards[1] == card somehow. not working. but that isn't a very talisman thing

pastel kernel
#

I’m running into a new problem.

normal crest
lyric maple
normal crest
#

Which line is the crash on?

lyric maple
#

let me check

normal crest
#

Oh wait

normal crest
#

without the {} around it

short girder
#

what's the usecase to check if a card is a certain rank?

lyric maple
#

am i just stupid

#

lmaooooooo

normal crest
short girder
#

like i need the if statement

normal crest
#

other_card:get_id() == 7 to check for 7s for example

pastel kernel
daring fern
pastel kernel
short girder
daring fern
normal crest
short girder
daring fern
normal crest
#

you can just ctrl + f for their name

short girder
#

thats what i do lmao

#

though i didn't quite see a joker like that

#

i think 8 ball could've worked idk

pastel kernel
short girder
#

but still many thankses

normal crest
#

scholar or fibonacci is pretty similar

lyric maple
#

how do i make a joker that checks for multiple ranks contained in a hand

lyric maple
#

as in like if hand contains [multiple specific ranks], do [this]

pastel kernel
lyric maple
#

i can't think of any vanilla jokers that do anything similar

pastel kernel
#

Right, the stuff is in busted buffoons now

#

So it’s no longer in a joker’s prefix.

daring fern
lyric maple
normal crest
#

i recommend first thinking when you want your effect to happen

#

that will define which context you use

lyric maple
#

-# oh wait wrong guy

#

no to the above message

normal crest
#

nah that was directed to you

short girder
#

would this bit of text work? i have a local variable named "rank" that changes at end of round and a table with the names of the ranks

lyric maple
short girder
#

im afraid it wouldn't work because of the formatting of the text (the attention color starts at one bit and ends at another)

normal crest
#

tho generally you want to use loc_vars for passing variables to your localized text

short girder
#

ah, i see

#

i was worried because rank would only be mentioned in loc_vars

wild zinc
#

Is it possible to just add eternal to a joker in SMODS.Back?

short girder
#

and here, rank is outside of the quotations

pastel kernel
#

why can't i send "message.txt"

manic rune
#

it can be through calculate or that uhhh function that runs at the start of the run
-# never made decks before so idk

pastel kernel
normal crest
short girder
#

so, do i put it outside or inside loc_vars?

#

the table is outside of smods.joker entirely, so im assuming i should also do so?

#

for the variable, i mean

normal crest
#

it won't update dynamically if you do that

#

you need to return it from the loc_vars function for it to not be a static piece of text

pastel kernel
short girder
#

im assuming this wont work because, once again, the text is not inside quotations

normal crest
# short girder for the variable, i mean

So in your loc_txt you have can have #1#, which corresponds to the first variable returned from loc_vars, like so

return {
  vars = {
    "some text 1", -- #1#
    "some text 2", -- #2#
    -- and so on
  }
}
short girder
#

(i should probably find a way to put it inside quotations)

normal crest
short girder
#

oh, okay!

#

so, i can define rank outside of the table, and all i gotta do is reference it in loc_vars, correct?

normal crest
#

yeah, you can

short girder
#

thanks you! ill test it out

#

this is really important to know cause i deadass thought you could only define thigns in loc_vars inside of the config extra table

short girder
daring fern
normal crest
#

that means your rank variable that you defined is a number, and you're treating it as if it was a table when doing rank[Ranks]

short girder
#

wait did i swap them out

#

lmaoo

#

its normally table[value] right

#

or am i mistaken

daring fern
short girder
#

thanks yall

short girder
#

i keep forgetting the obvious distinction from v and i lmao

sour garden
#

is there a variable to count the number of scoring cards played before they are scored?

stiff locust
#

#G.play.cards

sour garden
#

is that the whole hand or just the scoring cards

stiff locust
#

the whole hand

foggy ginkgo
#

What's the context to detect debuff

stiff locust
#

uhhhh

#

in a card's remove_from_deck you can check if from_debuff and run code when that happens

#

i don't know if that's exactly what you wanted

daring fern
foggy ginkgo
#

The playing cards

daring fern
foggy ginkgo
#

Does that detect if the playing card is debuff or make it debuff

daring fern
lyric maple
#

what's the variable for the round counter? i can't find it in G.GAME.round_resets so idk where it is

#

oh lmao it's just G.GAME.round

lament agate
#

is it possible for a joker to have 2 separate sounds in 1 return?

lament agate
#

heres my code

#
calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            local c = context.other_card
            local is_last_card = c == G.play.cards[#G.play.cards]
            local sound = "tngt_birdthatihate"
            return {
                xmult = 2,
                focus = context.other_card,
                mult_mod = card.ability.extra.mult,
                message = localize{type='variable',key='a_mult',vars={card.ability.extra.mult}} or is_last_card and "T H A T  F U C K I N '  B I R D  T H A T  I  H A T E." or nil,
                sound = sound or is_last_card and "tngt_thatFUCKINbirdthatihate" or "tngt_birdthatihate",
                colour = G.C.RED
            }
        end
    end
}
daring fern
wild zinc
#

I don't know why, if I remove context.individual it says
[SMODS grinrot "src/jokers/voodoo.lua"]:30: attempt to index field 'other_card' (a nil value)

daring fern
#

Don't remove it.

wild zinc
#

But context.individual makes it so that the joker triggers triple_chip_gain on each played card

wild zinc
#

Gains +6 Chips for played 6s, exactly 3 6s gains +36 Chips

#

And currently if I play a Three of a Kind of 6s it adds 108 chips to the joker

lunar silo
#

what does #1# mean?

#

i saw people putting it on descriptions

#

my jokers don't have that and the text doesn't change

#

like i know it's probably the variable thingy

#

but, what exactly, is it?

wild zinc
#

It refers to variables listed in loc_vars

#

(from my understanding at least)

daring fern
lunar silo
stiff locust
#

loc_vars is an area inside of an object

#

it does 2 things

#
  1. send info_queues i'll come back to those
  2. return a vars table
#

any variable in the vars table is sent to joker's descriptions

#

they are referred to using #1#, #2#, #3#, and the number is their index in vars

#

so if i do

return {
vars = {card.ability.mult}
}

for example, the joker's mult value will be sent to #1#

lunar silo
#

i'll check for a mention of loc_vars in the main file

#

nevermind

#

the 'main file' was expurgated

#

now the jokers have individual .lua files

stiff locust
#

the loc vars area also allows you to use info queues

#

you know those little tooltips that show up when you hover over a card that mentiosn another card

like how the chariot tarot has a tooltip teaching you about steel cards

#

yeah that's what that is

#

you can add custom info queues or those of other game objects

stiff locust
#

context.indivdual iterates over every scored card and runs on every card

#

context.before is better here, this happens 1 time before the hand is scored, but after the hand has been played

#

you then have to iterate through the played hand with either G.play.cards (all played cards) or context.scoring_hand (scored cards only) to check the ranks of each card

#

for index, value in ipairs(G.play.cards do
inside this loop, value is the currently checked card, and index is its position

pastel kernel
#

how does number format work

manic rune
#

why this doesnt print at all

daring fern
manic rune
#

it was initially a function yeah

#

i tried with both approaches

#

im pretty sure theres no difference, since

#

works the exact same

quasi comet
#

Is it possible to destroy cards after the hand is denied? (Like when youre playing against the mouth and it debuffs your hand / rejects it)

lament agate
#

how do i hook into the shop pricing

daring fern
lament agate
quasi comet
# daring fern Yes.

I tried a destroy_card context afterwards but it only gets rid of the cards, doesn't destroy them

#

im using context.debuff_hand; but I've tried adding a context.destroy_card as well but it doesn't really recognize it

#

i also tried remove = true after debuff = true but same thing

daring fern
quasi comet
#

i should also mention its within a joker

#

i might just rethink my effect because I wanted to avoid hooking into it ^^;

daring fern
quasi comet
#

just gives me a "function arguments expected near function"

daring fern
quasi comet
#

lemme try

#

i was testing out my other hook

#

i have a hook into debuff_hand from a different card in my mod so I was going to use some parts of it for this effect

#

thank you for the help! there's still a couple quirks i have to fix in the hook (some conditions for the effect) but it works

quasi comet
#

yep

quasi comet
#

fixed

lament agate
daring fern
lament agate
wintry solar
#

What on earth is this hooking method

#

Why are you hooking like this

lament agate
#

-# if it work, it works

daring fern
lament agate
#

yeah it doesnt work thats the problem

wintry solar
#

Then just hook it normally?

lament agate
#

fine

#

hold on

lament agate
#

is anything good

daring fern
#

You don't need to call Card:set_cost manually.

lament agate
stiff quiver
#

whats the base weight of a buffoon pack?

modern schooner
stiff quiver
#

thanks!

modern schooner
#

do someone knows how to create random tags ?

lament agate
#

is this right

daring fern
#

You don't need to call Card:set_cost

#

It's automatically done when a card is created.

lament agate
daring fern
#

Also why are you using rawget?

#

Also each cards unique id would be card.sort_id

lament agate
lament agate
#

take a look

#

i rewritted it

lucid owl
lucid owl
# lament agate

is there literally any reason why this is part of a joker (???)

lament agate
wintry solar
#

Where have you copied this cursed code from