#💻・modding-dev

1 messages · Page 615 of 1

bleak shore
#

and the red things was because it was alone under the calculate thing

maiden phoenix
#

Ah ok

hallow slate
#

How would I check what the best possible poker hand is with a group of cards

daring fern
civic solstice
#

i may be stupid

#

i accidentally put the jokerforge scripts into the main mod so now i gotta recode negative deck

#

🧠
🗑️

civic solstice
#

wtf does this mean

solid salmon
#

is there a way to give a card multiple descriptions

civic solstice
#

not from what ik

solid salmon
#

Like

#

If i wanted to make multiple descriptions based of context

#

(Kinda like sleeves alternate description)

red flower
solid salmon
#

No i get the alt desc

#

But like how do i trigger it?

red flower
#

trigger what

#

the description is calculated when you hover the card

solid salmon
#

I gotta be more specific

#

So lets say theres a thing called miracle rank

#

So when its rank is 2 or above it adds xmult to lucky cards

red flower
#

So you want the lucky card description to update when the card has a certain rank?

solid salmon
#

Kinda like that

red flower
#

In that case you would need to take ownership of lucky cards or hook/patch one of the functions that generates the UI depending on what you want it to look like

red flower
solid salmon
#

K

vale grove
#

Ive seen it mentioned before but i forgot to take notes
how do you fix the error message again?

umbral spire
#

what is next() even do

#

like next(SMODS.find_card('j_vremade_four_fingers'))

slim ferry
#

it returns the next value in a table from the index in the second argument, or the initial value if there is no second argument

civic solstice
#

that's a sick idea but how do you even make that

vale grove
#

the ping effect?

civic solstice
#

yea

vale grove
#

oh you dont actually get pinged

#

it just makes the exact same noise

civic solstice
#

ah

vale grove
#

ive fooled a play tester of mine twice lmao

#

(and myself)

#

its insane how gullible discord users are when they a discord notif sound with the correct pitch and speed

civic solstice
#

budomp

vale grove
#

the effect is still place holder bcs idk what itll do

#

but this isnt really about the discord seal lmao

#

i want to replace the error text when you hover over any of my seals/consumables

willow scroll
#

@wintry solar is the calc fix on dev branch? I could check if my stuff works now but I don't have too much time today

umbral spire
#

how do i change straight/flush requirement?

red flower
umbral spire
red flower
umbral spire
red flower
umbral spire
vale grove
#

i could very well be wrong

red flower
umbral spire
#

ah

red flower
#

you would only change the key in find_card and the returned number

umbral spire
red flower
#

yeah

vale grove
#

would everything just be a straight flush?

#

(except for flush house and such)

umbral spire
#

im not sure

vale grove
#

well ive been passively learning lua in my journey of a fun mod for my friends

#

and i think logically speaking it makes sense

#

because the way the game looks for a straight and flush is seperate

#

so im assuming it would see the 1 card as a straight and a flush

slim ferry
#

so you would still need 2 for strush

vale grove
#

strush lol

#

i like that word

slim ferry
#

it does make anything a flush tho

vale grove
#

how do i make it print out the count

#

because i know this is probably hurting whoever is reading this code

#

as much pain

#

as it is giving me

#

but i tried somethings and nothing seems to actually print out the count

red flower
#

if you have debugplus print(count) should print to the screen

umbral spire
slim ferry
#

also yeah print prints to the debugplus console

hardy viper
#

piratesoftware

vale grove
#

THATS WHY IM TRYING TO FIX IT 😭😭

slim ferry
hardy viper
#

😭

vale grove
#

i do NOT wanna have this undertale ahh code

vale grove
#

it "works"

red flower
#

oh did you mean print as in the joker message?

vale grove
#

its a seal

#

wait a sec

red flower
#

do what eris said

vale grove
#

are you supposed to do with two dots here?

#

maybe its just because ive been debugging my java project all day where you have to do + on a sys.outprint

red flower
#

yeah in Lua it's ..

vale grove
dull geode
#

Got a problem


if context.card_added and context.cardarea == G.jokers then
            
            return {
                message = "Ah",
                colour = G.C.MULT,
                sound = 'R14_ah',
            }
end

I just want the message to display one times when the joker is added, but instead, each time a joker is added it redo the message, anyone can help to fix?

red flower
dull geode
#

Let me check

dull geode
red flower
rapid stag
#

bump girldmDead

wintry solar
rapid stag
#

i guess i also need to know how to get calculate to process it during a played hand

rapid stag
#

huh, i thought all of joyoussprings cardareas were toggled

not in sense of usage, but in the sense of accessing it - like the monster cardarea. you have to hit the toggle to see it

but that's what the hide ui bool is for. okay, thanks cirComfy

red flower
#

it used to be like that but the field area is now visible at all times

rapid stag
#

ahhh

#

i haven't seen the mod in a while cirDerp

dusty fractal
#
calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and G.playing_cards then
            for _, deck_card in ipairs(G.deck.cards) do
                if not (deck_card == context.other_card) and not (deck_card:get_id() == context.other_card:get_id() and deck_card:is_suit(context.other_card.suit)) then
                    return {
                        xmult = card.ability.extra.timesmult
                    }
                end
            end
        end
    end
#

trying to iterate through the full deck and find if there is more than one copy of a specific card with same rank and suit

#

but im not sure how i'd properly check that with the first if not statement

solid salmon
#

I know n' says i can make alternate descriptions

#

But like

#

Im still confused

#

How do i apply the contexts for which description i want it to use

dusty fractal
#

wdym alternate descriptions?

solid salmon
#

Its a bit complicated

#

But you know how sleeves have descriptions based off whether not you are using the matching deck?

#

I kinda wanna do something like that

dusty fractal
#

oh okay idk about that? i assume it'd work the same way jokers do with alternate descriptions though

civic solstice
#

yo whats the pseudo random element thing formatted as again

#

i forgor

slim ferry
#

pseudorandom_element(table, seed)

civic solstice
#

ty

#

okay im kinda going mental here lol im tryna make a deck that swaps any played cards to a random suit

#

i have all the syntax done im just going insane at this part

#

well not syntax but everything else is done

slim ferry
#

SMODS.change_base(changeSuit, pseudorandom_element(SMODS.Suits)) i think

civic solstice
#

thats all?

slim ferry
#

for changing the suit yes

civic solstice
#

ty

#

okay now the error is talm bout this

slim ferry
#

what is that doing

civic solstice
#

its tryna index it but it says its a nil value

slim ferry
#

but

#

what is the goal

#

with that

civic solstice
#

idk it just brings back this

slim ferry
#

.................why do you have that there if you dont know what the goal of having that is

civic solstice
#

this is the main.lua file idk anything about this

#

oh wait ik why

#

nvm

slim ferry
#

oh okay

civic solstice
#

okay yeah

#

what happened was when porting over the deck or smth i deleted the script for the default edition and enhancement jokerforge packs with it not knowing i needed it to not crash the game immediately

civic solstice
slim ferry
#

