#💻・modding-dev

1 messages · Page 543 of 1

ocean sinew
#

I forgot to set applied_mutation_badges to true

fluid nebula
#

the old snippet from mail-in rebate to reset the card?

ocean sinew
#

now done

cursive gazelle
#

Seu pai is cooking off stage

ocean sinew
#

why it gives this error though 😭

cursive gazelle
#

I see no V

#

Here

ocean sinew
#

I can't

#

wait

#

where?

cursive gazelle
#

No i mean there’s no v here

#

LOL

ocean sinew
#

Exactly 😭

#

how am I supposed to discover the error that way 😭

#
function mutation_set_badges(self,card,badges)
    print('called?')
    local badges_to_create = {}
    local badges_amount = {}
    print("mutations:",card.mutations)
    for i,v in ipairs(card.mutations) do
           local badge = v.center.badge
           if badges_amount[badge] == nil then badges_amount[badge] = 0 end
           if not table.find(badges_to_create, badge) then
            table.insert(badges_to_create, badge)
           end
           badges_amount[badge]=badges_amount[badge]+1
        end
    for i,v in ipairs(badges_to_create) do
        local display_name = v.display_name
        if badges_amount[v] >1 then
            --display_name=display_name.." x"..badges_amount[v]
        end
        --[[local this_badge = create_badge(display_name,v.colour,v.text_colour,v.scale)
        badges[#badges+1] = this_badge]]
    end
end
#

there is v in there

#

but its not being concatenated

cursive gazelle
#

Just check for nil

frosty rampart
#

the error says it's trying to concatenate when v is a function

cursive gazelle
#

The resolution is crazy

ocean sinew
#

I FIXED IT

#

IDK HOW

#

I just assumed it was happening because of back objects and it worked

cursive gazelle
ocean sinew
#

now any deck has the atlas of red deck though

#

Idk whyyy

#

😭

#

someone help meee

#

OH WAIT NVM

#

ITS BECAUSE I AM PLAYING RED DECK

#

😭

cursive gazelle
#

Why

#

What

fluid nebula
#

should i place the code snippet in the loc_vars segment, then?

knotty orchid
#

Has anyone experienced memory leak issues in their mod? I'm really lost man

limber blaze
#

is there a way to vary the weight of a booster pack depending on certain circumstances in the current run

ocean sinew
#

IT WORKED YESSS

#

NOW I GOT MUTATIONS

limber blaze
#

other than like patching a bunch of shit

#

what i mean basically is that is this functionality built in

knotty orchid
#

I don't think so

#

you can implement a custom weight system

limber blaze
#

it is

#

but the documentation doesnt mention it

knotty orchid
#

Oh

limber blaze
red flower
#

i love undocumented features

knotty orchid
#

I implemented it myself as an idiot lol

knotty orchid
#

you're really good at this hAHHAHA

red flower
#

i have experienced memory leaks with jokerdisplay i never fixed

#

so no

knotty orchid
#

Fk

#

I'll try disabling talisman just in case

#

I've been the last 2 days trying to fix this memory leaks problem with no success, im tired 🙁

rocky plaza
#

yo if i have an event with a delay like 4 * G.SPEEDFACTOR
will it be guaranteed to delay for 4 seconds regardless of gamespeed

frosty rampart
#

that sounds right but I dunno if G.SPEEDFACTOR is precisely the correct variable off the top of my head

#

yea it is

ocean sinew
#
local Mutation = SMODS.Center:extend{
    class_prefix="mutation",
    discovered=false,
    unlocked=true,
    set = "Mutations",
    config = {},
    required_params = {
        "key",
        "weight",
    },
    pre_inject_class = function (self)
        G.P_CENTER_POOLS[self.set] = {}
    end,
    inject = function (self)
        if not self.unlocked and self.check_for_unlock then
            if self:check_for_unlock() then
                self.unlocked = true
            end
        end
        SMODS.Center.inject(self)
    end,
    get_obj = function (self,key)
        if key == nil then return nil end
        return self.obj_table[key] or SMODS.Center:get_obj(key)
    end,
}

SMODS.Brainrot.Mutation = Mutation

SMODS.Brainrot.Mutation{
    key="Golden",
    weight=1,
    badge={
        display_name="Golden",
        colour=HEX("d9b831"),
        text_colour=HEX("f3d763"),
        scale=1.2,
    },
    loc_txt = {
        ["default"] = {
            name = "Golden",
            text = {
                "#1#.x joker value's",
            }
        },
    },
    allowed_sets = {
        ["Joker"] = true,
    },
    config = {
        extra = {
            increase=1.5,
        },
    },
    apply = function (self,mutation,card)
        print("mutation:",mutation)
        SMODS.increase_object_value(card,"*",mutation.ability.extra.increase)
    end,
    remove = function (self,mutation,card)
        SMODS.increase_object_value(card,"/",mutation.ability.extra.increase)
    end,
}

#

why that doesnt work

distant junco
#

err odd question but can i dubuff tarot cards with SMODS.debuff_card

faint yacht
#

Should be able to just fine.

azure laurel
#

hey, my boss blind isnt working and idk how?

faint yacht
#

context.during_scoring?

azure laurel
#

my brain wasnt working well

slim ferry
#

There is a list of contexts on the wiki

azure laurel
#

i tried them and still nothing

faint yacht
#

Describe the intended effect.

slim ferry
#

Its because youre checking for other contexts in a check for context.debuff_hand

#

That arent called at the same time as context.debuff_hand

azure laurel
#

still dont work

long sun
#

how do you get the list of all suits in the pool?

primal robin
#

Hey salty ghosh, back to good old avatar? trash

long sun
#

yup :3

red flower
primal robin
#

We are cooking so hard (playing daily sudoku)

azure laurel
olive wren
#

Is there a way that I can debug myself a booster pack

azure laurel
olive wren
#

yeah

azure laurel
#

you have the debugplus mod installed?

olive wren
#

yeah

azure laurel
#

go to a shop, then in the collection hover the booster you want to spawn and press 3

olive wren
#

ok thx

azure laurel
#

np

olive wren
#

How does card rarity weights work

#

Im trying to figure out how common I should make my jokers

wild escarp
#

How can I debuff all cards that meet a certain criteria currently in deck for a joker?

fluid nebula
#

should i put everything from if to end in the loc_vars section of my code?

olive wren
#

How can I get the booster pack to have two card rarities

hushed field
hushed field
olive wren
#

I have two custom rarities

hushed field
olive wren
#

I want both to be able to appear at the same time though

frosty rampart
#

create_card is called for each individual card I think

olive wren
#

But doesnt the park rarity need to be determined before the pack is opened

#

pack

#

bc right now it is only doing the trash cards

frosty rampart
#

by randomly picking one of the two rarities in the create_card function, that random pick is made each time each individual card is created in the pack

olive wren
#

oh ok

#

do you think I could weight that so that the trash cards appear more commonly

frosty rampart
#

yes this is pretty basic programming logic
get a random number from 1 to 4, only spawn a non-trash card if the number = 4. now there's a 25% chance to get a non-trash and a 75% chance to get a trash

olive wren
#

I might be dumb mb

#

thx

wintry solar
#

👨‍🍳

olive wren
#

This is what I did, and it just is not working for some reason

#

Is it bc of me trying to make a variable again

#

It was bc of me trying to make a variable again

#

I hath fixed it

distant junco
#
    add_to_deck = function(self, card, from_debuff)
        SMODS.debuff_card(G.tarot_cards, true, "tarotdebuff")
    end
```ok well this is obviously wrong
crimson marlin
fallow urchin
#

any thoughts on how to create a joker which triggers the joker to the right BEFORE cards are scored (i.e. context.before) . My first thought is to either call the jokers calculate function with a modified context where the it is prematurely set to joker.main, which does 90% of what I want but ends up triggering all jokers to the right. Copying/creating a context to pass to calculate (or SMODS.blueprint_effect) does nothing. I feel like im so close but am missing something

#

i also tried calling calculate with the modified context & immedietly restoring but that also ends up doing nothing)

hushed field
fallow urchin
#

that's intended, i wouldn't want retrigger jokers triggering on an empty card

hushed field
#

Cryptid has this joker implemented and the way it works is truly by just hardcoding what should happen in for every vanilla and modded jokers

fallow urchin
#

BRUH

frosty rampart
#

yes they literally add a new context.forcetrigger and add behavior for that context to every single vanilla and cryptid joker and you have to use context.forcetrigger if you want it to work with your own modded jokers too

fluid nebula
#

need help. happens when i hover over my joker.

fallow urchin
hushed field
#

Something else to keep in mind is that Balatro's jokers, and the entire modded ecosystem because of that, are not built to internally distinguish between separate parts of an effect. Only ever wanting to check joker_main is probably the safest, but you'd also need to be able to communicate that to the player. Otherwise you can run into the issue where there's multiple effects that trigger on the joker. Think of some scaling jokers, for example, where there's a difference between what scales a value up, and what scores the joker

#

I've looked into setting a similar system up and I truly don't think there's a way to do it that's both generically functional while also making sense to players somewhat intuitively

hushed field
wintry solar
#

there are also jokers that will prepare values in other contexts to use in joker main

fluid nebula
wintry solar
fluid nebula
#

i placed it in loc_vars after all else failed

frosty rampart
#

yes, but where do you create valid_ass_cards

wintry solar
#

the first line is where you crash

fluid nebula
#

honestly i am very bad at modding so i apologise

fluid nebula
#

honestly i just copied a lot of vanillaremade's mail-in rebate

wintry solar
#

well firstly, that's a local table so you cannot access it in your loc_vars function

#

secondly, you also need to make sure you run this function when you hover the joker for the first time

fluid nebula
#

oh

#

sorry

fluid nebula
#

going to look for the context that allows it to trigger when the joker is hovered over for the first time, thank you eremel

daring fern
# distant junco bump!

Firstly G.tarot_cards doesn't exist, Secondly, SMODS.debuff_card takes a card, not a card area.

rocky plaza
#

How would one prevent the player from pausing the game for a certain amount of time?

fallow urchin
#

is there a way to modify the likelyhood a given joker spawns with an edition?

quick scarab
#

Still trying to figure this out, do I need to create a class to achieve this?

quick scarab
#

But it doesn't work

#

Hold up

frosty rampart
#

what exactly is your goal here

quick scarab
#

My goal is to "import" a data from another game to be used on the mod

#

Like a High score of the game being used as mult

#

For instance

#

I tried to make it read the file bit Smods doesn't support it

frosty rampart
#

i know there's lua system functions to read the file

daring fern
frosty rampart
#

yea that

quick scarab
#

It isn't a txt file

#

I made a .Lua file where the player would have to put the variables

#

Kinda jank

frosty rampart
#

if you're gonna have the player manually write out the variables, might as well just make it a txt file for them

quick scarab
#

Also wait

#

That's why I didn't do that

#

I don't know if this was implemented yet

frosty rampart
#

i dunno if you're using european or american dates, but yea that was either 2 or 5 months ago. i don't think it's about it being implemented but just understood, the NFS stuff is unrelated to smods entirely

quick scarab
#

Really?

pale rampart
#

help me with this please (idk if you guys need more information to help me)

quick scarab
#

Also 2 months

daring fern
pale rampart
daring fern
pale rampart
quick scarab
#

On the wiki

daring fern
quick scarab
quick scarab
#

The first result is Google AI not providing any source

daring fern
fluid nebula
#

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

cursive gazelle
#

Check for nil

quick scarab
quick scarab
daring fern
stiff locust
#

what would be the easiest way to split a string after a specific symbol shows up

#

like if i wanted it to split on the first _

#

into two strings

frosty rampart
#

string.find([string here], "_") will return the position of the first _ in [string here] (1-indexed)
then string.sub([string here], 1, index) gets the substring from character 1 to character #index (inclusive) and string.sub([string here], index, -1) gets the substring from character #index to the end (inclusive)

so putting it all together:

local index = string.find("example_string", "_")
local string1 = string.sub("example_string", 1, index - 1)
local string2 = string.sub("example_string", index + 1, -1)
pale rampart
frosty rampart
#

that gets string1 = "example" and string2 = "string"

stiff locust
#

the gifs are STILL BLOCKED

pale rampart
daring fern
pale rampart
fluid nebula
pale rampart
daring fern
fallow urchin
#

random but isn't there a shortcut other than holding 'm' which restarts the game?

frosty rampart
#

alt-f5

fallow urchin
#

praise

quick scarab
# daring fern Yes.

local data = {}
    for line in NFS.read("imported/game_data.txt") do
        local key, value = string.match(line, "(.*)=(.*)")
        if key and value then
            data[key] = value
        end
    end
   

SMODS.Joker {
    key = "golden",
    atlas = 'Joker',
    pos = { x = 7, y = 8 },
    soul_pos = { x = 7, y = 9 },

    blueprint_compat = false,
    rarity = 4,
    cost = 20,
    config = { extra = { mult = data.hs or 1 }, },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = { key = "fnaf_WIP", set = "Other" }
        info_queue[#info_queue + 1] = { key = "fnaf_sprite_WIP", set = "Other" }
        return { vars = { card.ability.extra.mult or 1 } }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            local score = card.ability.extra.mult

            if score > 10600 then
                score = 10600
            end

            return {
                mult = score
            }
        end
    end

}

#

Like this them

#

I swear if this doesn't work I might get crazy

#

But I can't check right now

daring fern
stiff locust
#

is there a way to get backslashes in a string without lua complaining about invalid escape sequences

stiff locust
#

2 what

daring fern
stiff locust
#

not next to each other no (i need there to be only 1)

#

well actually hold on

frosty rampart
#

\\ is an escape sequence that sends a single \ through to the actual string

stiff locust
#

when I used SMODS.current_mod_path to get the file path to my mod it used backslashes
but NFS.GetDirectoryItems accepts forward slashes

frosty rampart
#

but yes forward slashes are easier

stiff locust
#

if I use both will it understand to do that

quick scarab
stiff locust
#

I should probably just use the escape sequence so they're all the same type

pale rampart
vast bough
#

how do i check the specific boss blind the player is up against

stiff locust
#

G.GAME.blind.config.blind.key

pale rampart
stiff locust
#

blinds use bl as their object type prefix thingy so it'll be like "bl_manacle" for vanillas

pale rampart
stiff locust
#

final blinds also add final_ after the starting part and don't include the adjective (vedant leaf = bl_final_leaf)

#

mods may or may not respect this

#

at their discretion

vast bough
#

so amber acorn would be final_acorn?

stiff locust
#

bl_final_acorn

vast bough
#

perfect

quick scarab
#

I assume that .path.. is the actual path

#

I just left there because I need to get the file path properly

#

Since I still need to rename the folder

frosty rampart
#

SMODS.current_mod.path is the path to the folder that contains the current mod
.. is the concatenation function, it attaches the second string onto the end of the first
so it expects there to be a file at [mod folder]/imported/game_data.txt

subtle merlin
#

I thought I'd ask here again: how would I forcefully add a card to the scoring hand (no matter the hand's current size) without changing the type of the scoring hand? (in context.before, preferably)

unkempt rover
#

Can someone help me, please?
I want to create a mod that removes the vanilla jokers so that only the jokers from my mod appear.

stiff locust
#

go check SDM_0's modders' deck or pokermon

#

they do that

unkempt rover
frosty rampart
#

it's a config option

stiff locust
vast bough
#

is the orders key j_the_order or j_order

#

(and other joker keys with the)

unkempt rover
jolly shadow
#

does vanilla remade give the original keys? lol

#

huh i guess it does

unkempt rover
#

Thank

red flower
#

i can literally give you the code if you wait until the weekend lol

subtle merlin
manic rune
#

how do i recreate umamusume on balatro

frosty rampart
#

make the horse girls into jokers that randomly pin and unpin themselves and they can only give you their regular joker effects if they're in the leftmost joker slot at the time of calculation

subtle merlin
manic rune
#

idea rn idk

#

the shuffling would kinda represent them racing a bit

subtle merlin
#

Love those ideas, will there be anything like the legacies?

manic rune
#

what if theres a menu for legacies on the new run screen

#

🤔

#

at the end of run maybe you can choose one joker to be taken as a legacy, then its sparks will be randomized and added to a permanent storage

#

on entering a run you can choose 2 legacies which can affect your uma jokers

#

maybe inspiration can happen like, every 4 ante or so idk

subtle merlin
#

Is inspiration randomized in game or is it a set thing? (I couldn't figure it out)

manic rune
#

i think its set

#

so i think every 4 antes is actually a very nice timing

#

enough for 2 inspirations like in game, and just so happen to be when you are going to fight the showdown blind too

#

also i should probably code the jokers' effects in such a way that they can be given to other jokers too, actually

subtle merlin
#

I'd love to see how this mod turns out, your previous works have all been amazing :3

manic rune
#

aw thanks :3

manic rune
#

hmm this changes the poker hand?

subtle merlin
#

...

I didn't know that existed...

manic rune
#

oof

#

oh wait, thats for splash effect, hm

#

idk where ive seen it but ive seen people adding card to G.play with :emplace in context.before before

#

have u tried that 🤔

subtle merlin
#

I will rn

snow breach
#

I'm trying to get localization for custom booster packs to work and it just won't, no matter what I do.

manic rune
#

is that actually where you put booster localization

snow breach
#

In Other? I'm 99% sure

manic rune
#

mm one sec

wild escarp
#

Where are all cards in the deck stored?

manic rune
# snow breach

mm looks correct if your mod prefix is mot, whats wrong?

#

should be correct if the Other is inside descriptions table

snow breach
#

Sure is :\

manic rune
#

is it showing ERROR when you are in a pack

snow breach
#

0 localization is loading

manic rune
#

oh yeah @subtle merlin my idea was close, but the context is too late

#

you ideally want to add the card before this runs

subtle merlin
manic rune
#

can i see your localization file

snow breach
#

I fixed it

manic rune
#

o

subtle merlin
daring fern
#

How would one have multiple music play at the same time?

manic rune
#

hi mini

solid mesa
#

hi i have a question

#

exponentiation its exclusive of talisman?

#

or like i can make my own?

daring fern
snow breach
#

You could. Or you could just become Talisman dependent

solid mesa
#

im doing a pretty unbalanced mod without logic behind

manic rune
#

you can add exponential yourself, but its honestly preferred that you use talisman instead because ^ is very likely to get you above naneinf

manic rune
solid mesa
#

makes sense

#

ty

solid mesa
subtle merlin
manic rune
daring fern
manic rune
#

i thought about just using play_sound but that wont loop

wild escarp
#

I'd like to debuff all spade cards if they have the given enhancement for this joker, but it crashes without an error, can anyone help?

calculate = function(self, card, context)
    if G.playing_cards then
        for k, v in ipairs(G.playing_cards) do
            if SMODS.has_enhancement(v, "m_willatro_overgrown") and v:is_suit("Spades") then
                SMODS.debuff_card(v, true, card)
            else
                SMODS.debuff_card(v, false, card)
            end
        end
    end
end
manic rune
#

source argument in SMODS.debuff_card should be a string, you are using card which is a table

wild escarp
#

Same thing

manic rune
#

whats the code now

daring fern
manic rune
#

gulp

#

no clue, that seems to be how balatro is running music in the background, i kinda assumed you can make two run at the same time somehow with a function semi-identical to that

wild escarp
manic rune
#

so it looks something like SMODS.debuff_card(v, true, "idfk")?

wild escarp
#

Yes

manic rune
#

mm

#

are you absolutely certain thats the cause of the crash

frosty rampart
#

and is it actually the same crash as before

daring fern
wild escarp
wild escarp
manic rune
#

huh

#

somehow theres recursive stuff going on here

#

oh wait

manic rune
#

is it because cards that r getting debuffed run acontext

#

YEAH

subtle merlin
wild escarp
frosty rampart
#

maybe you shouldn't have it in calculate at all. put it in add_to_deck instead?

manic rune
#

that wouldnt account for new cards, though

daring fern
subtle merlin
frosty rampart
#

(talking to bill cipher)

subtle merlin
#

(oh)

manic rune
#
calculate = function(self, card, context)
    if G.playing_cards then
        for k, v in ipairs(G.playing_cards) do
            v.ability.debuff_sources = v.ability.debuff_sources or {}
            if SMODS.has_enhancement(v, "m_willatro_overgrown") and v:is_suit("Spades") and not v.ability.debuff_sources[debuff_key] then
                SMODS.debuff_card(v, true, debuff_key)
            elseif v.ability.debuff_sources[debuff_key] then
                SMODS.debuff_card(v, false, debuff_key)
            end
        end
    end
end
#

oh nvm

#

didnt know you can use context.debuff_card for that too

wild escarp
#

My one downfall in balatro modding is not understanding all the contexts.

manic rune
#

like,

local add_card = G.hand.cards[1]
G.hand:remove_card(add_card)
G.play:emplace(add_card)
subtle merlin
#

sigh that was it, yep

subtle merlin
#

Last question: how can I make the card added to hand score?

manic rune
#

it doesnt score?

frosty rampart
#

it seemed to be scoring just fine in the video with the flipping bug 🤔

manic rune
#

yeah thats what im thinking too

hybrid shadow
#

nvm i prob could word that much better with a bit of help

delicate spear
#

quick question, how does one make a deck with a starting joker?

ornate elbow
#

uuughh.. face in hands, I know this is probably a dumb question. but I am not a smart man and my attempts are getting me nowhere, whats the best way to have a joker add xmult for every queen currently in deck? sort of like steel joker maybe but yk. checking for rank instead of enhancement

daring fern
mystic river
# ornate elbow uuughh.. face in hands, I know this is probably a dumb question. but I am not a ...

I'm on my phone so i don't have access to ide stuff or the names of locations but the basic idea is

update = function(self, card, other parameters idk)
local count = 0
 for i,v in --[[the deck, i think it's G.playing_cards or something]] do
  if v:get_id() == --[[ queen id number, 12 right?]] then
  count = count + 1
 end
end
card.ability.extra.xmult = count * card.ability.extra.xmultpercard
end

and then during the relevant joker calculation step return {xmult = card.ability.extra.xmult}

#

idk if it's the best way, but that's how I'd do it

manic rune
#

i dont think you should use update here

#

use loc_vars for the description, and check how many queens you have in calculate when needed

#

-# and yeah, queen's id is 12

mystic river
#

that sounds better yeah

ornate elbow
#

thanku, ill try it in the morning

#

hushhhg.. I like. vaguely get how to get static normal effects down but anything that has a changeable variable gives me a headache

mystic river
#

oh, also you'd be doing for i, v in ipairs(whatever table is the deck)
i still don't really get why for loops in lua need pairs or ipairs to iterate through tables but there you go

wild berry
#

is this something wrong with the game or just a mod

#

i tried revalidating files but same issue

sand sandal
manic rune
#

tbf i was copying bill's code

sand sandal
manic rune
#

thanks, im already doing that lol

sand sandal
#

i get the linter yelling at me all the time

sand sandal
manic rune
#

??

sand sandal
manic rune
#

oh, this?

sand sandal
manic rune
#

ic

sand sandal
#

idrk

distant junco
#

yo! im trying to debuff tarot cards, and so far this is working. but its only debuffing cards that are held in the consumeable slot, tho thats completely understandable since thats what the code is doing. i was just wondering how i would get tarots to be debuffed in the shop and in packs

sand sandal
#

light mode is the bane of my existence

distant junco
#

literally everyone says this every time leave me alone

#

i like light mode and i dont like dark mode

sand sandal
#

no SMODS lsp_def?

distant junco
sand sandal
#

unfortunate

sand sandal
distant junco
#

joker

distant junco
daring fern
distant junco
#

whats G.I.CARD?

#

is that just like all cards

sand sandal
#

functionally the same i think?

distant junco
#

wel ill try G.I.CARD and see what happens

#

g.i.card causes what i like to call a crash

sand sandal
distant junco
daring fern
daring fern
daring fern
distant junco
sand sandal
sand sandal
#

its indexing a nil field

#

use

if v.ability and v.ability.set and v.ability.set == "Tarot" then
  invoke_skibidi_toilet()
end
#

replace invoke skibidi toilet with whatever you like

distant junco
#

ah ok

sand sandal
distant junco
#

i will be devoking skibidi toilet

sand sandal
#

smods supposed to have autocomplete like that

distant junco
#

oh wow ok no that does not happen, i get some stuff tho

#

weird

sand sandal
#

so i can configure it but you can declare a .luarc.json

#

that has path to your lua library definitions

distant junco
#

yeah i did that

sand sandal
#

but thats beside the point

distant junco
#

hey it works!! thank you both

sand sandal
distant junco
#

those are just words but i think i understand.

sand sandal
distant junco
#

no let me try first

sand sandal
#

so in lua there are only numbers, strings, function, and table (and pointers for ffi)

distant junco
#

ok nevermind i was gonna be way off

sand sandal
#

table can be a function if its metatable has a __call function

#

so when you call a table its actually invoking the __call method

distant junco
#

ok

#

got it

sand sandal
#

is this jerker balanced

royal badger
sand sandal
#

it's attempting to index a field of a nil value

distant junco
sand sandal
distant junco
#

probably

royal badger
sand sandal
#

so

Five_Nights_at_Balatro = { ju_fuju = false }
#

insert that at the first of your mod files and ur good

royal badger
#

thanks :D

sand sandal
royal badger
#

why does this error happen now? local joker_src = NFS.getDirectoryItems(SMODS.currentmod.path .. "jokers" )

faint yacht
#

SMODS.current_mod

royal badger
#

thanks but saw it myself rn xd

delicate spear
sand sandal
#

localthunk is online! hello thunk

spare atlas
#

It's trying to index the number of blinds defeated

red cradle
#

How to count the number of a certain joker among jokers in slots?

faint yacht
#

-# Ortalab's function may not be passing arguments?

faint yacht
#

-# My "Tom Scott" Joker uses that.

red cradle
#

thanks

spare atlas
#

I like to put my mods in a folder i call Mr Bones when they're unstable and buggy

subtle merlin
thorn basin
#

in which vanilla file I can find the "balance" function from the plasma deck?
I need to see it to see how it works and implement something similar for a joker

spare atlas
#

yes i know i already sent this but it's trying to index the number of blinds defeated

stiff locust
#

if i were to do card.ability["extra"] it would go to card.ability.extra right

red flower
#

yes

stiff locust
#

great

rotund sable
spare atlas
#

im not making any mods

thorn basin
red flower
#

i linked to the exact line

thorn basin
#

ah, now i see it, thx

wintry solar
#

you can just return balance = true from a joker to achieve the same effect

wispy falcon
#

How do I check if a specific hand is played? Like a Full House

wintry solar
red flower
wispy falcon
#

Thank you :3

thorn basin
thorn basin
red cradle
#

What is an JimboQuip?

wintry solar
#

download the cardsauce release

faint yacht
#

-# Oh dear-

stiff locust
#

does it become card.ability.extra_value?

wintry solar
#

yup

stiff locust
#

convenient

wintry solar
#

wait

#

no

#

it wouldn't have the _

thorn basin
#

I wanted to give a different message text that the balance function does with plasma deck.
But for some reason it crashes the game, how can I fix this?

stiff locust
#

card.ability.extravalue?

wintry solar
#

no, it'd be card.ability.extra value but you can't reference that so you need to use card.ability['extra value'] afaik

stiff locust
#

oh

wintry solar
#

thats why we dont tend ot use spaces

royal badger
#

how do i get the rounds to make a Joker cooldown?

chrome token
#

is there any way to prevent repetition from happening on a joker at the end of a round? i'm kinda stuck. i'm trying to make one that repeats itself adding +1 mult to the counter "card.ability.extra.rep" times (fyi this is done for comedic purposes, not for anything useful lol) and is supposed to add 1 to card.ability.extra.rep when a round is over... 🥲

red flower
chrome token
#

ah, so like this? if context.end_of_round and context.cardarea == G.jokers and context.main_eval then

#

will try that out

#

hrmm didn't seem to work 🤔

ripe jacinth
spice wadi
spice wadi
#

you cant get impatient when youre missing key info 😭

chrome token
red flower
crisp coral
#

yeah it should be modulo

#

in which, Talisman Moment

thorn basin
chrome token
#

this is gonna become one hell of an if statement lol

modern kindle
#

Hi n

chrome token
red flower
manic rune
red flower
#

that's an smods thing

manic rune
#

🤔

royal badger
modern kindle
#

Hi bepis

manic rune
#

hi dil

manic rune
#

like, having the cooldown tick per round?

#

if so then if context.end_of_round and context.main_eval (i dont remember if this is necessary or not) then in calculate

royal badger
thorn basin
# red flower what's your code

so basically I copied the same functions of the balance effect and changed them to give a different effect, then in the 2nd screenshot there's the text part which... I don't know what's the problem:

spice wadi
red flower
#

also i think you want mod_mult and mod_chips or it's not going to work properly in the next smods update

thorn basin
red flower
#

no

#

look at the original code i sent

thorn basin
#

oooh I see

thorn basin
#

cuz rn it gives the message like a normal joker does

manic rune
#

thats why i said you gotta use attention_text..............

thorn basin
#

oh, right

#

my bad

red flower
#

i think

#

nope

#

i was looking at the wrong code lol

#

it's what bepis said

#

attention_text({scale = 1.4, text = "Relativity!", hold = 2, align = 'cm', offset = {x = 0,y = -2.7},major = G.play})

knotty orchid
#

Is Xchips implemented in the new smods version? Or should I implement it myself? I'm tired of talisman so I'm not using it

red flower
#

it is

knotty orchid
#

and emult?

red flower
#

no

knotty orchid
#

Sad

#

Anyways It's still not a release right?

red flower
#

emult doesnt make much sense without bignum tbh

red flower
knotty orchid
knotty orchid
manic rune
#

you can implement your own emult if you really want to use it without talisman

red flower
knotty orchid
#

Nice

knotty orchid
#

for just one card

manic rune
#

shouldnt be too hard, since its just one patch/hook to SMODS.calculate_individual_effect

red flower
knotty orchid
red flower
#

xchips

manic rune
#

xchips

#

x_chips

faint yacht
#

key == 'x_chips' or key == 'xchips' or key == 'Xchip_mod' are checked for.

manic rune
#

why is it Xchip_mod actually

manic rune
#

why isnt it xchips_mod....

knotty orchid
#

hahahaa

manic rune
#

and like, Xchip doesnt even exist, so??

red flower
#

half the keys on my kyboard re not working i hate this..

manic rune
#

😭

#

rip

faint yacht
#

Probably just like Xmult_mod.

knotty orchid
#

they trigger more than one time sometimes

manic rune
#

yeah true, but im p sure Xmult is actually a thing

knotty orchid
#

is so annoying

red flower
manic rune
#

and singular chips is also, weird

thorn basin
faint yacht
#

I did have to grab all of such chip/mult keys a while ago for ActiveSync.

togabalatro.chipmultopswap = {
    ['chips'] = 'mult',
    ['h_chips'] = 'h_mult',
    ['chip_mod'] = 'mult_mod',
    ['mult'] = 'chips',
    ['h_mult'] = 'h_chips',
    ['mult_mod'] = 'chip_mod',
    ['x_chips'] = 'x_mult',
    ['xchips'] = 'xmult',
    ['Xchip_mod'] = 'Xmult_mod',
    ['x_mult'] = 'x_chips',
    ['xmult'] = 'xchips',
    ['Xmult'] = 'xchips',
    ['x_mult_mod'] = 'Xchip_mod',
    ['Xmult_mod'] = 'Xchip_mod',
...
red flower
knotty orchid
#

@red flower My memory leak problem was related to talisman. That's the reason I'm uninstalling it ahhahaha

#

Just in case anyone run in to this

#

Uninstalled talisman and had stable fps

red flower
ripe jacinth
#

i fixed it...

#

well, someone else did

#

thank you @rocky plaza

thorn basin
red flower
#

value

thorn basin
#

alright

#

now it works!
thank you!
small another question: is there a context that makes the scripts of a joker trigger right after all the jokers give mult, chips or Xmult?
like after context.joker_main but not after the game does the Chips x Mult calculation

manic rune
#

context.final_scoring_step?

hushed field
#

oh hey, I think the counter UI also gets drawn on the back of cards, that ain't great

thorn basin
knotty orchid
#

local old_calculate_individual_effect = SMODS.calculate_individual_effect
SMODS.calculate_individual_effect = function(effect, scored_card, key, amount, from_edition)
    local res = old_calculate_individual_effect(effect, scored_card, key, amount, from_edition)

    if key == "Emult" and amount then
        if effect.card and effect.card ~= scored_card then juice_card(effect.card) end
        mult = mod_mult(mult ^ amount)

        update_hand_text({ delay = 0 }, { chips = hand_chips, mult = mult })

        if not effect.remove_default_message then
            if key ~= 'Emult_mod' then
                if effect.emult_message then
                    card_eval_status_text(
                        effect.message_card or effect.juice_card or scored_card or effect.card or effect.focus,
                        'extra',
                        nil, percent, nil, effect.emult_message)
                else
                    card_eval_status_text(
                        effect.message_card or effect.juice_card or scored_card or effect.card or effect.focus,
                        'emult',
                        amount, percent)
                end
            end
        end
        return true
    end

    return res
end

I think I'm missing something. I'm trying to implement my own Emult

#

Doesn't really work right now

royal badger
#

why does this not show the description and name In game?

    descriptions = {
        Joker = {
            j_fnab_NightDelight = {
                name = "Nightmares Delight",
                text = {
                    {
                        "test"
                    }
                },
            },
        },
    },
    misc = {
        dictionary = {
            
        }
    }
}```
rugged void
#

should work

royal badger
rugged void
#

but the name is being displayed?

#

how do I access the score the current hand will give before its added to the total chips and which context would be used? using context.final_scoring_step and context.cardarea = G.jokers is too early

daring fern
knotty orchid
#

no success tbh

thorn basin
rugged void
rugged void
#

oh

#

of course

#

thank you ^^

royal badger
rugged void
royal badger
rugged void
frosty rampart
#

if you're not using english in-game the en-us localization won't show up

#

<@&1133519078540185692>

wispy falcon
#

<@&1133519078540185692>

karmic creek
#

mods

red flower
#

at mods

frosty rampart
#

thank you mods :3

karmic creek
#

thank you reporters :3

wispy falcon
#

Thank you mods :D

royal badger
daring fern
knotty orchid
#

right now

#

Works

#

hahaha

wintry solar
manic rune
#

3: i see

knotty orchid
#

Good bye talisman

#

never meeting you again

crystal perch
#

anybody know why my joker is hard crashing my game?
this is meant to copy the ability of the rightmst Joker if you have a spade held in hand, this used to work but i believe it broke after i updated SMODS

#

I don't even get a crash log or anything it just closes the game

red flower
#

idk if its the problem but the rightmost joker is G.jokers.cards[#G.jokers.cards]

crystal perch
#

still crashes

#

maybe it's a mod conflict i'll try disabling some

wintry solar
#

calling :is_suit outside of a context check I think

#

it'll crash with quantum enhancements

crystal perch
#

is that because of calling it outside of a context check?

#

not really familar with how quantum enhancements work

wintry solar
#

yes, card:is_suit does a quantum enhancement calculation check, so you just infinitely loop and stack overflow

stiff locust
#

is there a documentation on the NFS.getdirectoryitems type stuff

wintry solar
#

I believe you can wrap the entire thing in

if not context.check_enhancement then
  -- code here
end```
crystal perch
#

i'll try that thank you eremel

red flower
stiff locust
#

oh is it just the love.filesystem stuff

red flower
#

yes

#

i think

stiff locust
#

awesome

#

i'm going on a filesystem arc right now

#

this will be very useful

random sleet
#

chat

#

jokers

#

philosophical decksleeve with stacked is a totally different game

crystal perch
#

how come this code doesnt work:

calculate = function(self, card, context)
  local other_joker = nil
  for i = 1, #G.jokers.cards do
    if G.jokers.cards[i] == card then
      other_joker = G.jokers.cards[i - 1]
    end
  end
  return SMODS.blueprint_effect(card, other_joker, context)
end

yet this code does:

#
calculate = function(self, card, context)
  local other_joker = nil
  for i = 1, #G.jokers.cards do
    if G.jokers.cards[i] == card then
      other_joker = G.jokers.cards[i + 1]
    end
  end
  return SMODS.blueprint_effect(card, other_joker, context)
end
#

the difference is just G.jokers.cards[i - 1] or G.jokers.cards[i + 1]

random sleet
#

neither of them should work because G.jokers.card doesn't exist

crystal perch
#

i misspelled

#

meant G.jokers.cards, which is what i have

frosty rampart
#

elaborate on "doesn't work"
also make sure you didn't also make the typo in your actual code

crystal perch
#

there's no typo in my actual code

#

what i mean by "doesn't work" is that it simply just doesn't copy the left joker

#

i'm basically just making blueprint to the left

#

blueprint uses G.jokers.cards[i + 1], this uses G.jokers.cards[i - 1], and changing the code to be G.jokers.cards[i + 1] makes it copy the joker to the right, but G.jokers.cards[i - 1] makes it copy nothing rather than the joker to the left

#

okay now i look insane because i'm going back and testing it again and it works

hushed field
#

@frosty rampart Yeah, seeing this, I'm wondering if a lot of the stuff isn't hardcoded to the Sprite object in a way that would potentially need some refactoring for our hopeful implementation, haha

frosty rampart
#

i've gotta dig into how shaders work some more, but my hope is that "texture_details" and "image_details" can handle a love2D "Quad", which is a surface you can draw a canvas to. i know how to get the UI to draw to the canvas and the canvas onto the quad, the missing piece is just getting the quad into the shader

#

or that the shader can take some alternate way to pass an image into it

hushed field
#

I'm consistently surprised to learn that Love2D as an engine is a lot more barebones than I assumed, haha

frosty rampart
hushed field
#

I think I'm just gonna crash the game on purpose a few times and see if I can trace down what things would be missing, and find a new place to dig from there

unkempt thicket
frosty rampart
#

we're trying to shove UI into a shader

hushed field
#

@frosty rampart I'm wondering if it's not possible to just port the draw_shader function to UIBox with only minimal changes, honestly

unkempt thicket
hushed field
#

I'm trying to see if they have any very relevant ways in which they differ but I think most of the stuff should work out

frosty rampart
frosty rampart
hushed field
unkempt thicket
#

What about layering?

hushed field
#

But the manipulation and movement of cards is largely done by the dissolve shader, so the actual number on the counter is totally immune to those changes, which looks less than ideal

hushed field
random sleet
#

chat i might have just cooked a devious plan to print infinite content

unkempt thicket
random sleet
#

i cant wait for trance to absolutely destroy the counter ui btw

hybrid shadow
#

if i do if context.pseudorandom_result then without checking for either result type will that if statement run any time a probability gets rolled

frosty rampart
hushed field
#

I'm just gonna try and port the function to UIBox and see what crashes that will create, haha. I don't think the shader needs anything to inherently be a sprite

random sleet
#

build your own jokers

hushed field
#

or UIElement, I guess, not UIBox

random sleet
#

goddammit why did it scale itself

knotty orchid
#
                        local _card = SMODS.create_card(create_args)
                        _card:add_to_deck()
                        _card.can_sell_card = function(self, context)
                            return false
                        end

                        _card.calculate_joker = function(self, context)
                            if context.end_of_round then
                                self:start_dissolve({ HEX("57ecab") }, nil, 1.6)
                                self:remove_from_deck()
                            end
                        end
                        _card.can_calculate = function()
                            return true
                        end

                        G.jokers:emplace(_card)

Any reason this sets my jokers limit to -27 after a blind where is debuffed? xd

hushed field
knotty orchid
# hushed field is this a joker?
    calculate = function(self, card, context)
        if context.setting_blind then
            G.E_MANAGER:add_event(Event({
                trigger = 'immediate',
                func = function()
                    G.GAME.joker_buffer = 0

                    for _ = 1, card.ability.extra.copies_number do
                        local create_args = {
                            set = 'Joker',
                            key = 'j_ina_Hattori',
                            edition = 'e_negative'
                        }
                        local _card = SMODS.create_card(create_args)
                        _card:add_to_deck()
                        _card.can_sell_card = function(self, context)
                            return false
                        end

                        _card.calculate_joker = function(self, context)
                            if context.end_of_round then
                                self:start_dissolve({ HEX("57ecab") }, nil, 1.6)
                                self:remove_from_deck()
                            end
                        end
                        _card.can_calculate = function()
                            return true
                        end

                        G.jokers:emplace(_card)
                    end
                    return true
                end
            }))
        end
    end,

It's a card that gets created from a joker and after the blind destroys

hushed field
#

What did you base this code on? I don't know why you'd wanna override of a card

knotty orchid
#

Because if I don't do this the card doesn't destroy on a blind if it is debuffed

hushed field
#

What object is this calcualte for?

knotty orchid
#

when I say card I mean joker

#

sorry

#

it's a joker that creates 2 basic negative copies of himself

hushed field
knotty orchid
#

I mean this works pretty well, I've used it other times with no problem

#

this is the only joker that seems to have some kind of problem

random sleet
#

um

frosty rampart
#

not encountering a problem doesn't mean it's not problematic design

random sleet
#

so like why don't you just set those things in the joker that you're making tho

#

like in the Hattori joker

hushed field
#

You also shouldn't be overwriting can_calculate, as that will definitely cause fundamental issues with other jokers, like dagger

knotty orchid
#

This is the hattori joker

hushed field
#

The simplest thing would be to hook can_calculate, not overwrite it, and just set a parameter that allows a card to still trigger if it's debuffed

#

Alternatively, you can patch in an additional context after setting_blind that includes ignore_debuff as parameter, and check for that

random sleet
#

i think i dont have the mental capacity to explain everything wrong with this approach

#

or even actually understand it myself

#

pog

#

i got the scaling effect fixed

hushed field
#

But I really recommend not usign this approach because it will create a very large number of edge cases that will create strange behaviour, and you'll not really be able to get coding help with such an unconventional approach, because it does take a while longer to parse and understand what's happening and what could be going wrong

hybrid shadow
#

i forgot lucky cards roll twice lmfao

random sleet
knotty orchid
#

I'll try to reestructurate everything with hooks

random sleet
#

boy i wonder if keywordifying scaling effects in this manner might have a payoff

hushed field
#

I'd definitely trust N over me, that's for sure, haha

knotty orchid
#

I mean this copies just have one purpose

#

to be destroyed

hushed field
#

But it does make assessing what's happening a bit more difficult. In this case, I think you're overcomplicating it by overwriting functions, at least

knotty orchid
#

yeah yeah I totally agree

hushed field
#

I'd just create ajoker object for these objects, still, just so you can have more control over it. The way I'd do it is a can_calculate hook from there and just check if the joker has a 'always_ignore_debuff' quality that you set on it, or something like that

random sleet
#

oh shit this is dev chat sorry for being spammy

wintry solar
#

I don’t think overwriting those functions for what is effectively a temporary joker is that bad, though it depends on when they’re created

hushed field
#

In checking calculate_joker I did realize that I was confused for a moment over where things like calculate_seal are called from, haha

knotty orchid
#

They get created when setting blind

#

and destroyed at the end of the round

#

I really don't get why the -27 jokers size

wintry solar
#

Can you screenshot the full code for the joker it’s creating?

knotty orchid
#

You mean this?

hushed field
#

But can_calculate is used in enough timing frames that I think it can definitely create very odd behaviour, no? Though maybe I'm still in the old mindset of Victim's can_calculate which also checked for destruction target effects and such

wintry solar
#

I don’t think it needs the can calculate override, you’re right there

knotty orchid
#

I'm really sorry for this mess lol

hushed field
# knotty orchid You mean this?

Oh, I think it'd be because end of round triggers for each card, and the event queue probably causes timing issues that makes the remove from deck effect remove a slot for every triggered instance

wintry solar
#

Oh it’s -

#

Yeah just add and context.main_eval to your calculate override

knotty orchid
#

I'll try

#

give me a sec

#

IT WORKS

#

man I was going mad

hushed field
#

Oh btw, Eremel, just because I came across it today, but is the ignore_debuff context parameter just there in case people want to use it for a custom context, or is it used in any of the standard smods contexts?

knotty orchid
hushed field
#

I do still advise you to just add a flag to the joker and hook can_calculate to check that flag, just because that means you can use it for other things as well, haha.

knotty orchid
#

I know, I'll try to do that

#

But this quick patch is enough for people not to spam me about the bug anymore

#

xddd

hushed field
#

I think in this case, your joker being Debuffed but gaining an edition would still make the edition triggered? Though my pitch doesn't resolve that either, I guess, hahaha

#

Can you link the mod btw? I'm interested now but I don't think I've seen you around talking about it before, haha

bleak crane
#
SMODS.Joker{
    key = 'phantom',
    loc_txt = {
        name = 'Phantom Joker',
        text = {
            "This joker gains {X:mult,C:white}X0.5{}",
            "for each used {C:spectral}Spectral{} Card",
            "{C:inactive}(Currently {X:mult,C:white}X#2#{}{C:inactive} Mult{})",
            "{C:inactive}(Concept by {}Destro{C:inactive}){}"
        }
    },
    config = {extra = { xmult = 0.5, xmult_mod = 0.5 }},
    rarity = 3,
    atlas = 'kamisjokers',
    pos = { x = 4, y = 2 },
    cost = 6,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.xmult, card.ability.extra.xmult_mod + (card.ability.extra.xmult_mod * (G.GAME.consumeable_usage_total and G.GAME.consumeable_usage_total.spectral or 1)) } }
    end,
    calculate = function(self, card, context)
        if context.using_consumeable and not context.blueprint and context.consumeable.ability.set == "Spectral" then
            return {
                message = localize { type = 'variable', key = 'a_xmult', vars = { G.GAME.consumeable_usage_total.xmult_mod } },
            }
        end
        
        if context.joker_main then
            return {
                xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
            }
        end
    end,

}

any idea why this might be crashing?

knotty orchid
#

It's an Inazuma eleven mod mainly for the spanish community

hushed field
#

I don't read anyway, no worries

knotty orchid
#

Balatro players don't read

hushed field
#

Oh man that triggered some really niche nostalgia not for the show but for the DS game, I think, hahaha

wintry solar
knotty orchid
#

Can I send the link here?

#

I don't think so right?

hushed field
#

Yeah, as long as your not hosting it on some 18+ site or anything called '$50 steam gift card', haha

hushed field
modern kindle
hushed field
knotty orchid
#

Really funny story

cursive gazelle
#

so what did the new smods update

wintry solar
#

Wdym, there’s no new smods

ocean sinew
#
function SMODS:save_run_state()
save_run()
return STR_PACK(G.culled_table)
end

function SMODS:load_run_state(saved_state, cb)
    G.E_MANAGER:add_event(
        Event({
            trigger = "after",
            delay = G.SETTINGS.GAMESPEED,
            func = function()
                G:delete_run()
                G:start_run({
                    savetext = saved_state,
                })
                cb()
                return true
            end,
        }),
        "other"
    )
end
#

why this happen with my function?

cursive gazelle
hushed field
#

@frosty rampart porting the draw shader functionality is definitely possible but I doubt it's the most efficient way, because it cascades down to other functions you'd need to port, haha. There's probably another way that would be less janky

wintry solar
cursive gazelle
#

yeah

wintry solar
#

wait for the release to be told what's changed or read the code/commits yourself

#

or be in my super secret modding chat

knotty orchid
#

Is there any seed analyzer for modded balatro?

frosty rampart
cursive gazelle
hushed field
frosty rampart
hushed field
#

I think the problem and solution are probably entirely in the Balatro code, but GLSL is cool knowledge to have regardless. Be prepared for people begging you for info once you let on that you know how to make shaders, though, hahaha

frosty rampart
#

I'm rooting through the shader side because I'm trying to understand how sprites format their image data when it goes to the shader, and the UI canvas is gonna need to be in the same format
but yea, it's gonna be great to understand shader stuff. might put together some sort of tutorial/template/documentation depending on what's possible

hushed field
#

@spice wadi it was ambient noise of my switch controllers clacking about and a cat standing on my phone, hahaha

spice wadi
#

Nothing picked up I'm pretty sure

red flower
#

too late i pinpointed your location from the background noise

hidden notch
#

I would also love to know.... 5 months later :D

red flower
#

yes

#

just use G.deck as the object

#

or G.deck.cards[#G.deck.cards]

hidden notch
#

Ah, well could've figured that out lewxen_Teary_Laugh AE_SnowpixFacepalm

#

Thank'cha ^^

ocean sinew
#

how to stop cards from colliding?

knotty orchid
#
    add_to_deck = function(self, card, from_debuff)
        G.GAME.current_round.free_rerolls = G.GAME.current_round.free_rerolls + 1
        calculate_reroll_cost(true)
    end,

Doesn't this give a free reroll?

#

each shop I mean

wintry solar
#

just do SMODS.change_free_rerolls(1)

#

and -1 in remove obv

cursive gazelle
knotty orchid
#

You have a function for everything emerel

#

thanks

ocean sinew
wintry solar
#

yes

#

I do

ocean sinew
#

I have this joker

#

I'm using the card object with the sprite for it to work and a custom update function

#

but If there's like 2 coins going to the same direction

#

they dont move at all

#

they just stay there

cursive gazelle
#

oh its like the yahimod joker

ocean sinew
#

wait theres a joker like this already?

cursive gazelle
#

yes

#

in yahimod

modern kindle
#

if theres a joker concept chances are it already was made

cursive gazelle
#

and is actually an ultrakill based aswell

primal robin
#

s

short girder
chrome token
#

is it possible at all to see what seal a card has when it's being played?? i'm trying to rack my head here by trying out all sorts of ways and i have no idea... i'm writing this for a seal in question where if it stays in hand it would copy whatever seals are available per card 🥲

red flower
#

that looks correct

chrome token
#

if it is, then that's super weird since i checked to see if it works via sendInfoMessage and i get nothing 🥲

wintry solar
#

this is on the seal?

chrome token
#

yeah it is

red flower
#

ah

chrome token
#

the intended behaviour is that, if it's not played, it should copy every seal by the cards played

#

at least that's what i'm trying to do 🤔

wispy falcon
#

How do i add a button to a joker? I know how to do it in the mod's config but it's different for jokers, right?

ocean sinew
# wispy falcon How do i add a button to a joker? I know how to do it in the mod's config but it...
local last_use_and_sell_buttons = G.UIDEF.use_and_sell_buttons
G.UIDEF.use_and_sell_buttons = function(card)
    local t = last_use_and_sell_buttons(card)
    local custom_buttons = card.config.center.config.custom_buttons or {}
    local function create_custom_button(b_t)
      local button_text = b_t.text
      local width = b_t.w or 0.05
      local h = b_t.h or 0.3
      if localize(button_text) ~= "ERROR" then button_text=localize(b_t.text) end
      local custom_button = {n=G.UIT.C, config={align = "cr"}, nodes={
      {n=G.UIT.C, config={ref_table = {this_card=card,id=b_t.id,}, align = "cr",maxw = 1.25, padding = 0.1, r=0.2, minw = 1.25, minh = (card.area and card.area.config.type == 'joker') and 0 or 1, hover = true, shadow = true, colour = b_t.colour or G.C.WHITE, one_press = false, button = 'custom_button'}, nodes={
        {n=G.UIT.B, config = {w=width,h=h}},
        {n=G.UIT.T, config={text = button_text,colour = b_t.text_colour or G.C.BLACK, scale = b_t.text_scale or 0.55, shadow = true}}
      }}
    }}
    return custom_button
    end
    if card.area ~= G.pack_cards then
    for i,v in ipairs(custom_buttons) do
        local active = v.active
        if type(active) == "function" then active = active(card, v) end
        if active == nil then active = true end
        if active then
        local this_button = create_custom_button(v)
        local spacing = {n=G.UIT.R, config={align = 'cl'},nodes={this_button},}
        table.insert(t.nodes[1].nodes, spacing)
        end
    end
    end
    
    return t
end

take a look at this code for example

wispy falcon
#

Okay, thank you

ocean sinew
#

button is the function that gets called when its clicked

wispy falcon
#

I take it that b_t is the custom_button's key?

chrome token
chrome token
# candid elbow What are you looking to do

i'm trying to make a seal that copies every other seal's value in each played card in a hand
so if example if you played a Blue Seal, it would copy however many chips the Blue Seal would add to the coutner

candid elbow
#

Uhhh

#

I don’t understand

#

Lol

chrome token
#

maybe i'm bad at explaining lmaoo
say you had the seal in your hand-- if you choose to play a card that has a Blue Seal on it, the seal would copy that Blue Seal before letting the actual Blue Seal do it's thing

#

ultimately resulting in more chips

candid elbow
#

Blue seal doesn’t give chips 😭

chrome token
#

wait it doesn't?? am i stupid

candid elbow
#

Blue seal creates a planet card on last hand played

#

😭what are you on about

chrome token
#

...
...curse you my brain 🥲

#

i sound like a maniac rn when a better example would've been a Gold Seal or something 😭

wispy falcon
candid elbow
#

You sound like a clanker

ocean sinew
# wispy falcon Wait, where would I put this to test it?

anywhere then u would do config = {
custom_buttons = {
{
id = "wheat_collect",
text = "Collect",
text_colour = G.C.YELLOW,
colour = G.C.BLACK,
},
},
(On the joker you wanted to add the button to)
but remember that If you gonna use the code I sent you you'll need to define the custom_button function
Here's how I defined mine:

G.FUNCS.custom_button = function(e)
    local this_card = e.config.ref_table.this_card
    if this_card.highlighted then
    local button_id = e.config.ref_table.id
    SMODS.calculate_context{
        card = this_card,
        custom_button_pressed = true,
        button_id = button_id,
    }
    end
end
chrome token
wispy falcon
ocean sinew
#

like this for example

wispy falcon
#

And where do I add the G.FUNCS.custom_button thing?

ocean sinew
#

you just do

G.FUNCS.custom_button = function(e)
    local this_card = e.config.ref_table.this_card
    if this_card.highlighted then
    local button_id = e.config.ref_table.id
    SMODS.calculate_context{
        card = this_card,
        custom_button_pressed = true,
        button_id = button_id,
    }
    end
end
#

ngl can we actually get this added to SMODS

wispy falcon
ocean sinew
#

I'mma try a pull request and hope they accept

wispy falcon
crystal perch
#

trying to make a joker which blueprints the left joker and debuffs the right joker, which currently works but the problem is the right joker is not getting un-debuffed when two-faced is moved. how would i implement a way for it to remember which joker it debuffed so it could undebuff them

ocean sinew
#

not inside joker calculate

#

or joker

#

and then to create the button you put

custom_buttons = {

{
id="<button_id>",
text="<button_text>",
text_colour=G.C.WHITE,(your text colour here)
colour=G.C.BLACK(same as above)
}

}

inside the joker config

crystal perch
ocean sinew
#

then to check when the button gets pressed you can do

if context.custom_button_pressed and context.button_id == "<button_id>" and context.card == card
wispy falcon
ocean sinew
#

the id should actually be your button id

#

and the text too

#

custom_buttons is in the wrong position too

#

It's inside config

#

but the rest is right

wispy falcon
ocean sinew
#
SMODS.Joker{
config={
custom_buttons={
{
id="button_id",
text="Button Text",
text_colour = G.C.WHITE,
colour = G.C.BLACK,
},

},

}

}
#

like this for example

#

the custom_buttons table goes inside config as you can see

#

then you define a new table inside custom_buttons for each button

wispy falcon
#

But I have it there, do I not?

ocean sinew
#

yep but It's outside config

#

it should be inside config

#

config = { extra = { },

#

this is how your config looks like

#

wait no

#

SORRY

#

you're right lmao

#

😭

#

I didn't notice

#

it is inside config

#

mb

#

tht was my fault

#

I didn't pay attention

#

should work

#

test it

wispy falcon
#

Yeah, now it works. Thank you so much :D

ocean sinew
#

np

subtle merlin
crystal perch
daring fern
wind steppe
#

where would i hook (or patch) to disable xmult scoring under a specific condition?

mossy quest
#

does smods have a table of all the loaded jokers?

frosty rampart
#

probably just SMODS.Jokers i think

mossy quest
#

thanks

#

banishing all mods that use discovered = true

    SMODS.Joker:take_ownership( v ,
        { -- table of properties to change from the existing object
        discovered = false
        },
        true -- silent | suppresses mod badge
    )
end```
frosty rampart
#

it makes every joker in the game (including modded ones) undiscovered by default (not locked, but it won't display in the collection and it'll say "Not Discovered!" when it shows up in the shop until you buy it for the first time)

broken rivet
#

why

#

though

#

like i know what it does

mossy quest
#

I want to

#

I want to find them naturally, it also lets me see what jokers I've actually played with

broken rivet
#

ah

azure laurel
#

hew, how can i change the main menu stuff like the logo or the card in the middle?

mossy quest
willow scroll
#

if i want to localize the name of a enhancement for joker display, id do localize { type = 'name', set = 'Enhanced', key = 'm_stone' }, right? this somehow gives me a talisman attempt to compare table with number crash 💀

daring fern
willow scroll
#

i may be smart :clueless:

#

thank you

#

hooray

frosty rampart
#

can someone explain what the purpose of joker_retriggers.toml in smods is exactly

red flower
#

(retriggers require the joker to return something iirc)

frosty rampart
#

i see
it's messing with ready to fly in paperback because faceless joker is a little jank, but since the return is important we might just have to take ownership of faceless joker to rewrite its calculate lmao
(ready to fly scales whenever an adjacent joker triggers; context.discard is one of the contexts where we have to check for if the joker is returning a message because yorick counts as "triggering" every time he tracks a discard, not just when he scales. but faceless joker uses ease_dollars and card_eval_status_text instead of just returning dollars like a sane modded joker would)

brittle tide
#

my game keeps crashing whenever I select a card and I'm not sure if its because of my mod

#

has anyone had this problem before

thick drift
#

well what's the crash error message?

brittle tide
#

there isnt one

#

just closes

solid mesa
#

what mods do you have

brittle tide
#

my mod was working fine like just a bit ago so idk what happened

thick drift
#

I honestly don't know what kind of error could accomplish that, I'll assume you've tried selecting other cards as well

hybrid shadow
#

why are you using dev talisman

#

oh wait this is for dev nvm

#

anyway

brittle tide
#

wait

#

I downloaded the most recent talisman version and it fixed it?? 😭

#

I was using this exact same version 15 minutes ago so I have no clue why it just stopped working

brittle tide
hybrid shadow
#

np

#

ig

#

i was just curious why you were using dev talisman

#

but figured it was bc you were using a feature of dev talisman

brittle tide
#

idk I dont remember why I downloaded it

solid mesa
#

your mod works without talisman?

brittle tide
#

no it requires it

solid mesa
#

xd

brittle tide
#

I use Xchips and emult for a few jokers