#💻・modding-dev

1 messages · Page 111 of 1

wintry solar
#

Is your mod on GitHub?

faint yacht
#

The latest "release" is... the WIP isn't so far.

wintry solar
#

Ah okay, I can test it on my dev branch tomorrow if you send me a copy

#

But I should probably get to bed now

faint yacht
#

If I don't forget, sure. And rest well.

merry raven
wintry solar
merry raven
#

Do you want the entire thing?

wintry solar
#

Just a screenshot please

#

Easier to read on mobile

merry raven
#

Yeah I'm not sure which part of the crash log to give ya, but here ya go, tell me if you need more

crisp coral
#

@hardy viper i'm curious about how deepfind helps with nodes[1] spam

merry raven
wintry solar
#

Try updating smods

rough furnace
#

also did you try making a new save and then getting your joker again

merry raven
#

I'll try it later

#

Also damn SMODS got an update? I just started modding like 4 days ago

wintry solar
#

It updates most days

sturdy compass
rough furnace
#

the other day we had at least 7 updates in a day

merry raven
#

Oh what the fuck I made a new run and then it worked 💀

rough furnace
#

probably old save before you added extra

crisp coral
hardy viper
# crisp coral <@386527270015336450> i'm curious about how ``deepfind`` helps with ``nodes[1]``...
local uinodes = thisUIFunc()
--lets say we have some object, with something in the config, but we cant use get_uie_by_id.
--so we'll look for value "this_val"
local df = SMODS.deepfind(uinodes, "this_val")
--the value can be anything, a string, a number, a table (although it would have to be a reference to a table. {3} == {3} is of course false
--its important to note that we can use ANY table, not just ui stuff
local firstMatch = df[1]
--order is undefined. ideally theres only one match, but all that are found are returned.
local tblfound, index, tree = firstMatch.table, firstMatch.index, firstMatch.tree
--tblfound[index] is our value
--tree contains the way we'd get to our object.
--since the index is inside a table, we dont want the last object in the tree (which is index) or the second last (which is tblfound). we want the third
local traverseTarget = uinodes --we modify this. this will end up becoming the third last.
for i = 1, #tree - 2 do --since we don't want the last 2 objects in the tree
  local ind = tree[i]
  --the indice to find the next step in the tree towards our desired object
  traverseTarget = traverseTarget[ind]
  --and set traverseTarget
end
--[[
now traverseTarget points to the target we wanted, without any need for nodes[1] shenanigans!
and while yes, this is a bit longer, it's better because
1. it's more flexible (so if a node is inserted at index 1 somewhere, this will still work, whereas nodes[1] chaining will break)
2. it can become shorter if you define a small helper function
]]

edit because there's a link to this on the thing: this can be done much easier with objtree:

local uinodes = thisUIFunc()
local objtree = SMODS.deepfind(uinodes, "this_val")[1].objtree
local target = objtree[#objtree-2]
--done!
crisp coral
#

{3} == {3} is of course false WHAT

edgy reef
hardy viper
merry raven
#

There we go, I discarded 3 cards next to it and got this
Now I just need to add some flair like a popup that comes up when you discard a card next to it, and a tracker in the description (like the "Currently" grey text trackers that jokers have)

But Enhancements don't have return statements, what can I use?

hardy viper
#

since you're making two different tables, even though they share the same values, they have different references

#

so they compare as false

#

same thing goes for functions

#

(and userdatas)

#

not anything else though

edgy reef
#

Is this why === exists?

#

Or is that something else

hardy viper
sturdy compass
#

Behold,
James

wintry solar
merry raven
edgy reef
fallen tendon
#

i am so confused

hardy viper
#

most use them for "looseness"

fallen tendon
#

this joker is supposed to give x mult when only 1 card with a red stud sticker scores

#

but it does nothing

hardy viper
#

like in javascript, "3" == 3 is true, but "3" === 3 is false

fallen tendon
#

and i immediately just saw it

#

WHYYYY

hardy viper
#

=== is for things that are absolutely the same, and == allows you to be more loose with your comparisons

wintry solar
fallen tendon
#

I ISPELLED INDIVIDUAL

hardy viper
#

😭

fallen tendon
#

I AM DYING

#

I SPENT 30 MINUTES ON THIS

merry raven
edgy reef
#

Better than me making repetition plural xddd

merry raven
#

I spent so long trying to debug my Enhancements only to realize I forgot a comma

hardy viper
#

from what i've seen, theres 3 ways to compare whether tables are the same (at least in lua)

  1. use a recursive comparison function that will test for differences between the table, and return early if they're different anywhere
  2. use the same metatable for all the objects of a certain type, so that two different table objects constructed the same way can be seen as equal if they have the same metatable
  3. assigning objects ids and checking those against each other
#

you can also use a non-recursive comparison function but thats kinda lazy and doesnt usually work when things are nested

#

and everyone knows recursion is the best thing since butter on toast

karmic kelp
#

how's it compare to sliced bread tho?

hardy viper
#

slicing bread is honestly overrated

#

just take a big bite out of the loaf

merry raven
#

Not me just looking through chat history trying to figure out how to use card_eval_status_text more and then dropped on my knees when reading this

hardy viper
#

om nom nom

faint yacht
merry raven
#

Oh shit nice

#

How much of a hassle was it

faint yacht
#

Not too much, in the end.

#

Whole thing is 12 lines.

wooden nexus
#

Okay question

#

How do i add text there

#

the effect works but the text doesn't

karmic kelp
#

(the effect being 1 mult from what I understand)

rough furnace
edgy reef
#

oh yeah string coercion exists

wooden nexus
edgy reef
#

chillin

wooden nexus
#

Trying to figure out how to give text to a playing card

#

Card on the left uses the default from hiker, but the card on the right gives a bonus mult

merry raven
#

Wonder how can I add this tracker into my Enhancements? Does SMODS.Enhancement take in loc_var?

hardy viper
#

you can

#

tkqae that code

wooden nexus
hardy viper
wooden nexus
#

i see

#

Lucky me, I found their discord post

#

they have a copy/paste of what i need

hardy viper
#

i mean

#

i did link it

merry raven
#

What is programming but not stealing from one another

hardy viper
wooden nexus
#

Oh now i got the opposite problem

#

it's showing it twice now

hardy viper
#

strange

wooden nexus
#

oh because I think i put it twice

#

lol

#

Now I can make the minor arcana

#

I'll probably do wheel of fortune style for the xmult and dollars

#

I know it's crazy to have chance for xmult and yet someone could just perkeo the 2 of Cups to constantly get a 50% chance

#

or just ace of wands it to get +15 guaranteed each time

#

But Perkeo is Perkeo

#

it'll break everything

merry raven
#

Perkeo does whatever it wants

wooden nexus
#

The only balancing is that you can only do it to 1 card each time

#

max_highlighted is 1

sturdy compass
#

Is there any way to easily retrigger a Joker in this context?

teal estuary
#

-# wait all you need is context.carearea == G.jokers to make a joker retrigger?

sturdy compass
#

Maybe? I'm not even sure myself

elder vapor
hardy viper
#

naw its other_card

teal estuary
elder vapor
#

also context.repetitions is missing

hardy viper
#

ah wait

elder vapor
#

context.individual is smth else

hardy viper
#

it seems like context.other_joker is a thing

#

for post_trigger for some reason

sturdy compass
hardy viper
#

context.repetition no s btw

elder vapor
#

oops

hardy viper
#

also pretty sure for context.repetition the card in the return is the card doing the repetition

#

and by pretty sure i mean 100% sure

#

(this is vanilla code, self in this and card in an smods calculate are the same)

stray warren
#

Doesn't card get autosupplied if it's missing?

hardy viper
#

..?

stray warren
#

Forget whatever I said, I can't make sense of it in my head

#

it had meaning at one point

sturdy compass
#

ok I've changed it to this but it's still not retriggering the cards thunking

elder vapor
#

try context.other_joker instead of context.other_card

teal estuary
#

is there anyway to stop an enhancement from spawning in booster packs? cant see anything on the docs

elder vapor
stray warren
#

Is there even a time when context.repetition and context.cardarea == G.jokers are passed at the same time?

teal estuary
elder vapor
#

okay so you want to use the in_pool function

#

i think you can just return the result of #SMODS.find_joker("j_prefix_key") > 0

sturdy compass
elder vapor
#

hmmm

elder vapor
#

try removing the context.cardarea check

elder vapor
teal estuary
#

i shall try it

#

ty

sturdy compass
elder vapor
#

revert back to other_card and try again

#

i thought that was a valid field, guess i was mistaken 😭

faint yacht
# sturdy compass

?

if context.retrigger_joker_check and not context.retrigger_joker and context.other_joker and context.other_joker.ability.perishable then
  return {
    message = localize('k_again_ex'),
    repetitions = 1,
    card = card,
  }
end

🍞

sturdy compass
#

Nope

#

btw where are you getting those retrigger contexts?

faint yacht
#

That's how my Start Menu Joker retriggers other Jokers with the edit to include perishable check.

wooden nexus
#

Uh...

sturdy compass
wooden nexus
#

Odd. Lemme try with self instead of center

#

idk why it crashed

faint yacht
#

I was suggested such back when I made it originally.

sturdy compass
#

interesting

#

I wonder why that's not working on my end then

faint yacht
#

¯_(ツ)_/¯

sturdy compass
#

Set a console message to send whenever it tries to trigger and it apparently doesn't make it past the checks

#

I just removed the perishable check and that wasn't it either. Huh

merry raven
#
SMODS.Enhancement {
    key = "devour",
    loc_txt = {
        name = "Devour",
        text = {
            "Discarding cards adjacent",
            "to it will grant {C:mult}+5{} Mult",
            "Resets when played",
            "{C:inactive}(Currently {C:red}+#5#{C:inactive} Mult)"
        }
    },
    atlas = 'Enhancements',
    config = { extra = { mult = 0 } },
    pos = {x=1, y=1},

I want to add a tracker in the description of an Enhancement, but since they don't use return functions, how am I going to track additional mults added to it?

faint yacht
sturdy compass
#

Changed back to this and still no sign of it trying to trigger. I am so confused

merry raven
# merry raven ``` SMODS.Enhancement { key = "devour", loc_txt = { name = "Devo...

No wait I got it working, just had to add loc_vars

    key = "devour",
    loc_txt = {
        name = "Devour",
        text = {
            "Discarding cards adjacent",
            "to it will grant {C:mult}+5{} Mult",
            "Resets when played",
            "{C:inactive}(Currently {C:red}+#1#{C:inactive} Mult)"
        }
    },
    atlas = 'Enhancements',
    config = { extra = { mult = 0 } },
    pos = {x=1, y=1},
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    calculate = function(self, card, context, effect)......```
faint yacht
sturdy compass
#

That was it holy shit

#

Thank ya kindly

jade glen
#

how would i change the return value of a vanilla function

#

nvm got it

sturdy compass
#

What is the extra value in the return block?

faint yacht
#

For message stuff.

spiral stirrup
#

Funny mushroom Spectral Card....

sturdy compass
#

Well yes, but why is it not a regular message return?

jade glen
#

how would i make an option like this in my mods config page

sturdy compass
#

I guess I'm moreso asking what the function of extra is as opposed to what it is

faint yacht
#

common_events.lua, card_eval_status_text function may provide more info.

sturdy compass
#

huh

#

I see

#

I am so confused. I've literally done this same thing before and it worked fine

#

still crashing with that included

#

yep

#

there is more

#
   calculate = function(self,card,context)

        if context.joker_main and card.ability.extra.streak > 0 then
            return {
                mult_mod = 15 * card.ability.extra.streak,
                chip_mod = 30 * card.ability.extra.streak,
                message = 'Streaked!',
                colour = G.C.MULT
            }
        end

        if context.after and context.cardarea == G.jokers then 
            card.ability.extra.hands = card.ability.extra.hands + 1
        end

        if context.end_of_round then
            if card.ability.extra.hands == 1 then
                card.ability.extra.streak = card.ability.extra.streak + 1
                return {
                    message = 'Streak ' .. card.ability.extra.streak,
                    colour = G.C.CHIPS
                }
            else
                card.ability.extra.streak = 0
                return {
                    message = 'Reset',
                    colour = G.C.RED
                }
            end
            card.ability.extra.hands = 0
        end
    end
#

Genuinely no clue how it thinks the variable isn't a number

#

Yes

merry raven
#

I want to try adding an Enhancement that ranks up cards, but I'm a bit lost on where to start
It's not just as simple as just incrementing the card's id right?

hardy viper
#

and it's not the above one

#

i would go to wherever that function is in the smods source code and just look above and below it and see if the increment function is around there

merry raven
#

Which part or file of the source code should I look into?

hardy viper
#

the part where the change_base function is

#

which is probably in src/utils.lua but you can just ctrl f the entire source code

merry raven
#

Is this it?

-- Change a card's suit, rank, or both.
-- Accepts keys for both objects instead of needing to build a card key yourself.
function SMODS.change_base(card, suit, rank)
    if not card then return false end
    local _suit = SMODS.Suits[suit or card.base.suit]
    local _rank = SMODS.Ranks[rank or card.base.value]
    if not _suit or not _rank then
        sendWarnMessage(('Tried to call SMODS.change_base with invalid arguments: suit="%s", rank="%s"'):format(suit, rank), 'Util')
        return false
    end
    card:set_base(G.P_CARDS[('%s_%s'):format(_suit.card_key, _rank.card_key)])
    return card
end
#

Holy shit there's a bunch of good shit in utils.lua

hardy viper
#

there is

#

ah cool

merry raven
#

Debuffing cards, adding cards, finding cards, insert pool, etc

hardy viper
#

deepfind when my pr gets merged fore

merry raven
#

I also want to make another Enhancement where if you discard it, it adds +N mult to the next hand, but I'm not sure if there's a context or anything that detects the next hand starting, or whether it can add the mult in the background without scoring a card

sturdy compass
#
SMODS.Joker { -- Streaker
    key = 'streaker',
    loc_txt = {
        name = 'Streaker',
        text = {
            '{C:chips}+30{} chips and {C:mult}+15 mult',
            'for each consecutive {C:attention}blind{}',
            'beaten in {C:attention}one hand{}, {C:red}Resets{}',
            'when streak is broken',
            '{C:inactive}Current streak: #1#'
        }
    },
    atlas = 'Jokers',
    pos = {x = 5, y = 0},
    rarity = 3,
    config = { extra = {
        streak = 0,
        hands = 0 -- I know there's an tracker in vanilla but I can't access it at context.end_of_round
        }
    },
    loc_vars = function(self,info_queue,center)
        return {vars = {center.ability.extra.streak, center.ability.extra.hands}}
    end,
    calculate = function(self,card,context)

        if context.joker_main and card.ability.extra.streak > 0 then
            return {
                mult_mod = 15 * card.ability.extra.streak,
                chip_mod = 30 * card.ability.extra.streak,
                message = 'Streaked!',
                colour = G.C.MULT
            }
        end

        if context.scoring_hand and context.cardarea == G.jokers and not context.blueprint then 
            card.ability.extra.hands = card.ability.extra.hands + 1
        end

        if context.end_of_round and not context.blueprint then
            if card.ability.extra.hands == 1 then
                card.ability.extra.streak = card.ability.extra.streak + 1
                return {
                    extra = {message = 'Streak ' .. card.ability.extra.streak, colour = G.C.CHIPS}
                }
            else
                card.ability.extra.streak = 0
                return {
                    extra = {message = 'Reset', colour = G.C.RED}
                }
            end
            card.ability.extra.hands = 0
        end
    end
}```
sturdy compass
#

Yep that did it. Not sure why it was giving me the other error then. Thanks a bunch

sturdy compass
#

This is a fun guy when you get him early lol

sturdy compass
#

I'm trying to double chips at joker trigger, but it's only multiplying by the base chip total of the hand type. Any ideas on how I can get it to calculate from the chip total at the time of trigger? Setting the context to final_scoring_step does make it work but it doesn't visually trigger the joker

if context.joker_main then
   return {
      chip_mod = G.GAME.current_round.current_hand.chips * 2,
      message = 'x2',
      colour = G.C.CHIPS
   }
end
#

Even then, it doesn't trigger in the order it should, as I want position in hand to have an effect on the scoring

#

joker_main is close but has the aforementioned problem of taking hand type chips instead of current total

#

Oh I see

faint yacht
sturdy compass
#

just hand_chips? no extra specifiers to add on?

#

Like so?

#

nvm just tested it. Thank you!

#

Yeah I realized that and changed it lol

#

Yeah I'm also very surprised

#

I saw that variable mentioned in state_events.lua but would have never guess it was globally accessible

wintry solar
#

hand_chips and mult are global for current scores values

merry raven
#

Is there a context for checking if a hand is played? There's context.first_hand_drawn but not sure if that's what I'm looking for

It's for an Enhancement that adds +N mult to the next hand played, and I'm a bit lost

sturdy compass
#

Not sure about a context but I know G.GAME.current_round.hands_played exists, I feel like that may help with that fuctionality

merry raven
#
local last_hand = G.GAME.last_hand_played
if card.ability.extra.mult > 0 and G.GAME.current_round.hands_played > last_hand then```

Apparently one of the conditions of the if statement doesn't return a number, which one doesn't?
faint yacht
#

Could always do a print(card.ability.extra.mult, G.GAME.current_round.hands_played) before the if to check what is nil.

wintry solar
#

Last_hand would be a string here

merry raven
#

Maybe I can use something like tonumber?

wintry solar
#

No

#

G.GAME.last_hand_played is a string with the hand name

merry raven
#

Ohhh like "Five of a Kind" or something?
Shit

wintry solar
#

Yes

merry raven
#

What can I use instead to track the last hand played
Or track the number of hands played

#

No wait

#

I already have it it's just G.GAME.current_round.hands_played

#

Is there an easier way to track hand transitions?

#

Yeah I'm scrapping this idea haha, gonna do something else
The Enhancement could now add mult to the mult score with every card alongside it getting discarded, but I got an error talking about attempt to perform arithmetic on global 'mult'

Does SMODS.Enhancement not have support for the global mult value?

#

i see you there Ali

wintry solar
#

The value doesn’t exist when you’re discarding

merry raven
#

Ough

#

Man I'm running out of ideas to even scrap

merry raven
wintry solar
#

The mult value only exists when the game is calculating a hand score

merry raven
#

Is there a function that destroys a card?

faint yacht
#

card:remove() is quick and easy.

crisp coral
#

card:start_dissolve() has an animation

merry raven
#

I was warned about "ghost cards" or something

crisp coral
#

oh

#

context.destroying_card

#

return true to destroy

merry raven
#

Is that for actually destroying the card or checking if a card is destroyed or not

crisp coral
#

former

#

the card being checked for destruction is context.destroying_card

merry raven
crisp coral
#

remove is for destroying a card outside the card calculation loop

#

however, context.destroying_card (in a card's calculate function) must be used during calculation (instead of before, after or joker_main contexts)

merry raven
#

I see I see, I'll see what I can do, thanks for the help

#

And card:start_dissolve() is just playing the dissolve animation right?

crisp coral
#

yeah

#

it also destroys the card

nocturne garnet
#

why the fuck is it not above white stake

#

wtf happened 😭

#

my stakes arent stakin

merry raven
crisp coral
#

no

stiff locust
#

you need to do the destruction during context.destroying_card or it makes ghost copies of the cards right

crisp coral
#

it destroys the card and plays the dissolve anim

faint yacht
#

card:start_dissolve() is the fancy animated removal.
card:shatter() is used for Glass cards.
card:remove() just removes without anything fancy.

merry raven
#

Aye thanks for the clarification

thorny adder
#

Gay jokers should be a mod too ngl

#

"genderfluid joker : when you play 5 cards with 3 cards of them same suit, make the other two that suit"

stiff locust
#

i don't know how to explain that there's something wrong with attributing genderfluid to gay

#

if you were going to make a mod that included this it would probably be better named "gendercast" or something like that

tidal edge
#

LGBTJ+ Jokers, the J is for Joker

stiff locust
#

genderfluid isn't a sexuality

merry raven
#

Or can it just be used on its own

thorny adder
#

Yes

thorny adder
#

I would love to make a mod just to piss em off

tidal edge
#

who woulb even care?

#

like genuinely i bont think i know a single person like that anb i've talkeb to like 1000 people on this biscorb

stiff locust
#

hold on so let me get this straight

tidal edge
stiff locust
#

no

tidal edge
#

pun not intenbeb ):

stiff locust
#

you want to make a mod for a poker roguelike game to annoy "the cis" you speak of them like a negative group and i'm confused by that

tidal edge
#

honestly i just think the concept makes for funny gameplay ibeas i bont know what that other person is talking about

thorny adder
#

"saphic joker : all hearts give x1.5 mult when scored"

nocturne garnet
#

bloodstone

tidal edge
nocturne garnet
#

but better

thorny adder
#

Yeah but its a lesbian bloodstone

#

So its better

nocturne garnet
#

ohhhh

#

i see

stiff locust
#

oh my god

tidal edge
#

"Gay Joker - +4 Mult" wowie its so much better than the olb homophobic joker! i am very goob at besigning jokers!

crisp coral
merry raven
#

i can't count how many enhancements I have made that there's another Joker which does the same thing

royal ridge
#

holy shit it's madeline

thorny adder
#

Omg I know

merry raven
#

I can not for the life of me keep track of 150 jokers

thorny adder
#

It could be stamps

#

Like red stamp gold stamp

#

What is it called again

#

Seals

#

But its flags

tidal edge
#

i just think you're being uncreative with the ibea now

thorny adder
#

And you get them in a lgbt pack at the shop

#

Seals but for jokers

crisp coral
#

so stamps

thorny adder
#

Yeah !

#

But its flags

tidal edge
#

no but that sucks because thats alreaby been bone by like 500 people

#

you cant just

#

take that ibea

#

when its alreaby been bone

merry raven
#

Up your creativity game mate, if you want a Lesbian card
"Score +N mult for each Queen when two or more Queens are played together"

tidal edge
#

bloobstone clones are NOT it when it comes to creative jokers

stiff locust
#

you have a problem with your D key typing B

tidal edge
#

i just use b to replace it

stiff locust
#

oh

merry raven
#

Did it break

crisp coral
#

kid named on-screen keyboard

stiff locust
#

you should get a replacement

tidal edge
tidal edge
stiff locust
#

you can get replacement laptop keys

merry raven
#

Just copy paste the letter

stiff locust
#

i'm on a laptop i've done that before

tidal edge
#

you can? thats cool ill try that somebay

merry raven
#

Typing d probably just as fast as copy pasting

tidal edge
stiff locust
#

windows key +v for clipboard history

tidal edge
#

oh ok

thorny adder
#

Or bind a key you dont use a lot to d

tidal edge
#

ANYWAY we're getting off topic

#

what were we talking about

stiff locust
#

yeah i don't think being on topic here is a good idea

thorny adder
tidal edge
#

not the specific topic

stiff locust
#

this idea would be absolutely tragic if this guy was involved uhh

#

any splatoon players

thorny adder
#

Me

#

Lmao

stiff locust
#

other than you

tidal edge
#

what does that have to do with it

thorny adder
tidal edge
#

shit i accidentally bold my text how does that even HAPPWNEWNE

thorny adder
#

You're bad too

tidal edge
#

what??#

thorny adder
#

You assume splatoon players are lgbt

royal ridge
tidal edge
#

what did i even say

thorny adder
#

Not good

thorny adder
stiff locust
#

i was going to ask for effect ideas.

thorny adder
#

Oh

#

Bruh

#

💀

stiff locust
#

because the last effect we had didn't work since talisman doesn't like playing cards

thorny adder
#

Huge bruh moment over here

tidal edge
#

i didnt even know that stereotype existed, you should stop assuming things magistas - slotmachineTBOI

stiff locust
#

can't do xchips

thorny adder
stiff locust
#

no xchips doesn't work on seals

#

talisman just doesn't have it

thorny adder
#

You need to make a custom xchips

#

Its one line of code

stiff locust
#

how is it one line of code and talisman hasn't done it yet

thorny adder
#

Idk

royal ridge
thorny adder
#

No

stiff locust
#

i guess that's true

thorny adder
#

Its a tiny line of code

tidal edge
#

if pneumonoultramicroscopicsilicovolcanoconiosis then

thorny adder
#

That you add before applying xchips

stiff locust
#

and what would that be

tidal edge
#

question mark

stiff locust
#

they'll probably need some time

thorny adder
#

Here

crisp coral
#

.

#

that adds 100 flat chips

#

what

thorny adder
#

No

#

I tried

#

It works

stiff locust
#

this method is
very flawed

thorny adder
#

Wait Im forgetting a message

#

Hollup

crisp coral
#

yeah you did

royal ridge
#

lmao

tidal edge
crisp coral
#

chips_mod = hand_chips * (config.Xchips - 1)

thorny adder
#

There

stiff locust
#

that doesn't solve the message problem

crisp coral
#

i'd assume seals also have calculate functions

stiff locust
#

the message isn't localized and can't be changed with the value

crisp coral
#

haven't read the documentation for that

stiff locust
#

same for vouchers (kinda)

thorny adder
#

The message thing does work

#

Its in my mod

#

It works

crisp coral
stiff locust
#

the message works but it doesn't change with the value

thorny adder
crisp coral
#

it's in misc.v_dictionary

#

you can define something like this

#

then use that for your localization

stiff locust
#

right

#

i'm going to split localization and then try this

merry raven
#
calculate = function(self, card, context, effect)
        if context.destroying_card and context.destroying_card == card then
            return true
        end

        if context.pre_discard then
            if table.contains(context.full_hand, card) then
                local rank_sum = 0
                for _, discarded_card in ipairs(context.full_hand) do
                    if discarded_card ~= card then
                        rank_sum = rank_sum + discarded_card:get_id()
                    end
                end
                
                if rank_sum > 0 then
                    card.ability.extra.mult = rank_sum
                    card_eval_status_text(card, 'extra', nil, nil, nil, {message = "Volatile!"}, G.C.MULT)
                end
            end
        end

        if context.cardarea == G.play and not context.repetition then
            if card.ability.extra.mult > 0 then
                effect.mult = card.ability.extra.mult
                context.destroying_card = card
            end
        end
    end

I'm still trying to figure out the card destruction mechanic, it's just not getting destroyed at all after the card with this Enhancement is scored

wintry solar
#

Oh yeah I don’t think enhancements have destroying contexts in main branch

wintry solar
merry raven
#

💀

#

Man enhancements are really built differently

crisp coral
#

oh

#

enhancement

#

💀

#

uhmmmmm check Glass Card?????

merry raven
#

Yeah it has shatter, but can I modify it to play a different sound or something?

nocturne garnet
#

dunno whats happenin

crisp coral
#

no like Glass Card code

wintry solar
merry raven
#

Yeah Glass Card has card:shatter()

wintry solar
#

Glass card is hard coded

crisp coral
#

okay yeah you need to lovely patch a lot for enhancement destruction to work

wintry solar
#

-# just wait for better calc to fix everything

merry raven
#

Agony

crisp coral
#

grr

merry raven
#

What's better calc? A part of Steamodded or something?

wintry solar
#

But now we have better calc 2!

wintry solar
nocturne garnet
#

better calc 2: electric boogaloo

nocturne garnet
#

dang

wintry solar
#

Check wiki for formatting

stiff locust
#

it just uses the +chips message with the amount of chips added

crisp coral
#

hell

wintry solar
#

But yeah, ejwu built enhancements in a really weird way

crisp coral
#

is the message hardcoded for chips_mod

#

💀

wintry solar
#

Yes

#

💀

crisp coral
#

when in doubt, SMODS.eval_this

wintry solar
#

-# better calc 2 fixes this too

stiff locust
#

also how do i do the localization for a seal

merry raven
#
if context.cardarea == G.play and not context.repetition then
            if card.ability.extra.mult > 0 then
                effect.mult = card.ability.extra.mult
                card:shatter()
            end
        end

Something like this?

stiff locust
#

i tried doing it the way you do jokers but replacing the category with seal

#

and added a label area because they use those but everything is error/empty

wintry solar
#

Seals go in Other iirc

stiff locust
#

oh

wintry solar
#

I don’t recall where labels go

stiff locust
wintry solar
#

It’s modprefix_key_seal too

#

Labels go in misc.labels

stiff locust
#

wait, key_seal?

#

as in i put the key and then _seal after?

wintry solar
#

Yes

stiff locust
#

okay

merry raven
stiff locust
#

like ["sealkey"] = "label contents"?

wintry solar
#

Yeah I believe so

stiff locust
#

it didn't work

nocturne garnet
#

i disabled my mod

#

but every stake

#

is an error

#

i cant advance either

#

im stuck on white stake

#

is my steamodded bugged or something

wintry solar
#

What version of smods are you on?

nocturne garnet
wintry solar
#

No that should be fine

#

Try re-downloading galdur now

nocturne garnet
#

ohhh

violet void
#

I should have Orange Stake unlocked but

wintry solar
#

There might be some things I missed when stake keys were changed

#

But wouldn’t be able to diagnose on mobile rn

nocturne garnet
#

stake keys were changed?

#

dang

thorny adder
nocturne garnet
#

dang

wintry solar
#

Did re-downloading fix the message at least?

plain apex
#

the odds are displaying as nil in nil and the messages are not displaying but the card does work

SMODS.Consumable{
    key = 'DoubleOrNothing', -- key
    set = 'Spectral', -- the set of the card: corresponds to a consumable type
    atlas = 'Jokers', -- atlas
    pos = {x = 4, y = 1}, -- position in atlas
    loc_txt = {
        name = 'Double Or Nothing!', -- name of card
        text = { -- text of card
            'Has a {C:green,E:1,S:1.1}#1# in #2#{} chance to give 2 spectral packs else give nothing.',
        },
    },
    config = {
        extra = { odds = 2 }, -- Configuration: odds of success (set to 2 for 50% chance)
        no_pool_flag = 'gamble',
    },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = G.P_TAGS.tag_ethereal
        return {}
    end,
    use = function(self, card, area, copier)
        -- Determine outcome based on odds
        local odds = self.config.extra.odds or 2 -- Default odds if not specified
        local roll = math.random(1, 2) -- Generate a random roll between 1 and 2 for a 50% chance

        if roll == 1 then
            -- Success: Grant 2 ethereal tags
            add_tag(Tag('tag_ethereal'))
            add_tag(Tag('tag_ethereal'))
            G.GAME.pool_flags.gamble = true -- Ensure 'gamble' flag is set

            -- Return the success message using the correct format
            return {
                message = "DOUBLE!", -- Display "DOUBLE!" message
                colour = G.C.GREEN,
            }
        else
            -- Failure: No tags granted
            G.GAME.pool_flags.gamble = true -- Ensure 'gamble' flag is set

            -- Return the failure message using the correct format
            return {
                message = "NOTHING!", -- Display "NOTHING!" message
                colour = G.C.RED,
            }
        end
    end,
    can_use = function(self, card)
        return true
    end,
}
nocturne garnet
violet void
wintry solar
#

Oh snap did that fix actual unlocking too?

nocturne garnet
nocturne garnet
#

its sorta

#

half fixed

violet void
wintry solar
#

Nah need to download from main

plain apex
wintry solar
#

The change I just pushed should only change the message

nocturne garnet
wintry solar
wintry solar
violet void
wintry solar
#

@nocturne garnet @violet void all looks good to me, that change I pushed actually broke it 🤣 I guess you both just had old versions? Downloading from main now should work perfectly

nocturne garnet
wintry solar
#

why on earth isn't this stopping my if block (not from_edition or (from_edition and no_x)) when from_edition = true and no_x = false

violet void
violet void
#

can this be used to tie the sprite as well to each type?

Im using
.children.center:set_sprite_pos({x = 3, y = 4})

right now, but when I go to the menu and resume the sprite is reset

frosty dock
violet void
#

as in?

-# maybe I understood

wintry solar
frosty dock
#

only valid consumable calc thunk

violet void
frosty dock
#

yeah

quaint kiln
#

quick question im currently trying to learn go and is currently coding a basic mod manager for balatro; i was wondering if there was any already to see if i should release it

frosty dock
quaint kiln
#

to install all basic stuff and dependencies

#

including steammods and lovely

#

its my current shitty Work in progress

frosty dock
#

skyline has been working on one for a while now

quaint kiln
#

do you have a link to his github repo by any chance ( im in vacation and bored lol )

frosty dock
#

I'd like one myself haha, it's not published in any way

quaint kiln
#

haaaa i see; might has well see if i can make this one work and release it then

#

worst case nobody uses it and i learned go ; best case someone finds it usefull

frosty dock
#

there are 14 competing standards

quaint kiln
#

prety much lol

#

right now its installing cryptid; do you know any other mods with alot of depedencies ? so i can test it some more painfull mod

frosty dock
#

mods tend to not have a lot of dependencies beyond steamodded and sometimes talisman

#

that is except jen's almanac

quaint kiln
#

now you see giving me a good challeng is where the fun's at

#

ill try to install that one and see

violet void
frosty dock
violet void
#

...lol

frosty dock
#

2 of hearts curse

#

lol

violet void
wintry solar
#

@frosty dock what do you think about building patch targets in to evaluate play?

frosty dock
#

nice fake ping

#

wdym exactly

wintry solar
#

so putting something like -- TARGET: before calculation

frosty dock
#

sure that sounds useful

hardy viper
wintry solar
#

wdym

hardy viper
#

i mean i was under the impression that you changed the goal of your pr to be reworking calculation in its entirety and that looks like the exact same thing as before

wintry solar
#

it's more unifying calculation so that everything is calculated the same way

hardy viper
#

ah

#

i guess thatll make it easier to redo calculation in the long run

wintry solar
#

I don't think calculation as a whole needs redoing

hardy viper
#

it def does

#

its way too wasteful

#

usually around 90% of the calculations done in a hand do absolutely nothing

#

which usually ends up being 10-20% of the time spent during calculation

#

sometimes more sometimes less

wintry solar
#

oh I see what you mean

royal ridge
hardy viper
#

lmao

frosty dock
#

check_enhancement can just not be blueprintable

#

not me just adding context.blueprint = math.huge

teal estuary
#

this might be a little stupid, but if i gave an enhancement -9999 repetitions, would that make it unretriggerable?
-# presuming your not playing cryptid or something

frosty dock
#

probably not

teal estuary
#

☹️

frosty dock
#

it's still tanking perf though hand eval is better

bold sleet
#

is there a way to add one of these things, both manually or automatically?

elder vapor
#

info_queue in the loc_vars function

teal estuary
#

what is p_dollars? is it played dollars? (so activates when played)

sturdy compass
bold sleet
#

...right...

teal estuary
#

does anyone know/is there a way to get the spawn weights of vanilla enhancements?

frosty dock
teal estuary
#

i presume so? im trying to decide what weights to give my modded enhancements, and it'd be useful to know what base game enhancements values are, so i can base them around that 😭

frosty dock
#

I'm even more confused now

#

oh wait

sturdy compass
#

How so? It contains info on how to add an info card, just as they asked

frosty dock
#

you mean editions right?

teal estuary
frosty dock
#

right

teal estuary
#

is there a way to get the weights of steel/glass/lucky, etc etc

frosty dock
#

I think vanilla enhancements are unweighted?

teal estuary
#

oh really?

#

hrm

frosty dock
#

would have to double check but I think so

teal estuary
#

makes sense

sturdy compass
#

It does. It’s how I found out how to do it joeshrug

nocturne garnet
#

i only realized after making the video 😭

runic sinew
wintry solar
#

Default enhancements are unweighted but they’re given a weight of 5 for weights calculations

teal estuary
#

oh so its all equal chances for base? nice

#

ty

wintry solar
wicked leaf
#

steamodded vscode extension when

wintry solar
wicked leaf
#

I do have it there actually lol

royal ridge
wintry solar
#

Just entirely blueprint?

#

That’s easy to test then 🤣

violet void
#

is that the label?
-# and how do I set it?

stiff locust
#

if you're using separate localization then it goes in misc > labels

#

i think? at least that's how it works for seal labels

#

so I assume it's similar

#
["misc"] = {
        ["labels"] = {
            ["modprefix_editionkey"] = "Edition Label",
        },
    },

which would be this?

#

-# also yeah that's the label

wintry solar
#

that’s correct

stiff locust
#

:D

wintry solar
#

Label has no e_ though

stiff locust
#

oh yeah

#

i was close

wintry solar
#

No no as in it shouldn’t have one

stiff locust
#

oh

#

i see

violet void
stiff locust
#

you don't put the label in there

stiff locust
violet void
stiff locust
#

yeah i tried that too the first time

#

on the topic of localization

mine's not working :(

#
["descriptions"] = {
        ["Joker"] = {
            ["j_modprefix_jokerkey"] = {
                ["name"] = "name",
                ["text"] = {
                                  "text",
                },
            },
        },

this is right isn't it

#

i double checked everything and it's not working

#

but this works for other mods

wooden nexus
frosty dock
stiff locust
#

i changed nothing else it simply does not work

#

i shouldnt care as much as i do but something in me doesn't want to share full code until it's finished

frosty dock
#

it should work then

stiff locust
#

that's the thing it just doesn't

#

the prefix is correct and works for the seal

frosty dock
#

you wouldn't happen to still have a loc_txt on the joker?

stiff locust
#

i removed it from the joker

#

it all just comes up empty/error

frosty dock
#

name of the loc file?

stiff locust
#

default

merry blade
#

howdy balatro mod squad, i'm currently working on expanding milck's QoL mod to allow me to use the keyboard to navigate the game's UI but i'm running into trouble when attempting to buy anything from the shop... the game crashes and says "attempt to index field 'buttons' (a nil value)" as soon as i hit the key to execute the buy action

#

which i believe makes sense as i'm likely not passing the correct context to the function and in various iterations of attempting to get it to work it says that the ref_table is nil but where i get stuck is how to pass the context itself when executing the action (or whether or not i'm missing something alongside the context)

frosty dock
#

why do that when you can just emulate a controller

merry blade
#

actually

#

huh good point

frosty dock
#

-# actually there's one reason, mod support for controllers is historically not great

#

either way the controller emulation already exists

violet void
#

I tried but failed

heady pumice
#

got a question, is there any documentation for the SMODS class? drawing a blank here

frosty dock
#

suits and ranks support adding tooltips through loc_vars

frosty dock
heady pumice
#

i guess i just totally glazed over the sidebar, my bad.

violet void
#

but idk how to add it

frosty dock
#

what's the card then

violet void
#

a joker

#

its the garden plot of the other time

wintry solar
#

You can add almost anything to the info queue

frosty dock
#

then use the joker's loc_vars??

violet void
#

im sorry if im upsetting you .-.

frosty dock
#

oh i misunderstood you, sorry

wintry solar
#

Throw it in the loc tables and use {set = whereveritis, key = key}

frosty dock
#

you can add any localization entry to use for a tooltip through a loc file

faint yacht
#

What key is responsible for "undiscovered" cards having different names, if that's a thing?

heady pumice
#

sorry to bother, is there a debug console i can use? ive tried every key and ive searched around but i want to be sure it isnt another package i need to download.

faint yacht
heady pumice
#

thank you

violet void
sturdy compass
#

Is it possible to get an Idol-like function where the joker has a rotating variable condition that needs to be met to trigger?

wintry solar
frosty dock
heady pumice
#

i want to make a planet card that upgrades two non-custom hands, how can i do this? i cant find much documentation on consumables, and the example mod in steamodded containing 'vulcan' upgrades only its own custom hand, the royal flush.

frosty dock
heady pumice
#

the card?

frosty dock
heady pumice
#

i thought cryptid duplicated playing cards. is that a mod?

frosty dock
wintry solar
heady pumice
#

got it. thanks for your patience

sturdy compass
frosty dock
#

you just define this function and steamodded will take care of calling it each round

frosty dock
#

at least it has contrast

#

(and maybe i shouldn't have upscaled my reference by 1.5x only to scale the sprite later, time to undo that)

sturdy compass
frosty dock
#

you want the global stored somewhere in G.GAME

wintry solar
sturdy compass
frosty dock
#

the 20px looks worse smh

frosty dock
edgy reef
#

It looks nice but gives off a vector art feel which doesn't match with everything else

sturdy compass
violet void
# wintry solar Oh it needs `specific_vars = {}`too

I've put it as an empty array because it doesnt have dynamic values but it still gives empty text in-game

Im also looking at Cryptid and it does the same thing

I noticed only using "Other" as set works for some reason?

#

With "Other" as set

guess Ill keep it like this

thanks!

frosty dock
sturdy compass
#

It's really that simple? Dayum that's nice. Thank you for the help

frosty dock
#

made the borders less sharp and went closer to balatro black instead of pitch black

#

this is fine i think, maybe it should be a little smaller?

#

actually maybe not

gaunt thistle
#

there's no scrollable viewport UI component in vanilla Balatro, right?

#

gotcha, thanks

#

I've been meaning to play around with smods so this might be a fun challenge

frosty dock
#

yeah so maybe this is a bit excessive (50 non-blueprint jokers)

#

basically every call to get_id is asking each joker for extra enhancements

wintry solar
#

how do I print this table

frosty dock
#

and every call to is_suit is doing so twice

frosty dock
wintry solar
#

looks useful

#

I'd like to run it on my dev branch

frosty dock
#

ok i've just pushed my changes

sturdy compass
#

I feel like I'm missing something in terms of how this is meant to be structured

violet void
#

same here

#

Or is this how its meant to be?

frosty dock
#

but also SMODS.maximus should be SMODS.current_mod

sturdy compass
#

I think I found it as a rogue end

#

ok it seems happy with that now, but now it's mad at me for trying to pass it in the joker config

frosty dock
frosty dock
#

you just use the value from G.GAME when you need it

frosty dock
#

you should still use a fallback in case your joker is viewed from the collection, this avoids having to hook into init_game_globals

violet void
#

yeah about that I have a question

If I want to add a new G.GAME var in current_round, would I need to do so with a lovely patch?

frosty dock
#

you can do that with a simple hook

#
local igo = Game.init_game_object
Game.init_game_object = function(self)
  local ret = igo(self)
  ret.current_round.my_value = my_table
  return ret
end
fading fox
#

idk if this is the right channel but can someone more experienced in pixel art tell me how I can improve the design for my consumables?

#

art is not my strong suit

sturdy compass
#

Fascinating

elder vapor
#

i kinda want to make a slay the spire mod for balatro but not sure if i should turn a bunch of relics into jokers or smth else

violet void
#

-# Im becoming too reliant on lovely patches

frosty dock
#

that's not how you declare a function

#

needs function keyword

violet void
#

yes

#

that was the missing part
-# like in cryptid's

sturdy compass
#

I just realized that and declared it as such, however

frosty dock
#

oh smh

#

you removed an end that should have stayed

sturdy compass
#

😭

frosty dock
#

it's just that the malformed function declaration had everything have an extra end

#

because it wasn't closing the function

#

-# i'm part of the 98%

violet void
#

like this

sturdy compass
#

Alright finally launching Prayge

sturdy compass
#

Ok I'm very close to having this working, I just need a way to set the card description to the right conditional when it changes. I'm also realizing I'm not too sure how to properly get a fallback set

violet void
sturdy compass
#

Yes

#

Similar to To Do List

violet void
#

it changes every round

sturdy compass
violet void
sturdy compass
#

So the top of main.lua?

violet void
#

yes

#

possibly

#

jokers like castle do it like that though

sturdy compass
#

I'm doing it like this for posterity's sake lol

#

despite a lack of it in the main game

frosty dock
#

it's meant to be the same across all such jokers in the same round

#

you can do end_of_round if you want a different value on each joker

sturdy compass
#

Hmmm, value is still coming up as nil

violet void
sturdy compass
#

Here's the setup now

frosty dock
sturdy compass
#

I am

violet void
#

isnt the fallback for when youre viewing from collection in the menu

sturdy compass
#

It's coming up as nil in collections

frosty dock
#

are you sure it's still nil?

sturdy compass
#

I'm looking at it right now joeshrug

frosty dock
#

even when starting a completely new run and spawning the joker back in?

sturdy compass
#

yes

frosty dock
sturdy compass
#

Just started another new run to double check and it is definitely still coming up as nil in collections

violet void
frosty dock
#

SMODS.load_file:

violet void
#

lemme try

frosty dock
violet void
#

cant assign it to a global variable

violet void
sturdy compass
cinder elk
sturdy compass
#

Indeed he is

violet void
sturdy compass
#

No, the function is setting the condition to nil instead of a hand

frosty dock
#

okay so

#

why is that end there at the end of the statement in the while loop

sturdy compass
#

Yeah I just figured that out as you posted it

#

And that was the problem. I put that end in the wrong spot facepalm

#

And it works! Thank goodness

#

Thank you all so much for your patience

#

Ok this is just silly

violet void
#

you can throw a random fifth card
-# it will score

sturdy compass
#

Surely

violet void
#

mm I'd consider bumping it into uncommon

wintry solar
frosty dock
#

nice

#

also that's much less calc time than I was getting with 50 blueprints

violet void
#

rental playing cards fool

edgy reef
#

Hell yea

wintry solar
#

I don't have retrigger api though

#

still need to figure out how to make that work

frosty dock
#

oh that's probably why

wintry solar
#

though I do have an idea of how to do it

#

just need to try and untangle whatever the hell current retrigger api is

frosty dock
#

make sure to fix #302 when you do

wintry solar
#

I shall try

#

need to work my way through all the other evaluations first

frosty dock
#

(i think it's just out of order from not taking into account that effects are only evaluated coming out of eval_card and not right away)

wintry solar
#

okay

#

from what I understand of the api, when a joker effect is calculated it should calculate all other jokers with context.retrigger_joker_check and then it should recall the current calculation with context.retrigger_joker?

frosty dock
#

yeah pretty much

#

there's some other stuff baked in with callbacks and post_trigger, iirc the callbacks are used by the api to actually eval the effects

fading fox
open dragon
#

thoughts?

#

(excuse the bad art)

wintry solar
frosty dock
wintry solar
#

and callback is there to check that the card has an effect?

frosty dock
#

from what i can see the evaluation of the effects is moved into the callback with some really janky patches

#

so instead of happening when eval_card returns, it happens after all the triggers but still inside calculate_joker

wintry solar
#

right

#

so the evaluation pattern goes through the jokers, finds one that would retrigger other jokers, retriggers them, then carries on?

frosty dock
#

yes

#

ideally we don't need the callback jank and can pass multiple effects out to eval_card

wintry solar
#

the way I was thinking it would work would be that when the eval_card is initially called on a joker, it then goes through all jokers called joker_retrigger_check and then evaluates the retriggers then, but that would lead to different results I think

frosty dock
#

moving retriggers out to eval_card is surely cleaner than that

#

i don't think it has to have different results so long as we ensure consistent use of eval_card

wintry solar
#

oh yeah I think I can move it out, let me have a quick go

#

what I have at the moment works for retriggering effects on playing cards at least

frosty dock
#

then to make sure the agains are in order, eval_card just needs to insert that into the effects with a way to read out the correct order

wintry solar
#

yeah, and the agains should be on the joker that causes the retriggers right?

frosty dock
frosty dock
wintry solar
#

got it

sturdy compass
#

I'm trying to have this joker retrigger any "food jokers" that I have specified in a global table, however my attempts to prevent them from retriggering at the end of a round have not been working for some reason (i.e. it will retrigger gros michel extinction chance when it should not). I've tried checking for the end_of_round context in a ton of different areas but it does not seem to care

narrow pendant
#
              local sold_joker_cost = card.cost
              card.ability.extra.chips =(card.ability.extra.chip_gain+sold_joker_cost)

              card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_gain
               G.E_MANAGER:add_event(Event({
                        func = function() card_eval_status_text(card, 'extra', nil, nil, nil, {message = localize('k_upgrade_ex')}); return true
                        end}))
            end
      end
     
}```
#

@mellow sable this is what i've got at the moment, but it seems like it takes the first card sold, instead of adding on each one

mellow sable
#

card.cost is the cost of your own card

narrow pendant
#

oh okay

mellow sable
#

use context.card.cost

hardy viper
#

how on gods green earth is betmma vouchers crashing here vro 😭

#

local O_type = type(O)
ok

#

it seems it overwrites copy_table

#

thats why

narrow pendant
#

oh it just switches to the most recent card sold

mellow sable
#

couldn't you directly do something like
card.ability.extra.chips = card.ability.extra.chips + context.card.cost * card.ability.extra.chip_gain
(assuming chip_gain is the chip gain per $1 of buy value)

merry raven
#
calculate = function(self, card, context, effect)
        if context.cardarea == G.hand and not context.before 
           and not context.end_of_round
           and G.GAME.current_round.hands_played > card.ability.extra.last_hand_number then
            
            local new_rank = math.min(card.base.id + 1, 14)
            local suit_prefix = string.sub(card.base.suit, 1, 1)..'_'
            local rank_suffix .......

I'm making an Enhancement that makes a card rank up per hand played, but it doesn't work when the first hand is played, but will continue to work normally after the second or further hand is played

last_hand_number is a custom value in the config tag used to track the last hand played as an int

Any insights? The full code is pretty long so I'm only showing a segment of it

torn kiln
#

where do i start making mods / where can i find docs and or a guide

narrow pendant
#

it's the 'k_upgrade_ex' section i believe.

mellow sable
#

you can replace localize('k_upgrade_ex') with a string like "M"

#

although if you want localization support you should make a localization file and use localization calls still

finite vault
torn kiln
merry raven
# torn kiln i dont want that i enjoy coding i just need to know where to start

Start here to install the required clients and mods for modding, they're called lovely and Steamodded, be wary not to install the [DEPRECATED] version, the one we use is in Step 3's Method 3a in the "click here" text
https://github.com/Steamopollys/Steamodded/wiki

This is the documentation, if you have some knowledge of using Lua then it's a good head start
https://github.com/Steamopollys/Steamodded/wiki/API-Documentation

GitHub

A Balatro ModLoader. Contribute to Steamopollys/Steamodded development by creating an account on GitHub.

GitHub

A Balatro ModLoader. Contribute to Steamopollys/Steamodded development by creating an account on GitHub.

merry raven
#

You'll be able to create your own blinds, jokers, enhancements, editions,e tc

hoary sorrel
merry raven
#

Make it say penis

hardy viper
#

ermmm chat when was i gonna be told that copy_table was recursive

hallow forge
#

how did you think it worked?

hardy viper
#

... not recursively

hallow forge
#

how else would it be done?

hardy viper
#

for most uses yes recursion would be good

#

i needed it to Not do that

hallow forge
#

well looks like you have to make your own function

hardy viper
#

already did

hallow forge
#

nice

hardy viper
#

apparently github lua syntax highlighting doesnt recognize [=[ long comments

#

thats funny

#

same

merry raven
#

Phenomenal

mellow sable
#

make it say "m"

#

with jolly joker colors

sturdy compass
#

I'm losing my mind, a Joker I made a couple nights ago that was working perfectly is just all of a sudden not. I didn't even touch that code 😭

hoary sorrel
hardy viper
#

make it say _G[_G] = _G

hoary sorrel
hardy viper
mellow sable
#

peak

finite vault
#

Make it say @

mellow sable
hoary sorrel
finite vault
#

§?

nocturne garnet
finite vault
#

$¥£€

nocturne garnet
hoary sorrel
finite vault
hoary sorrel
#

Ok I don't want to spam too much. One last one?

merry raven
#

The greatest tool to ever grace the face of the Internet

nocturne garnet
hoary sorrel
merry raven
finite vault
#

Make it say 'Amo putas', it means I Love Card Games in my language

nocturne garnet
#

that this is not true

hoary sorrel
#

It is not

hoary sorrel
merry raven
#

Excellent.

finite vault
sturdy compass
# sturdy compass I'm losing my mind, a Joker I made a couple nights ago that was working perfectl...

If anyone could help diagnose this I would really appreciate it. No matter what's being played, it always detects 8 retriggers

    key = 'combo_breaker',
    loc_txt = {
        name = 'Combo Breaker',
        text = {
            'Gains {C:mult}0.5x{} mult',
            'per retrigger in a played hand',
            '{C:inactive}Starts at 1x mult, resets every hand{}'
        }
    },
    atlas = 'Jokers',
    pos = {x = 0, y = 1},
    rarity = 3,
    config = { extra = {
        Xmult = 1.0,
        retriggers = 0
        }
    },
    loc_vars = function(self,info_queue,center)
        return {vars = {center.ability.extra.Xmult, center.ability.extra.retriggers}}
    end,

    calculate = function(self,card,context)

        if context.scoring_hand and context.repetition and not context.blueprint then
            if context.cardarea == G.play or context.cardarea == G.hand or context.cardarea == G.jokers then
                -- Add retrigger to total
                card.ability.extra.retriggers = card.ability.extra.retriggers + 1
                sendTraceMessage('Retrigger logged. Count: ' .. card.ability.extra.retriggers,'MaximusDebug')
                return {
                    repetitions = 0,
                    card = card
                }
            end
        end

        if context.joker_main and card.ability.extra.retriggers > 0 then
            -- Add retrigger count and multiply by 0.5 for mult 
            card.ability.extra.Xmult =  card.ability.extra.Xmult + (card.ability.extra.retriggers * 0.5)

            G.E_MANAGER:add_event(Event({
                func = function ()
                    play_sound('mxms_perfect')
                return true; end
            }))
            
            return {
                Xmult_mod = card.ability.extra.Xmult,
                message = 'x' .. card.ability.extra.Xmult,
                colour = G.C.MULT,
                card = card
            }
        end

        if context.before or context.after then 
            card.ability.extra.retriggers = 0
            card.ability.extra.Xmult = 1.0
        end
    end
}```
gaunt thistle
finite vault
#

Can someone make a simple mod that adds Dead Man's Hand as a Poker Hand above Royal Flush?

gaunt thistle
#

this has the same vibes as asking someone to take a picture of themselves with a shoe on their head

gaunt thistle
#

rewrite it in rust to prove you're not catfishing us

hoary sorrel
#

mirrored or flipped?

gaunt thistle
#

shoe on head

jade acorn
#

is there a good guide for making new mods

#

and how much of lua do I need to know if im good with py and C

#

cause they seem very similar

weak depot
#

i know this would probably be hard to do but i had a dream after working on my mod for a few hours about it and i think i was like. kinda cooking in my sleep here chat what do we think abt this

stray warren
#

Any way to make this so that when a card gets polychromed in the hand, afterward in the same hand it triggers the polychrome effect? Currently it waits until after the hand.

  calculate = function(self, card, context)
    if context.individual and context.cardarea == G.play then
      if context.other_card:is_suit("Spades") or context.other_card:is_suit("Clubs") and not context.other_card.debuffed then
        if pseudorandom('black_rainbows') < G.GAME.probabilities.normal / card.ability.extra.odds then
          G.E_MANAGER:add_event(Event({
            trigger = 'before',
            func = function()
              context.other_card:set_edition({ polychrome = true }, true)
              return true
            end
          }))
        end
      end
    end
  end
faint yacht
#

You'll have to iterate through each card in the context.scoring_hand and do the roll individually within context.before.

stray warren
#

Well, I want the polychrome effect to happen when it is scored, not before the hand is scored

faint yacht
#

You apply the polychrome during context.before... before the hand is scored.

jade acorn
#

or I should also ask, is there someone who would be willing to teach me how to if there isnt a video out there

gaunt thistle
jade acorn
#

that sounds

#

maybe fun

#

significantly less than being taught

gaunt thistle
#

def look up lua syntax because it does some weird stuff

#

yeah you're not going to really get any extensive guides / tuts on this sorta thing

#

it's all learning through osmosis

stray warren
#

Unless I am misinterpreting what you are saying

jade acorn
#

how many people here post their stuff about making new consumable cards

faint yacht
#

By iterating through each card in context.before, you set up the polychrome to be accounted for when the hand actually scores.

stray warren
#

So if I create the event in context.before, will the animation still play when it is scored, and not all at once before it is scored?

faint yacht
#

The applying of edition animation and SFX should play... although I'm not sure about it happening individually. See if it happens... if so, maybe you'll need to end up using events to try the individual route.

merry raven
#

@faint yacht Heya do you still have the lovely patch for SFX for enhancements?

faint yacht
#

I am still using it for the update of my pack, so yes.

merry raven
#

Excellent

#

Cheers mate

faint yacht
#

✌️

merry raven
#

How do you use lovely patches in general? Do i just create a "lovely" folder and drop this in?

jade acorn
#

is there anyone here who has made new consumable cards that could send me over the code to look at? I'd appreciate it a lot

gaunt thistle
#

but I would instead checkout how smods does it

merry raven
#

Gotcha

gaunt thistle
#

you can have a patch file at mod_dir/lovely.toml or as many patche files as you want in mod_dir/lovely

faint yacht
gaunt thistle
#

it'll probably be better to look at a smaller mod, cryptid is a bit of a beast

#

does paperback have consumables?

merry raven
# faint yacht Have at thee.

Thanks for both of yalls insights

But how do ya use this specific patch in an Enhancement? Do I just simply add a sound tag like how I define my atlas? Does it make card_eval_status_text support a sound parameter or something?

faint yacht
#

You know how you can specify message and colour?

#

The same goes for sound then.

merry raven
#

Inside card_eval_status_text?

faint yacht
#

Yeah.

merry raven
#

Gotcha gotcha I'll see if I can make it work

faint yacht
#

You can also define sound when return-ing.

stray warren
# faint yacht The applying of edition animation and SFX *should* play... although I'm not sure...

Ok, so I tried this, but it applies the polychrome effect in context.before and plays the sound after the hand is scored. And obviously it doesn't account for retriggers since it's only checking each card once

calculate = function(self, card, context)
    if context.before then
      for k, v in pairs(context.scoring_hand) do
        if v:is_suit("Spades") or v:is_suit("Clubs") and not v.debuffed then
          if pseudorandom('black_rainbows') < G.GAME.probabilities.normal / card.ability.extra.odds then
            G.E_MANAGER:add_event(Event({
              func = function()
                v:set_edition({ polychrome = true })
                return true
              end
            }))
          end
        end
      end
    end
  end
faint yacht
#

Can't really go more specific than this, I'm still learning stuff myself.

jade acorn
faint yacht
fading fox
#

All the source code for any mod to balatro must be publicly available as stated by Lord Thunk himself

jade acorn
#

oh thats cool

faint yacht
#

Well, technically, I didn't have my mod up on GitHub when I dropped the first version, but I eventually threw it up there.

hardy viper
#

*that is published in this discord server

#

thunk has no jurisdiction over modding that happens outside of here