show full code

civic solstice
#

1 sec

granite jay
#

How do I make it so jokers can add a specific joker?

#

Like, not a random joker

civic solstice
red flower
#

pseudorandom_element(SMODS.Suits, "seed").key

#

iirc

slim ferry
#

oh

#

the docs for smods just say that without the key

#

also remove the name check

red flower
civic solstice
slim ferry
#

its just .key

civic solstice
#

alr

slim ferry
#

for getting the key of the suit

#

also you do need to actually define the card youre changing the suit of somewhere

civic solstice
#

so this should work

civic solstice
slim ferry
#

no context.before doesnt run with a card in a context

#

you need to loop context.scoring_hand

#

or context.full_hand

clear ocean
#

@wintry solar for malverk, is there any extra steps to add texture packs for your mod?

civic solstice
clear ocean
#

something like set = 'X' being set = '[prefix]_X?

civic solstice
#

alr

slim ferry
#

and just ignore the face check

#

and the face counter

bleak shore
#

hi everyone , does anybody have an idea of why all the things after my "card.ability" is unknow ?

slim ferry
#

vscode doesnt know balatro well enough to understand that the config in the definition gets copied into card.ability

slim ferry
#

even with all the LSP

wintry solar
bleak shore
slim ferry
#

well then send the crash log

bleak shore
#

and for all of my other joker it show me what is it

slim ferry
clear ocean
civic solstice
#

im confusing myself more than i am making sense of literally anything im making lol

clear ocean
clear ocean
slim ferry
civic solstice
#

like that

slim ferry
#

no

#

its

#

just the same as before

bleak shore
#

thank you

slim ferry
#

i dont think

wintry solar
clear ocean
#

is there like a prefix for texture packs like tp_ or t_

civic solstice
slim ferry
#

its just

#

SMODS.change_base(scored_card, pseudorandom_element(...))

civic solstice
#

okay no wait how tf did THAT get there???

slim ferry
#

uncertainly SMODS

red flower
#

SMODS or nil

clear ocean
civic solstice
#

on a side note is there a list of all the sounds i can put in this

clear ocean
# civic solstice on a side note is there a list of all the sounds i can put in this
/media/Shared/SteamLibrary/steamapps/common/Balatro/Balatro/resources/sounds
❯ ls
ambientFire1.ogg   explosion1.ogg          music5.ogg
ambientFire2.ogg   explosion_buildup1.ogg  negative.ogg
ambientFire3.ogg   explosion_release1.ogg  other1.ogg
ambientOrgan1.ogg  foil1.ogg               paper1.ogg
button.ogg         foil2.ogg               polychrome1.ogg
cancel.ogg         generic1.ogg            slice1.ogg
card1.ogg          glass1.ogg              splash_buildup.ogg
card3.ogg          glass2.ogg              tarot1.ogg
cardFan2.ogg       glass3.ogg              tarot2.ogg
cardSlide1.ogg     glass4.ogg              timpani.ogg
cardSlide2.ogg     glass5.ogg              voice10.ogg
chips1.ogg         glass6.ogg              voice11.ogg
chips2.ogg         gold_seal.ogg           voice1.ogg
coin1.ogg          gong.ogg                voice2.ogg
coin2.ogg          highlight1.ogg          voice3.ogg
coin3.ogg          highlight2.ogg          voice4.ogg
coin4.ogg          holo1.ogg               voice5.ogg
coin5.ogg          introPad1.ogg           voice6.ogg
coin6.ogg          magic_crumple2.ogg      voice7.ogg
coin7.ogg          magic_crumple3.ogg      voice8.ogg
crumple1.ogg       magic_crumple.ogg       voice9.ogg
crumple2.ogg       multhit1.ogg            whoosh1.ogg
crumple3.ogg       multhit2.ogg            whoosh2.ogg
crumple4.ogg       music1.ogg              whoosh_long.ogg
crumple5.ogg       music2.ogg              whoosh.ogg
crumpleLong1.ogg   music3.ogg              win.ogg
crumpleLong2.ogg   music4.ogg

/media/Shared/SteamLibrary/steamapps/common/Balatro/Balatro/resources/sounds
civic solstice
#

thanks

#

also this still did not worj

slim ferry
#

remove that event outside of the loop

clear ocean
#

which one do you prefer? (the first is a reference to the original baba texture pack)

civic solstice
#

the rose colored one looks cool

civic solstice
#

unless i have to move the func = function() line

clear ocean
#

maybe i shouldve tested out the texture pack apply before handling the localization 💔

civic solstice
#

yeah that wouldve worked

clear ocean
#

woops i forgot i put malverk compat in a seperate lua file

#

my best guess is that its trying to grab from the base game's decks so i need some way to let malverk know that its my decks

civic solstice
#

idk man

#

@slim ferry am i right here

slim ferry
#

yeah

#

because

civic solstice
#

figured

slim ferry
#

set_suit doesnt exist

#

and changeSuit isnt defined

#

and differentSuit also isnt defined

clear ocean
civic solstice
slim ferry
#

SMODS.change_base already changes the suit

#

on its own

#

you dont need another function

civic solstice
#

so i dont need the changeSuit(differentSuit) or the local differentSuit =

#

like this?

#

im so confused bro

slim ferry
#

yes

#

wait

#

w

#

where did the for loop go

#

you still like
need that

civic solstice
#

it didnt go anywhere

slim ferry
#

also context.hand_played isnt a thing where did that come from

#

oh

#

im blind

#

nvm

civic solstice
#

nice one lol

civic solstice
civic solstice
#

ykw i probably dont even need that first if statement

#

nvm i think i do lol

civic solstice
slim ferry
#

nothing

#

you already have context.before

civic solstice
#

alright

#

i dont understand why this isnt working then???

#

like this should be working fine right

#

(ignore that massive indent mistake lol)

wintry solar
#

@willow scroll dev branch has the fix now, should work fine for you

normal crest
#

what you're doing there is defining a global function called func

distant junco
#

idk why this is causing all the cards to be debuffed

red flower
distant junco
#

yes

red flower
#

when does it run

distant junco
#

its for a boss blind

red flower
#

when does it run

distant junco
red flower
#

you shouldn't be running stuff in calculate without a context check

#

also for blinds I recommend just using context.debuff_card

distant junco
#

alright

#

how would i do that

civic solstice
red flower
# distant junco how would i do that
if context.debuff_card and (not context.debuff_card.seal or not next(SMODS.get_enhancements(context.debuff_card))) then
    return { debuff = true }
end
distant junco
#

sweet ill try that

civic solstice
#

@red flower help me out here fam

#

whats making my code not working

#

i should also include this

red flower
#

let me read it but pls dont tag me for help, if im here and want/can help i will

civic solstice
#

alr

red flower
red flower
distant junco
red flower
#

ok i just copied your logic because i thought it's what you wanted but the problem is that you are checking that the card doesnt have a seal or enhancement

#

instead of checking if it doesnt have either

#

you can replace the or for an and

distant junco
#

but then wouldnt that only work for cards that have an enhancement and a seal?

red flower
#

no

distant junco
#

oh wait yeah

#

durrrhhh

#

fuck me

civic solstice
#

still nothing

red flower
#

may i see

civic solstice
red flower
civic solstice
red flower
#

😭

civic solstice
#

oh god

red flower
#

you shouldnt check for your decks key in your deck

#

you already know its your deck

civic solstice
#

so i get rid of the key check

red flower
#

yeah

civic solstice
#

okay now it says my custom sfx doesnt exist except for the fact it does

red flower
#

it needs your mod prefix

civic solstice
#

ag

#

im dumb

hushed field
#

I really recommend just setting up a dependency over copying the code or making your own system. Value manip is fidgety with a loooot of edge cases that you need to make systems for to be able to deal with. Copying from Cryptlib or blockbuster would also carry the risk of introducing a near identical system that might overlap in the names of variables, or start behaving weirdly in other ways when both your copy and the original are present. It also means that you're no longer benefitting from the library being maintained. Bugs are now yours to fix, and that's probably harder if the system is new to you

civic solstice
#

am i putting this in right idk what im doing wrong here

faint yacht
#

...the modprefix of the mod...

red flower
#

it has to be your mod's prefix, what you have in your .json or header

civic solstice
#

oh

#

im so smart

red flower
#

also without the extension

#

and I'm assuming you made an SMODS.Sound...

civic solstice
#

LOL

distant junco
civic solstice
#

i assume i got the sound correct or smth

#

idk what this even remotely means

red flower
#

usually you want to post the entire log

civic solstice
#

do i needa send more of the log

red flower
#

yes

#

just ctrl c

civic solstice
#

i actually didnt know discord does that LOL

red flower
#

this might be a talisman crash, try updating it or disabling it

#

you shouldn't use the dev version of smods unless you know what you're doing btw

civic solstice
#

disabling it didnt work lemme try updating it

#

nope

#

actually itd help to re-enable talisman

#

1 sec

red flower
#

what's your code looking like now

civic solstice
#

1 sec

#

ya still nothing

civic solstice
red flower
#

that's not how you use SMODS.Sound

civic solstice
#

the only thing i can think of is the smods.sound is in the wrong place

#

yea thought so

#

i just followed the api

#

and the thing doesnt show you how to use the smods.sounds thing

red flower
sharp arch
#
    atlas = "purp",
    loc_txt = {
        name = "Material Pack",
        description = {
            "Choose one of up to 3 {C:attetnion}Material{} cards."
        },
        group_name = "Material_Pack"
    },``` why isnt the description (or name) showing up
red flower
red flower
sharp arch
#
        local cfg = (card and card.ability) or self.config
        return {
            vars = { cfg.choose, cfg.extra },
            key = self.key:sub(1, -3), -- This uses the description key of the booster without the number at the end
        }
    end,```
red flower
#

remove the key

sharp arch
#

ok so the name shows up, but not the description

red flower
#

it should be text

#

instead of description

civic solstice
#

okay so the deck effect works now but it didnt work exactly how i wanted it to, it changed the suits before the scoring, not after the scoring

#

i tried changing the before to an after, merge the bottom if statement into the top one, etc and it just refuses to happen after?

#

unless im using context.final_scoring_step wrong

plucky berry
#

guys how do i make consumables selectable from boosters, like cryptid code cards?

solid salmon
#

2 questions, whats wrong with it and how do i stop the pseudorandom from rounding the xmult

civic solstice
civic solstice
#

context.after

red flower
#

try before

civic solstice
#

alr

#

im also gonna give it a message when it changes the suits colors

#

i forgot how the line for custom msgs works lol

#

what's the code for custom msgs to show up for when the suit changes

solid salmon
#

guys

#

uh

#

i kinda can't get into github

#

because i forgot to set up the stupid 2 factor authenticator

willow scroll
#

i have a small question, if i create a new modded rank thats intended to exist for all suits (even other modded ones) and another mod adds a new rank, how does that work then?

#

i assume a blank card texture or smth?

pastel kernel
#

It was just supposed to be for one joker, but I’ll just tell everyone that I am planning to use it for a future joker.

#

Oh yeah, do I use cryptlib or bbvmapi?

civic solstice
solid salmon
#

chat how do i stop the random from rounding?

#

all it max mult gain triggers thrice for some reason

normal crest
#

pseudorandom with a min and max always returns integers

#

if you want numbers between 1 and 1.5 do 1 + pseudorandom("seed") * 0.5

gusty iron
#

decided to try and make custom things, any thoughts?

frosty rampart
#

a bit simplistic but that's not necessarily bad
I assume unique designs are gonna go in each circle, but I also recommend having something more than just a solid color for the background. maybe a light to dark gradient?

civic solstice
#

also W etoh player

gusty iron
frosty rampart
#

ah I see, dunno the reference sorry

#

in that case definitely spruce up the background

#

maybe some sort of pattern like a lot of food jokers have

gusty iron
#

ill probably add more interesting things inside the circles

potent swan
#

<@&1133519078540185692>

gusty iron
#

trying to get this to work but for some reason whenever i hover over the card it keeps crashing? any help?

#

oh no 😨

#

...okay were taking a step in the right direction

normal crest
#

not only that, your messages indicate at least two steps in the right direction

gusty iron
#

cant seem to get the text to show up :/

normal crest
#

are you using a localization file

gusty iron
#
return {
    descriptions = {
        Charm = {
            RnB_chm_none = {
                name = "None",
                text = {"Does nothing."}
            }
        }
    }
}
normal crest
#

are they consumables

gusty iron
#

no

#

theyre a new thing

#

like partners

normal crest
#

What did you use to create them

gusty iron
#

SMODS.Center:extend

normal crest
#

Can you show that part

gusty iron
#

RnB.Charm = SMODS.Center:extend{
    unlocked = true,
    discovered = false,
    config = {},
    set = "Charm",
    class_prefix = "chm",
    required_params = {"key", "atlas", "pos"},

    pre_inject_class = function(self)
        G.P_CENTER_POOLS[self.set] = {}
    end,

set_card_type_badge = function(self, card, badges)
    local display_info = {"Charm"}  -- first entry is the type name
    if self.badges_info and next(self.badges_info) then
        for _, v in pairs(self.badges_info) do
            local localized = localize(v)
            if localized ~= "ERROR" then
                display_info[#display_info+1] = localized
            else
                display_info[#display_info+1] = v
            end
        end
    end
    -- create the badge
    badges[#badges+1] = create_badge(display_info, G.C.RED, G.C.WHITE)
end,


    generate_ui = function(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
        SMODS.Center.generate_ui(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
    end
}
normal crest
gusty iron
#

oh HELL yeah

#

is it just me or does the spacing feel off

gusty iron
frosty rampart
#

so it'll look more natural when you have more charms

clear ocean
#

crashes when attempting to apply baba is gros

#
ls -R
.:
assets  gimp  localization  main.lua  meta.json  src

./assets:
1x  2x

./assets/1x:
back_baba.png  back.png

./assets/2x:
back_baba.png  back.png

./gimp:
back

./gimp/back:
purple_baba.xcf  purple.xcf

./localization:
en-us.lua

./src:
back  pre

./src/back:
purple.lua

./src/pre:
atlas.lua  malverk.lua
#

if someone more experienced with malverk wants me to post a zip to debug it uh i can do that too

river grail
#

I'm trying to make a tarot card that has the same functionality as Death, but min_hightlighted doesn't want to cooperate...

#
    key = 'merge',
    set = 'Tarot',
    atlas = 'tarot',
    pos = { x = 0, y = 0 },
    unlocked = true,
    discovered = true,
    cost = 3,
    config = { max_highlighted = 2, min_highlighted = 2 },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.max_highlighted } }
    end,
    use = function(self, card, area, copier)
        [ ... ]
    end,
}```
The logic in use is purposefully truncated to save space
Am I doing this right?
#

Unless the logic in use is important to min_highlighted, which if so, I can send the entire block of code

normal crest
river grail
#

Not for this one

normal crest
#

Maybe just try starting a new run

tight pumice
#

Can set_ability work with custom enhancements?

#

Trying to make a joker that sets cards to a custom enhancement I made and I’m having trouble

gusty iron
frosty rampart
tight pumice
#

Dope that worked

gusty iron
#

do you guys know any mods that add card areas which i can look at to reference

frosty rampart
#

paya's terrible additions adds one for dos cards

gusty iron
#

kkty

tight pumice
#

When I try to combine things on text like {C:attention, X:red} I only ever get the first thing

#

Am I formatting it wrong? The examples I can find do it just like that

frosty rampart
#

no space after the comma

tight pumice
#

Always something silly

gusty iron
#

I think this is a good way to translate wrath into the game

Wrath In RnD: Health + Stamina are Linked. X0.5 Stamina Actions, X1.5 Health Loss

Wrath In RnB: Balances Chips and Mult, X0.5 Chips, X1.5 Mult

gusty iron
frosty rampart
#

probably? but you should init it at 0, 0 anyway
here's how PTA sets the position for dos cards, it's done after the fact (still in the start_run hook)

gusty iron
#

also how would i get a charm in the area for testing?

frosty rampart
#

use the SMODS.add_card function, and in the table of arguments, set area = [your custom cardarea]

gusty iron
frosty rampart
#

ah, fun

gusty iron
#

do you know why it does that?

frosty rampart
#

no, i haven't messed with custom cardareas myself, sorry

gusty iron
#

okay 🥹

red flower
gusty iron
red flower
#

yes that's what consumables use too

gusty iron
#

WHY THE HELL IS THAT SO UNINTUITIVE??

red flower
gusty iron
#

ty 😔

#

whats the card area for the consumables called btw

#

its so beautiful 🥹

frosty rampart
#

G.consumeables

gusty iron
gusty iron
gusty iron
#

nvm i figured it out :)

#

AHHHH I LOVE THIS SO MUCH

obsidian spear
#
    calculate = function(self, card, context)
        if context.individual then
            local other_card = nil
            for i,v_card in pairs(G.jokers.cards) do
                if v_card == card then
                    print(i-1)
                    if i-1 ~= 0 then other_card = G.jokers.cards[i-1] end
                end
            end
            print(other_card)
            -- add the thing
            if other_card then
                Bitterstuff.forcetrigger(other_card, context.individual)
                print(other_card.key)
            end
        end
    end

why code not work :(

shell timber
#

you should just depend on cryptlib

obsidian spear
#

bnver

obsidian spear
#

how do I use other_card.deep_copy()

#

what does it do

young leaf
#

im currently going through the agony of installing lua

#

im not sure if this is even necessary ☹️

pale holly
#

you don't need to instal lua for modding

#

just something like notblock plus or any text program that handle codding in lua works

obsidian spear
#

Vsc 🤤🤤

young leaf
#

i was about to mention vsc

#

thanks :D

bold gyro
#

hey y'all, i'm trying to change the cards in a booster pack when the pack is opened by iterating over G.pack_cards.cards, and i want the change to occur immediately after the cards are created. How can I do this? context.open_booster seems to be called too early, and at that time G.pack_cards is nil

solid salmon
#

is there a way to stop the max_mult_gain to stop triggering thrice

#

also is there a way to make pseudo random give decimals

red flower
solid salmon
#

ye

red flower
#

yeah that one is not correct

#

gimme a sec

#

it should be context.before or (context.end_of_round and context.main_eval) or context.pre_discard probably

#

unless you want it to be for each card played or discarded

solid salmon
#

nope

#

just for when you play

red flower
#

then yeah that

solid salmon
#

as for the psuedo random

#

is the solution simply multiplying it by 100 for it to be an integer then dividing it by 100?

red flower
#

that works

#

you can also not give it a range and do the thing where you add the min and multiply by the max

solid salmon
#

what?

red flower
#

like pseudorandom("seed") * (max - min) + min

solid salmon
#

oh wait

#

Xmult = pseudorandom("pagerson") * (card.ability.extra.Xmult_max - card.ability.extra.Xmult_min) + card.ability.extra.Xmult_min like this?

red flower
#

yes

strong plume
#
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = '''
G.STATE = G.STATES.GAME_OVER; G.STATE_COMPLETE = false 
'''
position = "after"
payload = '''
check_for_unlock({type = 'bstuck_soporpie'})
'''
match_indent = true
times = 1```

Does anyone know why this isn't working? My first time trying to do a code injection, so sorry if it's something stupid. This is all I've added so far, unsure if I gotta put something else somewhere else
solid salmon
#

also how do i make joker messages

#

like extinct

red flower
strong plume
#

weird. i'll try messing around more, thank you

red flower
#

make sure to have this space in the pattern

solid salmon
#

oh so 'k_[insert message]_ex'

red flower
#

idk why

red flower
#

thats in the localization file

solid salmon
#

oh the dictionary

strong plume
#

Lemme try it in-game again

red flower
#

is it not patching or is it not working

strong plume
#

How do I know the difference? /genquestion

#

Wait, no okay weird thing:
It works if I'm at 0 handsize, but nof if the deck is at 0 cards

#

Okay the injection is working, I'm likley just injecting in the wrong place. I can probably get it from here, thank you! @red flower N

solid salmon
#

can someone sauce me the link for dictionary

red flower
final jewel
#

Why my patch isnt working I just want my enhancement to be use in golden ticket

red flower
final jewel
#

oh so its using lovely dump and not the source code

strong plume
slim ferry
red flower
final jewel
umbral spire
#

how can i make a joker instantly open a booster pack like a tag, say the standard pack for now.

red flower
strong plume
#

oh it ends the round which triggers the end of round function. that makes sense, I should have looked there, thanks!

umbral spire
#

actually just in shop

red flower
#

in a round it breaks a bit, in shop it should be fine?

umbral spire
#

alr cool

#

so something like this?

            tag:yep('+', G.C.SECONDARY_SET.Spectral, function() -- am i supposed to change `tag:yep`?
                local booster = SMODS.create_card { key = 'p_standard_mega_1', area = G.play }
                booster.T.x = G.play.T.x + G.play.T.w / 2 - G.CARD_W * 1.27 / 2
                booster.T.y = G.play.T.y + G.play.T.h / 2 - G.CARD_H * 1.27 / 2
                booster.T.w = G.CARD_W * 1.27
                booster.T.h = G.CARD_H * 1.27
                booster.cost = 0
                G.FUNCS.use_card({ config = { ref_table = booster } })
                booster:start_materialize()
                G.CONTROLLER.locks[lock] = nil -- what's this do?
                return true
            end)
subtle hawk
#

@hybrid iris

red flower
#

you want the part inside

hybrid iris
subtle hawk
#

k

subtle hawk
hybrid iris
#

no prob!

final jewel
#

I dont understand why it doesnt work again

strong plume
#

It all works now, thank you! @red flower

red flower
#

also remove the card = self

#

and replace self.ability.extra for card.ability.extra

final jewel
#

I litteraly coppied the lovely dump my bad

red flower
#

yeah but self in the vanilla function and in smods stuff is not the same

final jewel
#

yeah thats why I am soo dumb

red flower
#

oh youre missing a context check

final jewel
#

oh yeah right

red flower
final jewel
#
SMODS.Joker:take_ownership(
"ticket",
{calculate = function(self, card, context)
    if context.individual and context.cardarea == G.play and
       SMODS.has_enhancement(context.other_card, 'm_gold') or SMODS.has_enhancement(context.other_card, 'm_giga_perfectGold') then
        G.GAME.dollar_buffer = (G.GAME.dollar_buffer or 0) + card.ability.extra
        return {
            dollars = card.ability.extra,
            func = function()
                G.E_MANAGER:add_event(Event({
                    func = function()
                        G.GAME.dollar_buffer = 0
                        return true
                    end
                }))
            end
        }
    end
end},
true)

still crash

red flower
#

(SMODS.has_enhancement(context.other_card, 'm_gold') or SMODS.has_enhancement(context.other_card, 'm_giga_perfectGold')) add parenthesis

final jewel
#

omg I forgot everything

#

hell yeah it work

#

thx N'

#

but if another mod is using ownership on this card its going to nuke it, no ?

red flower
#

yes but thats basically unavoidable

#

i would maybe look into making your card always treated as a gold card instead?

final jewel
#

hum how do I do that

red flower
#

i think you would need to hook get_enhancements

#

but im not sure

final jewel
#

in toml ig

red flower
#

no you can hook it you dont need to patch it

final jewel
#

is there an example of hook, Im not that advance

slim ferry
#

also hooks are definitely simpler than patches i would say

umbral spire
final jewel
#

I did the hook but like the problem is that now its alway considered as a gold card but sometimes I need it to not

#

and it doesnt work

daring fern
final jewel
#

oh

#

like that

daring fern
final jewel
#

oh the fonction itself my bad

wild pine
#

is there a way to have your mod check for updates by like comparing it to the latest github version, or does steamodded handle that already?

slim ferry
#

maximus has an update prompt so you could look at that

#

i cant imagine its easy since otherwise more mods would just do that

final jewel
#
--#region HOOKS
local enhancement_yapping = SMODS.has_enhancement
function SMODS.has_enhancement(card, key)
    if key == 'm_gold' then
        return enhancement_yapping(card, 'm_gold') or enhancement_yapping(card, 'm_giga_perfectGold')
    end
    local ret = enhancement_yapping(card, key)
    return ret
end
--#endregion

does the ret is useless in that

#

oh no its not

long sun
#

how do i check if a card is part of the collection?

hardy viper
#

card.area.config.collection

#

depending on where you do that you might need to nil check card.area

long sun
#

thanks ^u^

#

is there a way to ban an edition from appearing on a specific set of Jokers?

#

this would look strange on Stencil, Half and Hole in the Joker

long sun
#

aw

#

shame

pale holly
#
    calculate = function(self, card, context)
            local my_pos = nil
    for i = 1, #G.jokers.cards do
        if G.jokers.cards[i] == card then
            my_pos = i
            break
        end
    end
                
  if context.end_of_round and not context.blueprint and context.game_over == false and context.main_eval then
  if my_pos then                             
  local sell_minus = G.jokers.cards[my_pos - 1] or nil
  local sell_plus = G.jokers.cards[my_pos + 1] or nil
  card.ability.extra.dollar = card.ability.extra.dollar + sell_minus.sell_cost or nil + sell_plus.sell_cost or nil
      end
      end
        end,
        
    calc_dollar_bonus = function(self, card)
        local result = (card.ability.extra.dollar)
        card.ability.extra.dollar = 0
        return result
    end

My joker is meant to give the sell value of the joker on the right and left of itself as the cashout, it will crash in case of no joker on the left (and presumably on the right too), tried to use 'or nil' for it but will still do, if someone could help me please
oh and just noticed it'll only take the sell value on the left

slim ferry
#

(sell_minus or {}).sell_cost or 0

#

same for sell_plus

umbral spire
#

for a blind how can i take $2 per joker triggered

daring fern
umbral spire
daring fern
daring fern
# umbral spire ye
calculate = function(self, blind, context)
    if not blind.disabled then
        if context.post_trigger and next(G.play.cards) then
            local count = 0
            for k, v in pairs(G.play.cards) do
                if SMODS.has_enhancement(v, 'm_gold') then
                    count = count + 1
                end
            end
            return {dollars = -count, message_card = blind.children.animatedSprite}
        end
    end
end
midnight trellis
#

Does SMODS.post_prob have a specific internal or API purpose or is it (to my best knowledge) just keeping track of past occurred probabilities?

red flower
umbral spire
#

how do i make the game just instantly lose

red flower
clear ocean
#

good afternoon too

umbral spire
clear ocean
#

vr?

#

oh

#

idk actually

#

wikis on github are weird on how they store it

umbral spire
#

vanillaremade

#

also how can i change the blinds blind size in the middle of a round

red flower
clear ocean
#

nh got all of us covered

clear ocean
mossy anchor
#

how do i make a card thats missing either a rank or a suit

clear ocean
#

so like a random chance or something like the wild/stone card

mossy anchor
#

like the wild/stone card

clear ocean
#

any_suit, no_rank, and no_suit

mossy anchor
#

ah

scenic nest
#

hey folks, need someone with more experience than me

#

Balatro+ crashes my game if i use 6ixth Sense

clear ocean
#

what's balatro+

scenic nest
#

mod

#

want the nexus link?

slim ferry
scenic nest
#

ofcourse thank you 1 second

frosty rampart
#

(this sets the scoring calculation at the start of the run)

mossy anchor
#

oh

#

wait where does the scorecalckey coem from

slim ferry
#

from the SMODS.Scoring_Calculation

mossy anchor
#

ah

slim ferry
#

that you make

scenic nest
#

sorry took a moment, appreciate ya looking if nothing else

mossy anchor
#

wait whats scorecalckey

#

i think it would be power in this case or juice in the example code

#

maybew

#

idk

#

im not sure if i need to replace that part or

scenic nest
#

i have no idea what any of that means, i keep seeing somthing about the LUA file

slim ferry
#

i dont think thats related to the crash

#

also

#

get latest steamodded release..

clear ocean
#

update yo mods, fool!

fallen osprey
#

not like it matters anymore lost everything lolol

mossy anchor
#

they stole my set_scoring_calculations 😭

frosty rampart
#

singular

#

(it has to be set_scoring_calculation, not set_scoring_calculations)

mossy anchor
#

oh

#

@frosty rampart sorry for ping

whole jungle
#

I assume calculate functions don't run on cards in your deck, right? I'm having an issue where a playing card destroyed in my deck doesn't activate an on destroy enhancement.

slim ferry
#

card destroy calculations arent run unless you either use SMODS.destroy_cards or calculate it manually

#

oh wait like that

#

yeah

#

you can enable cards in deck calculating i think though

#

deck cardarea optional feature should do that

whole jungle
#

I am using SMODS.destroy_card, but it doesn't seem to activate the calculate function of the enhancement unless it's in hand

slim ferry
#

yeah so

#

should work

#

i think

whole jungle
#

Ah, yep, that looks like what I'm looking for

#

How bad is the hit to use the deck and discard optional areas?

slim ferry
#

not that bad i think

#

it does add a bunch of extra calculations but performance shouldnt take much of a noticable hit

whole jungle
#

Okay, thank you!

#

Nice, that worked

gusty compass
#

where could i learn about and check how button ui works for items like jokers, for instance in the shop slots where jokers can be bought?

mossy anchor
# mossy anchor

found hte issue: the prefix in my json file was rmd and it was using that

#

i so stupid

vale grove
#
    update = function(self, card, dt)
        if card.ability.extra.active == true then
            G.SETTINGS.GAMESPEED = 8
        end
    end,
    remove_from_deck = function(self, card, from_debuff)
        card.ability.extra.active = false
        G.SETTINGS.GAMESPEED = 4
    end,
    add_to_deck = function(self, card, from_debuff)
        card.ability.extra.active = true
    end

i have this function and for the most part it works wonders, but when you lose the game it keeps the game speed up how do i remove that?

clear ocean
#

any way to add additional config types if that makes sense

#

like hands, discards, dollars, joker_slot, voucher, and consumables

slim ferry
#

do you need to do that

clear ocean
#

well i would make it more compactable for the decks that i plan to add where they add tags

#

don't repeat yourself yknow

slim ferry
#

ah i see

#

probably hook/patch Back:apply_to_run

#

and remember to respect the fact that decks with an apply should override the default functionality

clear ocean
#

and if possible my mod could be used as some sort of api kind of deal

#

looks like this i think

minor magnet
#

is it possible to slow down the splash vortex?

#

like the one in the title screen

#

where all the cards converge

obsidian spear
#

i mean if you can find out where in the files it is

minor magnet
#

wdym

#

it's code

obsidian spear
#

i mean if you can change the cards, background then i presume you can change the speed

obsidian spear
obsidian spear
#

@minor magnet

minor magnet
#

that's for the shader

#

i meant the actual duration

obsidian spear
#

ah

#

theres here too @minor magnet

#

yea i think this works

#

maybe maybe not

#

wait this just changes the title doesnt it

#

you'd be changing alot of things 🤷‍♂️

#

i dont think you can

clear ocean
final jewel
#

how does lucky_trigger work, like can I hook it ?

red flower
#

it's cleared out later

final jewel
#

yeah but can I make my enhancement trigger the lucky cat when it give you something

red flower
#

yeah just set the flag in the card when it triggers and clear it out after the hand is played

final jewel
#

ok

sharp arch
#

i think it has something to do with this

thorny agate
#

Has someone ported the balatro mod manager to linux? 🤔

red flower
red flower
sharp arch
#

like- i have no idea what i fucked up

#

oh wait nevermind its still yhere

clear ocean
#

doesn't it not work with wine?

sharp arch
#

ok so i did the simple way and disabled m config menu, no change at all

thorny agate
gaunt thistle
#

same thing different names :P

clear ocean
#

yes and no. it's a fork of wine developed by valve themselves to extend linux support for steam games and the deck

gaunt thistle
#

ah yeah fair tbf I dont really know compute stuff all too well

#

I just like to watch you guys talk about mods

#

and the art is always really pretty 😍

clear ocean
#

to put it simply wine is the base windows APIs compatibility layer, proton is a fork from valve for steam, and there's proton-ge which is a community fork of proton that is recommended for some games

#

but ge is experimental if that makes sense

gaunt thistle
#

nah jk jk im lying I know technical stuff

#

I should know better than to shitpost in modding-dev

willow scroll
gaunt thistle
#

distinguishing between the two for someone not technically inclined is usually not worth the time, it's better to tell them that if they've tried Proton then they've tried Wine

gaunt thistle
willow scroll
clear ocean
#

but it has worked for some games

#

and since its not really a steam game it is worth a try

civic solstice
#

aight guys heres my code and the error i keep getting when tryna set up a new game

#

im tryna make a deck where base blinds are cut in half but theres no discards at all

#

do yo magic LOL

#

btw the ante cutting works perfectly fine its just the discards thats giving me trouble

faint yacht
#

Start the run with no discards?

#

If that's the case, set discards in the config to -3.

civic solstice
#

so picking up the wasteful and the one after wont give you the discard

clear ocean
#

you can do a deck calc function

#

probably when you select a blind set discards to zero

#

but also design wise having NO discards sounds like a terrible deck

faint yacht
#

G.GAME.round_resets.discards, G.GAME.current_round.discards_left should be forced to 0... and probably should hook ease_discards to prevent additions of discards if on the deck.

civic solstice
clear ocean
#

fair enough

faint yacht
#
-- This is outside definition of any objects, such as SMODS.Back and what not.
local easediscardref = ease_discard
function ease_discard(mod, instant, silent)
  if G.GAME.selected_back.effect.center.key == 'b_modprefix_key' then mod = 0 end
  easediscardref(mod, instant, silent)
end

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

civic solstice
#

ty

#

UHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

#

OH wait bc the thing that sets the blinds to half is in the calculate function

civic solstice
#

unless i messed smth up

sharp arch
faint yacht
faint yacht
sharp arch
#

i might be able to fix it if its that simple

#

but locating is gonna be a fucking nightmare

civic solstice
faint yacht
civic solstice
#

ah okay

faint yacht
civic solstice
#

now its saying this over the entire thing

#

well just the part given i mean

sharp arch
faint yacht
civic solstice
#

yup

faint yacht
#

...or which of the Jokers, decks or w/e is not returning the right thing for loc_vars...

faint yacht
civic solstice
red flower
sharp arch
#

i think its the config i have for music

faint yacht
sharp arch
red flower
#

ok can i see the code for that part

civic solstice
sharp arch
red flower
#

whatever is fine

sharp arch
#
    return {
        {
            label = localize("jabong_set_music"),
            tab_definition_function = function()
                jabong_nodes = {
                    {
                        n = G.UIT.R,
                        config = { align = "cm" },
                        nodes = {
                            --{n=G.UIT.O, config={object = DynaText({string = "", colours = {G.C.WHITE}, shadow = true, scale = 0.4})}},
                        },
                    },
                }
                settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
                settings.nodes[#settings.nodes + 1] = create_toggle({
                    active_colour = G.C.RED,
                    label = localize("jabong_mus_getarnd"),
                    ref_table = jamod_config.jamod,
                    ref_value = "jimbum_music",
                })
                config = { n = G.UIT.R, config = { align = "tm", padding = 0 }, nodes = { settings } }
                jabong_nodes[#jabong_nodes + 1] = config
                return {
                    n = G.UIT.ROOT,
                    config = {
                        emboss = 0.05,
                        minh = 6,
                        r = 0.1,
                        minw = 10,
                        align = "cm",
                        padding = 0.2,
                        colour = G.C.BLACK,
                    },
                    nodes = jabong_nodes,
                }
            end,
        },
    }
end```
#

ok imma hop off, ill ask about this tomorrow

civic solstice
red flower
long sun
#

when hooking Controller.L_cursor_release, how can i check if the thing being deselected is my Joker?

red flower
long sun
#

the deselected object apears to be very different from my card

#

even though they should be identical

civic solstice
red flower
civic solstice
#

oh

#

okay i came up w this and it didnt work

#

(setDiscards = 3 btw)

faint yacht
#
if context.setting_blind then ease_discard(-G.GAME.current_round.discards_left) end
#

-# ...although that would just get nullified by the hook, oops - could change the condition to check if mod is 0 or larger.

obtuse silo
#

is there any way to check if a card in hand has any enhancement?

frosty rampart
#

next(SMODS.get_enhancements(card)) is true if and only if the card has an enhancement

#

(SMODS.get_enhancements always returns a table, even if it's empty)

willow scroll
#

<@&1133519078540185692> kill 2

dusty fractal
#

how would i tell if a card is being discarded or not during the discard function

#

context rather

rocky plaza
#

ok may or may not be dumb but how does one alter the center at which the text rotates for an SMODS.DynaTextEffect?

frosty rampart
frozen bay
#

is there a way to make vouchers appear in other parts of shops that arent the voucher slot?

crystal perch
#

replying to you because you helped me with this earlier, and i can't crack why this still isn't working
here's the new added calc code (i can't send it all because of character limit, so just use the replied code as ref), and to my understanding everything works perfectly up until the very last for loop. which for some reason doesn't seem to even be firing as the sendDebugMessage("Difference:" .. difference, "CHAK") within it just does not send anything to the console

local difference = 0
  sendDebugMessage("Difference:" .. difference, "CHAK")
  sendDebugMessage("OG Suits:", "CHAK")
  print(og_suits)
  sendDebugMessage("New Suits:", "CHAK")
  print(new_suits)
  for suit_key, og_value in ipairs(og_suits) do -- Compare dictionaries
      local new_value = new_suits[suit_key] or 0
      difference = math.abs(og_value - new_value) + difference
      sendDebugMessage("Difference:" .. difference, "CHAK")
      if card.ability.extra.cards_discarded > difference then
          for i = 1, card.ability.extra.cards_discarded - difference do
              card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_gain
              card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
          end
          return {
              colour = G.C.PURPLE,
              message = "Upgraded!"
          }
      end
  end
``
pale holly
# slim ferry `(sell_minus or {}).sell_cost or 0`

got this error now, still will crash if no joker is at the left (and apparently will still not check for the joker at the right either

if context.end_of_round and not context.blueprint and context.game_over == false and context.main_eval then
if my_pos then                             
local sell_minus = G.jokers.cards[my_pos - 1] or nil
local sell_plus = G.jokers.cards[my_pos + 1] or nil
card.ability.extra.dollar = card.ability.extra.dollar + (sell_minus or {}).sell_cost or 0 + (sell_plus or {}).sell_cost or 0
    end
    end
      end
frosty rampart
#

rewrite the line to be
card.ability.extra.dollar = card.ability.extra.dollar + ((sell_minus or {}).sell_cost or 0) + ((sell_plus or {}).sell_cost or 0)
i'm pretty sure addition has higher priority than the logical boolean operators, so it's not behaving as intended

#

(i.e. the expression x or y + z or w is equivalent to x or (y + z) or w)

pale holly
#

I'm going to give it a shot

#

the issue i noticed is that it won't ever even care about the right joker, while the left is mendatory to it somehow, maybe cuz sell minus is first

pale holly
mystic river
#

what would a counterfeit sticker look like
that is, a sticker that indicates a counterfeit item

wind steppe
#

red x

mystic river
frosty rampart
#

Redd's face from animal crossing

mystic river
#

ooh, that's a good one

clear ocean
frosty rampart
#

hell yea

clear ocean
#

something like hack with an image like this

#

with his stupid oversized coat

#

it's a fraud and a wan-

#

automod is big brother i cant finish the sentence

wind steppe
#

literally 1984

clear ocean
#

using a cocktail of tylenol and shots 😋 my austim grows stronger

#

also @frosty rampart did you hear about the major update of new horizons

frosty rampart
#

i did, yea
i don't actually play new horizons but it looks really cool

clear ocean
#

not testing my deck which gives you a charm tag and getting a soul 😬

#

i just imagine if my mod goes anywhere purple deck will be the resetting for a beach seed of modded balatro

#

resetting for a soul card

#

hi nh

red flower
young leaf
#

im working on a joker that gives +10 mult for the aces of hearts
this is the line, mostly just copied from the idol:
config = { extra = { s_mult = 10, rank = 'Ace', suit = 'Hearts' }, },
right now its ignoring the rank = ace and giving all hearts +10 mult
how would I fix this to be specifically ace of hearts?

red flower
young leaf
#

ohhhh ok that makes a lotta sense

dusty fractal
#

is the SMODS support for pseudo-suits/ranks in hand calc and joker calc

#

pushed yet

viral ember
#

wrong chat woops

wind steppe
#

like wild cards?

blissful lake
#

Hey guys just joined the discord. I've been wanting to make a balatro mod and was just introduced the the JokerForge website which is really nice for simple stuff getting started, but I was wondering if there is a way to add new consumable types on there? it doesn't seem like so.
how hard would it be to make a new consumable type?

novel violet
#

hey gang, how do i make the newly polychrome cards trigger polychrome effects on scoring? :3c

blissful lake
young leaf
# red flower s_mult is only for suits personally for jokers I don't recommend using the confi...

quick update
config = { extra = { mult = 10 } }, calculate = function(self, card, context) if context.individual and context.cardarea == G.play and context.other_card:is_suit(card.ability.extra.suit) and context.individual and context.cardarea == G.play and context.other_card:get_id() == 14 then return { mult = card.ability.extra.mult } end end }
i tried this, which is basically just lusty joker and scholar mixed together, unfortuantely that doesnt seem to work either though

novel violet
#

you nailed it, i've got it in an event. i'll give that a try, i hope it still looks right xD

#

yah as i figured it gets assigned polychrome the moment it's played and throws off the effect "Mwah!" and juice-up effect Sadge it does trigger edition effects on scoring though

#

i wonder if there's a way to achieve the desired scoring and visual effects

daring fern
novel violet
#
if context.before and not context.blueprint then
            local convert = 0
            for _, k in ipairs(context.scoring_hand) do
                if not k:is_suit('Hearts') then
                    convert = convert + 1 -- thunk please reprogram balatro in C++ so i can use compound operators
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            SMODS.change_base(k, "Hearts")
                            k:juice_up()
                            return true
                        end
                    }))
                end
            end
            if convert > 0 then
                card_eval_status_text(card, 'extra', nil, nil, nil,
                                      {message = 'Love!', colour = G.C.RED})
            end

            -- Polychrome 8 routine

            local kiss = 0
            for _, k in ipairs(context.scoring_hand) do
                if not k.edition and not k.debuff then
                    if (k:get_id() == 8) and
                        SMODS.pseudorandom_probability(card, "merlimbis_poly",
                                                       1,
                                                       card.ability.extra.odds) then
                        kiss = kiss + 1
                        G.E_MANAGER:add_event(Event({
                            func = function()
                                k:juice_up()
                                -- k:set_edition("e_polychrome", true)
                                return true
                            end
                        }))
                        k:set_edition("e_polychrome", true) -- test this location
                    end
                end
            end
            if kiss > 0 then
                return {message = "Mwah!", colour = G.C.PURPLE}
            end
        end
dusty fractal
novel violet
dusty fractal
#

as in having a joker that makes all Aces count as Kings

#

for example

#

and similar with suits

wind steppe
#

and card:is_suit

dusty fractal
#

i understand that. im asking if SMODS added functionality for it.

#

i dont want to use hooks or patching if i dont have to, which i think is reasonable?

wind steppe
#

no it isnt

dusty fractal
#

???

wind steppe
#

a lot of smods functions are designed to be hooked

#

smods patches in patch targets so you can patch easier

dusty fractal
#

that doesnt mean that hooks and patches arent inherently more unstable than easier and simpler solutions

#

?

dusty fractal
#

... yes they are

wind steppe
#

patches are maybe slightly unstable if you have a lot of mods but that's just called Having A Lot Of Mods

dusty fractal
#

they're hooks

#

thats a fundamental property of hooks

wind steppe
#

and would probably happen regardless based on the non-patch way a mod did something

umbral zodiac
#

hooks are unstable if you use them badly

dusty fractal
#

hooks insert code to run locally why would they not be unstable

umbral zodiac
#

however my mod is very hook heavy

dusty fractal
#

wtf are you yapping about

umbral zodiac
#

and i have rarely had

dusty fractal
#

im not saying 'hooks are bad'

umbral zodiac
#

any incompatibilities from hooks alone

wind steppe
#

i dont think you know what a hook is

dusty fractal
#

im saying 'id rather not use them if there is pre-existing implementation'

hardy viper
#

imma be real

#

hooks ARE bad

umbral zodiac
#

i have a 700 line file just for hooks its ok

dusty fractal
#

you codswallop

wind steppe
#

new insult just dropped

hardy viper
#

hooks make stacktraces look awful

wind steppe
hardy viper
#

thats the main reason they kinda suck

umbral zodiac
mystic river
wind steppe
#

i would rather have that than patch into a function though because then you cant blame a specific mod

dusty fractal
#

they are unstable because inserting code to run in methods is more risky than running it strictly inside of the card itself if poorly implemented

hardy viper
#

SMODS needs a built in way of declaring hooks that runs them consecutively and doesnt grow the stack each time

umbral zodiac
#

is C# dying 🤔 or losing popularity 👀

wind steppe
hardy viper
#

either through some sort of preprocessed attribute or just a plain function

#

itll happen at some point surely

wind steppe
#

that would actually be neat

dusty fractal
#

idk why this is even an argument

umbral zodiac
wind steppe
#

stack traces look nice finally

#

instead of fifteen million gameUpdateRefs

umbral zodiac
#

its probably a little riskier but its just not really a considerable factor 99% of the time

novel violet
dusty fractal
#

this guy literally said 'you are being unreasonable for not wanting to use hooks if there are pre-existing options'

umbral zodiac
#

don't fuck up your hooks and you should be smiley face

dusty fractal
#

i dont think im bing unreasonable

wind steppe
dusty fractal
#

no, im not

wind steppe
#

pre-existing built in options is different from anything but hooks

dusty fractal
#

Lmao

hardy viper
#

worth mentioning that hooks are slower than patches

#

by a fat margin

wind steppe
#

also true

dusty fractal
#

i exclusively use patches, yeah

#

because they're easier for me

#

and i like them

wind steppe
dusty fractal
#

... not what i said

umbral zodiac
#

i mean this completely uninsultingly but you have to be the only person who ive seen to ever prefer patches over hooks

wind steppe
#

anyways i think i am being ragebaited and frankly i have things to do so im going to go

dusty fractal
#

i said 'i would prefer to not have to use hooks or patches if there's pre-existing implementation'

wind steppe
#

bye chat

dusty fractal
#

how is this ragebait

hardy viper
#

i predict patches will be a lot more popular when better tooling for them drops

dusty fractal
#

lmao

gusty iron
#

I added a new card area, but what's inside of it doesnt save between game openings, any help?

umbral zodiac
#

more capable yeah but theyre also more prone to failure because targets can be fucked with by other mods

#

which is kinda the only reason you would want to avoid them

dusty fractal
#

then u just target better

#

or dont target at all

umbral zodiac
#

also its just more complicated to do believe it or not

dusty fractal
#

anyway

#

i dont really care that much i just

umbral zodiac
#
local olda = a
function a(...)
  return olda(...)
end
``` is more memorable for a lot of people
dusty fractal
#

needed to defend myself from this example of silliness

#

I don't stand for illogical trickery

hardy viper
#

patches are faster/more sanitary/more capable
hooks are significantly easier to write and (sometimes) debug

some of us have different priorities than others and that's okay, i think the majority of the disagreement here is not over what the strengths/weaknesses of the two but how much we value those and that is completely subjective and should not be in argument

dusty fractal
#

and wacky nonsense

#

k

#

i have literally never said any of the things people have started arguing or defending

hardy viper
#

youre responding like im speaking directly to you which i am not

dusty fractal
#

i dont get why NOBODY has said they like patches over hooks because i think they're better

shell timber
hardy viper
#

fuck if i know i havent written a single line of code for it

#

ask ethan