#đŸ’»ăƒ»modding-dev

1 messages · Page 449 of 1

formal parrot
#

:>

#

Won’t math.random() be better ?

hidden sable
formal parrot
#

Draw cards to consumable slots lol

hidden sable
#

now how can i draw a specific card to hand

#

like if i looped through the cards

#

and have the card object

#

how do i draw that specific card

formal parrot
#

đŸ€·

#

I think ice has something similar but sadly he’s not here :)

lyric maple
#

back from dinner, can i get help with this?

formal parrot
#

You can copy it

#

From vanilla remade

#

😭

lyric maple
formal quest
lyric maple
#

and it still doesn't work 😭

lyric maple
formal parrot
formal quest
#

Nothing will be less than 0

formal parrot
formal parrot
#

Thats why

#

You can find the highest ranking card easily, just by going through cards with for and having. A variable that you compare with

lyric maple
formal parrot
#

Missing parameters

lyric maple
formal parrot
#

It looks fine

#

But game crash said you’re missing parameters

#

Is your file saved?

formal quest
formal parrot
#

Oh

#

😭sorry i poorly understood

#

That also should be easy

#

1 second

lyric maple
formal parrot
formal parrot
#

2 vars

formal quest
#

Still getting nil with number. Does comparing with math.huge normally cause this error?

formal parrot
#

Use config values

#

Variables *

#

Set high and low to the first card index

#

Card.ability.extra.highest=context.scoring_hand[1].base.nominal

formal parrot
#

Don’t use math.huge 😭 thats wrong

formal parrot
#

And use card.ability.extra.highest instead of “highest”

#

For your return do

#
Mult =card.ability.extra.highest-card.ability.extra.lowest}```
molten musk
#

morning folks

sour garden
#
        local other_joker = nil
        local other_other_joker = nil
        for i = 1, #G.jokers.cards do
            if G.jokers.cards[i] == card then other_other_joker = G.jokers.cards[i - 1] end
        end
        for i = 1, #G.jokers.cards do
            if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i + 1] end
        end
        local x = SMODS.blueprint_effect(card, other_other_joker, context)
        x.extra = SMODS.blueprint_effect(card, other_joker, context)
        return x
    end```
i'm trying to make a blueprint that has the ability of both the joker to the left and right, but the game crashes on the `x.extra = SMODS.blueprint_effect(card, other_joker, context)` line with "attempt to index local 'x' (a nil value)
why is x nil here?
formal parrot
molten musk
#

father?

formal parrot
#

Arlecchino

#

(Father)

molten musk
#

oh

formal parrot
#

Lmao

molten musk
#

haha

formal parrot
#

Ahahaha

molten musk
#

didnt expect someone here to play genshin tbh

#

dont know what did i do wrong but the pack is not showing the non-mod cards

formal parrot
#

Does it show ingame ?

molten musk
#

the mod spectral cards show correctly, butthe original spectrals dont instead i see jumbo joker

formal parrot
#

Never done packs before 😭

#

Did you follow references ?

native zinc
molten musk
native zinc
#

granted it's in hiatus

formal parrot
#

Since one is bro a consumable 😭

formal quest
molten musk
native zinc
#

playing mod

molten musk
native zinc
#

though all mods are probably presumed 'playing mod"

molten musk
#

tbh i want a genshin texture pack for jokers

formal quest
molten musk
#

i even have a somewhat ready list of each joker what to be

snow vale
#

what's the error?

native zinc
#

classic talisman

formal parrot
#

Possible

molten musk
#

i know

formal parrot
#

Obelisk

molten musk
#

but i dont do art

formal parrot
#

Zhongli’s pillar

#

😭😭

formal parrot
molten musk
#

exactly

formal parrot
#

I’m shit at art

molten musk
formal parrot
#

Gotten way better

#

Trial and error

formal parrot
molten musk
#

dont have time to do art with other stuff

formal parrot
#

Skirk*

molten musk
#

got her yesterday

#

and her weapon

snow vale
formal quest
#

Functionally it works now

formal quest
#

The text is broken so it still says +0 mult, but it does give mult

snow vale
formal parrot
formal parrot
molten musk
#

it was double too, lost then got it in the same 10 pull

formal parrot
formal parrot
formal quest
formal parrot
#

Return and dont use them in text

#

Don’t do #1#

#

😭😭you can do no loc_vars

#

Its optional

molten musk
formal quest
#

What about the text on the joker?

sour garden
solid grotto
#

I feel like I'm doing localization wrong, shouldn't the "message" and "saved" both refer to my localization file? Why is it not using these?

formal parrot
molten musk
#

dont know what did i do wrong but the pack is not showing the non-mod cards

#

gonna repeat this until someone gives me a sol

snow vale
formal parrot
#

Can’t really do loc_text here with vars without avoiding lag since you’d have to do the calc whenever a card is highlighted

#

Which isn’t as laggy but , the max you can get is 9 mult to doing the math in your head would be more efficient

molten musk
#

after the first then new line

#

after the second one a new line

#

and each end in a seperate line

tall wharf
#

:3

snow vale
#

it was someone

molten musk
#

oh

formal quest
#

I took out loc_vars and it's still saying +0 mult

molten musk
formal quest
#

This is the localize line
message = localize { type = 'variable', key = 'a_mult', vars = { (card.ability.extra.highest - card.ability.extra.highest) * 2 } },

snow vale
#

idk why

molten musk
#

tell him to fix that first

lyric maple
snow vale
#

i mean, he's playing my mod

formal quest
#

Oh it must be that I'm subtracting highest from itself

molten musk
#

@daring fern u there?

vague crest
#

trying to create a joker which retriggers a certain rank twice and changes each round but the retriggers arent working for some reason?

#

im wondering if it's having trouble reading the rank variable for some reason

formal parrot
#

The id method ?

vague crest
#

i think so?

formal quest
#

Yeah, made it subtract lowest from highest and it works perfectly

#

@formal parrot Thanks!

vague crest
#

its pretty much identical to what mail in rebate uses since that deals with ranks too

vague crest
#

hm ok

formal parrot
#

So your variable shouldn’t be a string

#

It should be 14

vague crest
#

when i set it to that it came up as ERROR in the description, how would i localize it?

lyric maple
#

great now this isn't working

function SMODS.current_mod.reset_game_globals(run_start)
    reset_kls_magenta_rank()
end

it's only triggering at run start

#

according to vremade it should be for every round (despite the name)

formal parrot
formal parrot
#

Or just type ace

formal quest
formal parrot
#

Manually

#

If its not changing

solid grotto
#

I've never had this issue and I hadn't edited this joker at all?

#

What's the problem?

#

Can it just not find the picture

formal parrot
#

Is it

#

Ong

#

Png*

solid grotto
#

Yes

molten musk
#

do any of u know how to reach someone on github

native zinc
#

is it named correctly

solid grotto
#

It's been working since I've added it, and I never edited the image

formal parrot
#

I recommend just not doing it

formal parrot
#

It should be in both

solid grotto
#

For 2x what should I be naming it

formal parrot
#

Same

#

Name

native zinc
#

these atlas dimensions are weird as hell

formal parrot
#

Double resolution

solid grotto
#

Alright

formal parrot
solid grotto
#

I followed the first youtube video I found man idk

#

What's wrong with the dimensions

vague crest
solid grotto
#

The joker images have been showing up as intended

#

¯_(ツ)_/¯

native zinc
#

it really should be 71 95 as that's what vanilla uses

solid grotto
#

Is there a 1px border of transparent pixels around the joker

#

I copied the dimensions straight from the sprite sheet

molten musk
#

dont know what did i do wrong but the pack is not showing the non-mod cards

feral tree
#

What am i doing wrong?? trying to have a joker that's ceremonial dagger but it adds 2 to Xmult everytime it destroys a joker, the Joker dissolves, the message shows the correct number but it doesnt actually apply the Xmult!

solid grotto
#

Idk why it wouldn't be working

#

Maybe take the addition out of the function?

#

For some reason?

lyric maple
molten musk
#

chat died

solid grotto
#

My mod is still failing to find the picture for my joker

#

Even though I have everything right

#

Seemingly

static dagger
#

Hey all, I'm trying to make rigged probabilities but it's crashing every time I enter the shop. Anyone have any ideas on how I can help fix this?


local old_pseudorandom = pseudorandom
function pseudorandom(seed, min, max)
    if #find_joker('j_mymod_Hakari') > 0 then
        return 0
    end
    return old_pseudorandom(seed, min, max)
end
static dagger
#

so key = "jammy_seven"

solid grotto
#

What does that do

static dagger
#

The j_ is added automatically by SMOD iirc

solid grotto
#

I really do not understand why it's doing this

#

Should my atlas things be in my localization instead

static dagger
#

I don't think so

#

Can I see your joker definition?

solid grotto
#

Like

#

The text for it in game

#

Wdym

static dagger
#

the part where you write SMODS.Joker{}

solid grotto
#

It's been working since I implimented it, just now the hiccup is happening

static dagger
#

So was it able to find the atlas before?

solid grotto
#

Yes

static dagger
#

Do you have a git repo that you can compare what you changed with?

solid grotto
#

Don't think so

vague crest
#

bumping this because im hoping to figure it out before bed 🙏 trying to keep the streak of 5 jokers a day going

solid grotto
#

I was toying with localization trying to figure out how it works and then this issue started

#

Not too familiar with gamedev so a lot of this is pretty new to me

static dagger
#

Sorry, I don't know :(

solid grotto
#

Deleted the little bit of localization I had and it still bricks

#

Weird

#

I only had like two things in there so it's not a big deal

#

For science

#

I guess I'll sleep on it

#

For anyone seeing this later here's my issue. Would love any thoughts as to why this is happening

lyric maple
#

i'm trying to make a joker that gives x4 mult if the played hand matches the last played hand, but the last played hand updates when you play the hand

e.g. i intend for pair after HC to give x1 mult, since pair and HC don't match, but the last played hand is updated before scoring, so it matches pair with itself to give x4

dire marlin
#

can someone help me to make calculation for this one?

#

oh yeah i forgot, i am new for modding so im still learning the basic and confused to make multieffect joker abilities

lyric maple
dire marlin
lyric maple
#

can you show me your current code

#

like. for your entire joker

dire marlin
#

wait

formal parrot
#

Xchips don’t require talisman

#

Its built it with smods

lyric maple
#

oh ok

#

that makes my life 0.7% easier

formal parrot
#

I hate talisman

#

Witchcraft ongod 😭

lyric maple
#

so in your context it should be

calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
          return {
              Xmult = card.ability.extra.Xmult,
              Xchips = card.ability.extra.Xchips,
              dollars = card.ability.extra.dollar
          }
      end
  end
#

or something like that

#
SMODS.Joker {
    key = "mint",
    loc_txt = {
        name = "Mint",
        text = {
            "{X:mult,C:white}X#1#{} Mult if",
            "{C:attention}played hand{} is the same as {C:attention}last played hand{}",
            "{C:inactive}(Currently {C:attention}#2#{}){}"
        }
    },
    config = { extra = { xmult = 4, last_played = 'High Card' } },
    rarity = 3,
    atlas = "Jokers",
    blueprint_compat = true,
    pos = { x = 4, y = 2 },
    cost = 7,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.xmult, card.ability.extra.last_played } }
    end,
    calculate = function(self, card, context)
        if context.joker_main and next(context.poker_hands[card.ability.extra.last_played]) then
            return {
                xmult = card.ability.extra.xmult
            }
        end
        card.ability.extra.last_played = G.GAME.last_hand_played
    end
}

the display is working properly, but it still gives x4 mult regardless

dire marlin
lyric maple
#

i don't use xchips

dire marlin
#

ahh okay tysm man

azure valley
#

@dire marlin you can find documentation on how to return xchips in the steammodded wiki

#

Iirc

#

Does anyone have any documentation on the different phases of scoring a regular hand? I'm trying to implement a rather intrusive change to scoring for a joker, and I need to touch a lot of little things, so knowing how scoring works in detail from start to finish would be very useful.

dire marlin
formal parrot
#

Hello

formal parrot
#

Return{
xchips=your value}

#

If for xchips

azure valley
formal parrot
#

Its xchips =😭😭

dire marlin
# formal parrot If for xchips
        if context.individual and context.cardarea == G.play then
          return {
              Xchips = 3,
              Xmult = card.ability.extra.Xmult,
              dollars = card.ability.extra.dollar
          }
      end
  end```
#

like that?

formal parrot
#

Yes

#

x

#

Is lowercase

#

In both xchips and xmult

dire marlin
#

oh okay lemme try

dire marlin
#

thank u so much

formal parrot
#

Np ;)

runic pecan
#

How do I say in description that Lucky cards' scoring effect (1 in 5 for +20 mult and 1 in 15 for $20) will also trigger when held in hand, with no ambiguity?

#

I'd imagine it'd start with "Lucky cards held in hand ..."

formal parrot
#

Lucky cards will trigger if scored or held in hand

formal parrot
runic pecan
#

I'm mostly afraid if this is going to mess up other mods' ownership on lucky enhancement.

formal parrot
#

(Will definitely happen)

runic pecan
#

Wait.
I forgot I can just... have the joker give the mult and money instead.

formal parrot
#

Better

#

And will 100% work

#

You can change message display to trick them i to thinking it was the card triggering

#

One problem

#

(Won’t work with mime or red seals )

loud spoke
#

hi, does anyone know why my repetition doesn't work? I'm pretty new to modding and I'm not sure where I'm going wrong since I'm using the sock and musket as reference in the vanilla remade mod. I know that the .seal == "gold" thing works sice i've used it for other code so I'm not sure what I'm missing

runic pecan
formal parrot
loud spoke
formal parrot
#

Typo :>

runic pecan
#

Well, you just need to keep in mind that repetition comes from the word repeat.

tired kestrel
#

Trying to figure out how I can make a function that converts from three of a kind to four of a kind.

tired kestrel
# formal parrot How exactly

kinda like four fingers except if you have the joker it would try to convert your three of a kind into a four of a kind.

daring fern
tired kestrel
molten musk
#

dont know what did i do wrong but the pack is not showing the non-mod cards

#

hopfully someone will answer this time

tired kestrel
#

like if you have three of a kind the joker itself would counted as a playing card and rank you choose for the thre of a kind.

molten musk
#

@daring fern can u help?

formal parrot
#

You can change the 3 of a kind behavior to count as 4 of a kind when add to deck

#

but

#

Idk how

#

LOL

formal parrot
molten musk
#

yes

#

checked

formal parrot
#

I think the first letter of each is uppercase

molten musk
#

hmm

#

will try that

formal parrot
#

;)

#

Whats medium key for ?

molten musk
#

nope

#

didnt work

molten musk
#

the purple seal one

formal parrot
#

Oh

formal parrot
molten musk
#

yeah, i copy pasted from game code

daring fern
molten musk
#

did that too

molten musk
formal parrot
#

Take the L

#

/j

molten musk
formal parrot
#

Accept defeat

molten musk
#

...

formal parrot
#

(Don’t)

#

Go do something else

#

And come back for it

molten musk
#

i should

tired kestrel
#

Here's what I'd thought I can get it to work.

#

but overall I was thinking like maybe when you are abotu to play the three of a kind

#

it switches to four of a kind.

#

and of course makes the joker to be counted as the said playing card

stiff quiver
#

I made this to change the sprite of a seal if you have joker. would it work? lua if G.GAME and G.jokers and #G.jokers.cards > 0 then for key,playing_card in ipairs(G.jokers.cards) do if playing_card.config.center.key == "j_joker" then card.config.center.pos = { x = 1 , y = 0 } break else card.config.center.pos = { x = 0 , y = 0 } end end end
thats placed inside the calculate part of the seal

#

i would test it myself but my game isnt doing the seal's code for some reason

lyric maple
#
        local jleft, jright
        if card.area and card.area == G.jokers then
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] == card then
                    jleft = G.jokers.cards[i - 1]
                    jright = G.jokers.cards[i + 1]
                end
            end
        end
        local left_cost = (jleft and jleft.sell_cost) or 0
        local right_cost = (jright and jright.sell_cost) or 0
        card.ability.extra.dollars = math.ceil((left_cost + right_cost) / 2)

this code is intended for a joker to give $ equal to the avg sell value of the jokers left and right of it. if i put four of this joker in my slots (sell value $3), it returns 0, 3, 3, 0, but it should return 2, 3, 3, 2

simple helm
#

how do i change the png title to my own?

pastel torrent
#

method to detect sealed cards?

#

nvm

#

found it

#

would this be correct?

hard mica
#

does anyone know how i can fix this? i added a event thingy but now it doesnt show at all after the round ends

tired kestrel
#

turns out... it's actually hard coded with the actual game

#

is there a way to recreate this?

molten musk
#

i wanna make a joker that adds seals on played cards
how do i go about that

formal parrot
#

Or Pool

#

Forgot

#

Nope

#

Its poll_seal

molten musk
#

i see

formal parrot
#

SMODS.poll_seal({ guaranteed = true, type_key = '' })

#

Key can be anything

#

This adds a random seal

#

I think you can set seal for cards right?

#

SMODS.poll_seal({ guaranteed = true, type_key = '' })

#

Idk if this would work

molten musk
#

hmm will try it

formal parrot
#

No

#

@molten musk

#

Found it

molten musk
#

oh

formal parrot
#

New_card:set_seal(card.ability.extra.seal, nil, true)

molten musk
#

new card??

formal parrot
#

You’d use v:

molten musk
#

i see

formal parrot
#

Change the card.ability.extra.seal

formal parrot
#

For random seal

#

Should theoretically work

#

Or have a seal key in config if you want a specific one

#

[I recommend doing all of this in an event ]

molten musk
#

ok

snow vale
#

why's this partner not working?

formal parrot
#

X

#

lowercase

#

:P

formal parrot
snow vale
#

wait really

#

no but i mean

#

it doesnt scale

formal parrot
snow vale
#

ok

formal parrot
#

Are you sure thats how partner work (i mean idk never done one )

snow vale
#

ill go check

snow vale
formal parrot
#

Check

#

The github

#

They might have a tutorial or something

feral tree
#

what does the secondary colour of a consumable type change?

formal parrot
#

@snow vale

snow vale
#

dw i fixed it

formal parrot
tired kestrel
#

can you try to trick the game to think it's a four of a kind? or not?

dire marlin
#

how to make the calculate context for this?

formal parrot
#

You definitely can

tired kestrel
formal parrot
#

Use while

formal parrot
tired kestrel
#

okay

#

need to look for that

formal parrot
#
    -- your return 
end```
tired kestrel
#

now which joker does that?

formal parrot
#

Just look around there’s 150+ jokers and more stuff , could be a pain to find it tbh

tired kestrel
#

no I have not installed onto balatro mod

formal parrot
#

Tell me if you figured it out

tired kestrel
#

am I playing myself for some mind games?

#

just kidding. Just I don't even know where I can find it but I'm looking

stiff quiver
formal parrot
#

Lmao

#

Nevermind lmao

stiff quiver
formal parrot
stiff quiver
#

oh

formal parrot
#

I gave him the solution don’t worry :)

stiff quiver
#

lmao

tired kestrel
#

but now I found out about the ://Exploit

formal parrot
#

Are you sure main eval is correct?

formal parrot
#

Chat remind me to make a tutorial on the 4th

formal parrot
#

Whats your current code ?

dire marlin
formal parrot
#

Yes

#

:P

dire marlin
# formal parrot Yes
SMODS.Atlas{
    key = "mining",
    path = 'mining.png',
    px = 71,
    py = 95
}
SMODS.Joker{
    key = 'mining',
    loc_txt = {
        name = 'Gambilng Addict',
        text = {
            '{C:attention}Retrigger{} lucky card until',
            'lucky card ability is triggered',
            '{C:inactive}``99% gambler quit before big win``{}'
        }
    },
    atlas = 'mining',
    pos = {x = 0, y = 0},
    rarity = 3,
    cost = 10,
    config = { extra = { repetitions = 1 } },
    calculate = function (self, card, context)
        if context.individual and context.cardarea == G.play and context.other_card.lucky_trigger and not context.blueprint then
        end
}```
formal parrot
#

Okay so

#

You don’t need a config

#

Can i edit this ?

dire marlin
#

sure

formal parrot
#

To show you

#

Okay great

hard mica
tired kestrel
#

Can't find where cry_exploit_override is located

formal parrot
#
    key = 'mining',
    loc_txt = {
        name = 'Gambilng Addict',
        text = {
            '{C:attention}Retrigger{} lucky card until',
            'lucky card ability is triggered',
            '{C:inactive}``99% gambler quit before big win``{}'
        }
    },
    atlas = 'mining',
    pos = {x = 0, y = 0},
    rarity = 3,
    cost = 10,
    calculate = function (self, card, context)
        if context.individual and context.repetition and context.cardarea==G.play then
While not context.other_card.lucky_trigger do
Return{repetition=1}
End
End
End
}```
dire marlin
#

ahh

formal parrot
#

This theoretically should work

dire marlin
#

lemme try

formal parrot
#

Add

#

And not context.blueprint

#

In if

tired kestrel
#

how the heck am I going to do this?

molten musk
#

@formal parrot the joker worked

formal parrot
#

Here’s a cookie đŸȘ

molten musk
#

haha

#

thanks teacher

tired kestrel
formal parrot
molten musk
#

now to the next one

#

i want to trigger seal effects one more time
not the card, just seal effects

#

whether in hand, played or discarded

dire marlin
# formal parrot ```SMODS.Joker{ key = 'mining', loc_txt = { name = 'Gambilng Add...
    key = 'mining',
    loc_txt = {
        name = 'Gambilng Addict',
        text = {
            '{C:attention}Retrigger{} lucky card until',
            'lucky card ability is triggered',
            '{C:inactive}``99% gambler quit before big win``{}'
        }
    },
    atlas = 'mining',
    pos = {x = 0, y = 0},
    rarity = 3,
    cost = 10,
    calculate = function (self, card, context)
        if context.individual and context.repetition and context.cardarea == G.play and not context.blueprint then
            while not context.other_card.lucky_trigger do
                return {
                    repetion = 1
                }
            end
        end
    end```
#

still not working

formal parrot
#

It should tho😭

#

Does it crash?

dire marlin
#

no but the joker didnt do the repetition

#

wait

formal parrot
#

Omfg

#

I’m

#

Stupid asf

molten musk
#

u typed repetition wrong

formal parrot
#

Its repetitions

#

I KNOW😭😭😭

dire marlin
#

yea i just figured it out 😭

#

sorry mann

formal parrot
#

Lmfao😭😭

#

Its alright

#

Typo

tired kestrel
tired kestrel
#

I don't know if what I'm doing is right

#

I did use the code from the ://Exploit but I don't know if it would work

dire marlin
formal parrot
formal parrot
dire marlin
formal parrot
#

You might need to ask somethingcom or ice

#

I’m not sure how to do hand swa

#

Swap

tired kestrel
tired kestrel
#

I think ice is online right?

formal parrot
formal parrot
tired kestrel
#

alright might as well.

#

@hushed field do you happen to know how to make a joker to replace the hand type?

#

like

#

from Three of a Kind to FOur of a kind.

formal parrot
#

In return

hushed field
#

I'd hook the hand evaluation function

#

I haven't tried to do anything like that myself, though

formal parrot
#

I though he can edit the 4 of a kind to act like 3 of a kind

hushed field
#

let me read up on the context, haha

formal parrot
#

He wants to make a joker that lets you play 4 of a kind with 3 of a kind

#

(I think 4 fingers joker in vanilla remade has something like this )

hushed field
#

Ah, in that case, I'd find whatever function does the evaluation, and lovely patch a bool check in that that joker would set on add_to_deck

tired kestrel
#

cause this is the idea where I got it from:

formal parrot
#

Wait lemme check

hushed field
#

let me check how the code handles that, and I can give you a more detailed idea of how I'd handle it, at least, haha

molten musk
#

how do i retrigger a seal

azure valley
formal parrot
#

Not red seal tho

hushed field
#

yeah, okay, there's a function called evaluate_poker_hand, which you'd want to patch into. The function that checks for xoak is called get_X_same. In this case, you could even just hook get_X_same and make it so that when the test is set to 4, it starts at 1 higher

molten musk
formal parrot
#

You’ll have to take ownership of them i think and edit the context

tired kestrel
#

of course I mysefl have tried to look into the source code again and apperently it was very hard coded

molten musk
#

gonna think about it tomorrow,im getting tired and want to rest

tired kestrel
#

wanted to like make a function like get_four_of_a_kind so that it would work.

molten musk
#

see u all later

hushed field
#

have you used lovely patches before, tarkan?

tired kestrel
#

how does that work?

hushed field
#

It allows you to insert code into the source code

formal parrot
formal parrot
tired kestrel
#

didn't I already have that?

dire marlin
hushed field
formal parrot
dire marlin
#

ohhhh

formal parrot
#

You might want to be get a little familiar with it

formal parrot
#

Context.repetition isn’t plural

dire marlin
#

bruh i need to remember that plural thing

#

lemme try again

formal parrot
#

Dw we all make typo mistakes

#

(Specifically me)

dire marlin
#

😭

tired kestrel
#

am I understanding this correctly?

formal parrot
#

Lovely patches are so interesting, I might wanna learn it when i have time i wanna add custom stuff

tired kestrel
#

Actually I wanna learn that too now.

formal parrot
#

You can find people using it in their mods

#

.toml

tired kestrel
#

okay. so basically copy core.lua into a folder and then modify the code.

#

oh.

hushed field
#

not entirely. You don't copy the source code. You find basically a unique line in the code, and decide whether your new code is placed before it, after it, or replaces it. It allows you to do a whole bunch of more complicated mechanics

tired kestrel
#

tbh I need a tutorial about on how it works cause.

formal parrot
#

:P

dire marlin
hidden sable
#

just realized this context wotn work because its after

tired kestrel
#

my brain is trying to process this.

unborn bay
hidden sable
tired kestrel
unborn bay
hidden sable
unborn bay
#

in this case probably not

#

if you don't need it at a very specific place in the functiob

#

just hook to it

formal parrot
#

Add some prints

dire marlin
formal parrot
#

To find the issue

hidden sable
#

i just need to run a function before cards get drawn, when cards should get drawn

formal parrot
#

Print (“1”)before the while and print (“2”) inside

unborn bay
#
local ref = functionhere
function functionhere()
    SMODS.calculate_context({context_name_here = true})
    ref()
end
#

i forgot the name of the function regarding drawing cards to hand

#

but yeah adding custom contexts is as simple as this

dire marlin
tired kestrel
#

wait

formal parrot
tired kestrel
#

oh my god I just fricking found it.

formal parrot
#

But try

#

It should print in the console

dire marlin
formal parrot
dire marlin
#

should i screenshot the crash log?

tired kestrel
#

I looked in the github

#

further

#

and came across this

#

I don't know if this is what I'm looking for

#

but now I just need to figure out how do I even replace

hidden sable
formal parrot
hidden sable
#

is there any way to have my function run before drawing cards, and when its completed resume the og game hand draw

formal parrot
red flower
tired kestrel
#

Ooooh.

red flower
formal parrot
#

😭i feel like N and mathisfun are the fathers of modding

#

N byw

hidden sable
formal parrot
#

Btw*

tired kestrel
#

wait.

red flower
#

idk im not following the convo

hidden sable
#

searching the deck for cards that have enhancements and drawing those first

formal parrot
#

Is this code correct ?

red flower
formal parrot
#

Ik its [repetitions] in return

#

Typo

hidden sable
red flower
formal parrot
#

Mmmm

tired kestrel
formal parrot
#

So i need to split it ?

red flower
formal parrot
red flower
#

unless you mess up the events

hidden sable
red flower
# formal parrot To 2 ifs ?

you would only need repetition but reading the effect I don't think it's possible to do without hooking the internal calculation functions

formal parrot
#

Rip

#

Can i use context.played_hand

red flower
formal parrot
#

And for

#

Instead ?

mild fractal
#

trying to make it so that when mult is added to my joker it pops up with the +mult effect (idk how to explain it properly but like when you refresh the shop with trading card) and i cant figure out how, can anyone help?

#

like it adds the mult i just want the visual indicator iykwim

red flower
formal parrot
hidden sable
tired kestrel
#

N, if you have a moment, how does the replacing for patches work for whole codes and everything?

red flower
hidden sable
#

maybe even "top card" will serve my purpose?

tired kestrel
#

like I want to replace the entirey of evaluate_poker_hand with new stuff

red flower
formal parrot
#

@daring fern

hidden sable
#

promising?

formal parrot
#

Offline :<

red flower
tired kestrel
formal parrot
red flower
#

you can't use a while because you can only return once

formal parrot
#

While not [context for lucky card triggers]

formal parrot
hidden sable
formal parrot
#

What a shame

formal parrot
red flower
#

yeah you need to hook SMODS.calculate_repetitions or something like that but no idea

hidden sable
#

when a lucky card gets scored, check if it got set off, if it didnt, do a repetition

red flower
formal parrot
#

Wait

hidden sable
#

@red flower draw_card(G.deck,G.hand, i*100/card_count,nil, nil , nil, 0.07) does this look promising?

red flower
#

i guess, don't know without testing it

tired kestrel
hidden sable
mild fractal
tired kestrel
#

to just have a function that can have a joker a spesific joker to replace a three of akind poker hand to a four of a kind.

dire marlin
#

so what should i do

red flower
#

what exactly do you want to know

near bay
#

how do i make a joker act like gros michel but gives 120 chips instead of 15 mult?

tired kestrel
#

or something like that?

red flower
#

i mean, it is something to do with evaluate_poker_hand

#

idk if you need a patch

formal parrot
#
    key = 'mining',
    loc_txt = {
        name = 'Gambilng Addict',
        text = {
            '{C:attention}Retrigger{} lucky card until',
            'lucky card ability is triggered',
            '{C:inactive}``99% gambler quit before big win``{}'
        }
    },
    atlas = 'mining',
    pos = {x = 0, y = 0},
    rarity = 3,
    cost = 10,
    calculate = function (self, card, context)
        if context.played_hand and context.repetition and context.cardarea == G.play and not context.blueprint then
            For _,v in inpairs(context.played_hand) do
If not v.lucky_trigger do
                return {
                    repetion = 1
                }
            end
        end
    end```
#

Is this correct?

hidden sable
#

I THINK I AHVE IT

tired kestrel
hidden sable
#

from = G.deck
to = G.hand
percent = ??
dir = ???
sort = ???
card = for check card

red flower
hidden sable
#

3 arguments i gotta figure out what they do

red flower
#

yeah it's not a simple effect

tired kestrel
#

honestly I kinda agree.

#

I mean Cryptid had pull something about replacing a hand type and yet I figure out how that actually works or functional

red flower
#

honestly there could be a context for that

near bay
#

how do i make a joker act like gros michel but gives 120 chips instead of 15 mult?

red flower
#

i will see if i can do it once i get back home later today

hidden sable
#

how do i check if a card has an enhancement again

red flower
hidden sable
dire marlin
manic rune
#

SMODS.has_enhancement(card, "enhancement_key") for specific
next(SMODS.get_enhancements(card)) for checking if the card has any enhancement i think đŸ€”

tired kestrel
red flower
hidden sable
tired kestrel
#

like I did try to use the code but somehow it's a code card

red flower
tired kestrel
#

and has it's UI and everything

#

and also you have to choose your own code

hidden sable
#

lets pray this works

dire marlin
tired kestrel
#

or the poker hand

crisp coral
red flower
hidden sable
crisp coral
tired kestrel
#

Now what about the evaluate pokerhand to trick the game into a differnt hand type.

red flower
#

evaluate_poker_hand returns the hand name, it might be as easy as replacing one for the other but idk

hidden sable
#

my dumbass forgor

formal parrot
hidden sable
#

didnt work 😭

#

fuck did i do? 😭

dire marlin
red flower
#

no idea sorry

#

unless you mean how to hook in general

dire marlin
#

ah okay

#

thank you anyway

hidden sable
#

😭

#

i tried a new approach

#

wait

#

i might be stupid hold on

#

give me a minute

red flower
#

you would also need to change card

lament agate
#

G.UIT.I is a thing right?

#

why does it crash saying its not a thing

red flower
#

i dont think it is

lament agate
#

but

red flower
#

what would it be

lament agate
#

????

red flower
#

oh maybe it is

lament agate
#

raising my fist as i shout "god damn you smods"

hidden sable
red flower
hidden sable
#

what is bro checking for 😭

lament agate
#

why is it in the wiki then

red flower
manic rune
#

text input node??

hidden sable
#

looking at source yeah

lament agate
#

its in the wiki

red flower
manic rune
#

mm nop

#

use create_text_input if you want to make a text input box

hidden sable
manic rune
#

idk wtf is G.UIT.I, first time seeing that

lament agate
#

so we lyin now

#

😭

red flower
hidden sable
#

the smods wiki truly is a sacred place

hidden sable
manic rune
#

happy april fools!

red flower
manic rune
#

sump

#

;3

hidden sable
#

sump

red flower
#

now im not correcting it

manic rune
#

lmao

hidden sable
#

where would i check

manic rune
#

not in there

red flower
manic rune
#

wait

#

is that in dump

red flower
hidden sable
#

oh there we go

manic rune
#

i cant tell if thats the source code or dump

#

😭

red flower
manic rune
#

oh

#

i will see myself out

#

:3

hidden sable
#

something is whining about other_ard

red flower
hidden sable
red flower
#

weird

hidden sable
#

am i not defining card correctly?

manic rune
#

prob draw_card, everything there looks fine

hidden sable
#

i got draw_card from the source

manic rune
#

:3 never used draw_card before, good luckkk

red flower
#

youre passing the card as the sort

hidden sable
#

oh

#

waiter waiter more nils please

faint yacht
#

draw_card(G.deck, G.hand, i*100/#allnotifcards, 'up', true, G.deck.cards[i])

hidden sable
faint yacht
#

Now exit the run and re-enter to check if it stays.

hidden sable
#

finding out theres a sort option

#

i can remake one of my older cards

#

that i didnt want to have sort

#

but first

hidden sable
#

main menu > continue and its still here

faint yacht
#

Good.

hidden sable
#

alr now to remake that one card

#

oh i also have to

#

i gotta make the chance effect too

#

but lemme fix the other card with my newfound power

#

true test

#

oh no, a bug

hidden sable
#

i have to somehow edit the drawing of the cards to fill the space again

#

nice i fixed the old card

#

i have gained a newfound power

hidden sable
# red flower elaborate?

its always trying to draw 8 cards, i need to draw the beaming cards first then recheck how many spots it needs to fill

#

i also need to do my own checks as well

red flower
#

well if you return cards_to_draw = amount in that context it modifies the cards to draw

#

context.amount is the original amount it was about to draw

red flower
#

no

#

return it as in return { cards_to_draw = amount }

hidden sable
#

oh

#

also do i need any of this at the bottom of my hook

red flower
#

which hook

hidden sable
red flower
#

oh then you cant do what i said

hidden sable
#

sad

red flower
#

you would need to patch where the serpent is

hidden sable
#

OH NO

#

PATCHING

red flower
#

you can maybe do something with ret there but idk

hidden sable
#

ok what if

#

i just straight up handle card drawing myself

#

is there a way to prevent cards from getting drawn from drawing_cards so i can do it myself

red flower
#

just patch lmao

hidden sable
#

patching is scary

manic rune
#

patching isnt that scary

#

i somehow knew you were gonna say that

red flower
#

it's easier than whatever youre suggesting

manic rune
#

like, a mile away

hidden sable
#

it sounds scary

manic rune
#

sob

manic rune
red flower
hidden sable
#

ok well yall are gonna have to give me a How to patch in a Balatro mod Walkthrough part 73

red flower
#

haha

hidden sable
#

what is sperpent again

red flower
hidden sable
#

oh that one

#

not even a boss

#

bro helps

faint yacht
# hidden sable

...actually, if you are to draw those specific cards first, you need to hook CardArea:shuffle and perform said shuffling there to ensure that those cards end up on top of deck.

#

Or you could just force-draw those cards regardless, like I do with my Notification cards.

hidden sable
#

so with patching, will my card draw setup thing migrate to a patch or stay a hook

red flower
#

i would put it in the patch so you can calculate how many cards to draw

#

easily

hidden sable
#

alright

#

this only vaguely makes sense

red flower
#

the only part of the payload you care about is the hand_space part

#

but its this card if you want to parse the effect

tired kestrel
#

(just wondering)

#

was this just adding?

red flower
#

thats adding code before the line if G.GAME.blind.name == 'The Serpent' and

tired kestrel
#

Ah. I see

#

now what is the thing that can replace a line of code or?

red flower
#

position = 'at'

gilded blaze
#

I'm still a bit confused about the new probability calc

if context.mod_probability then
    context.numerator = context.numerator + 1
end

does this code add 1 to all probabilities

hidden sable
#

so how do i "start" a patch

red flower
#

i think you need to return numerator

red flower
hidden sable
#

like

#

is there a function or

red flower
#

no you just put it in the code and it does it

gilded blaze
#

return numerator alone or inside a table

hidden sable
#

whats the [[patches]] and [patches.pattern

red flower
#

return { numerator = amount }

gilded blaze
#

I see

red flower
gilded blaze
#
if context.mod_probability then
    return { numerator = context.numerator + 1 }
end

like this?

red flower
#

maybe? i havent used it yet

gilded blaze
#

💀

#

damn, this change is gonna break a lot of mods

red flower
#

this is what oops does

gilded blaze
tired kestrel
#

alright I think I finally got something in pogress

gilded blaze
#

since Oops uses the new context, how do additive probabilities work along side

#

¯_(ツ)_/¯

tired kestrel
#

oh my god something worked

#

the patch

#

but I got an error

gilded blaze
#

use apostrophe ('), not backtick (`)

gilded blaze
#

revolution to probability manipulation, damn

red flower
#

im still thinking about what to do with jokerdisplay

gilded blaze
#

SMODS.get_probability_vars returns 2 values: numerator and denominator
SMODS.pseudorandom_probability grabs the 2 said values and returns pseudorandom(seed) < numerator/denominator
I'm gonna assume we use the first function to grab the values for loc_vars, and the second in calculate

#

gosh this is driving me nuts

hard mica
gilded blaze
#

I can't really tell the difference between additive and fixed probability
at least code-wise

hidden sable
hard mica
hearty crane
#

i still would have something crazy builded

hidden sable
gilded blaze
hidden sable
#

so that's why it's formatted differently

gilded blaze
#

how does fixed probability even work if it takes the value returned by additive

red flower
#

honestly i have no idea

hidden sable
#

so what do i even patch

red flower
#

but there is a typo

red flower
hidden sable
#

numberator is tough

hidden sable
#

i already know i want to patch before

#

so what would be the spot i patch

red flower
#

the same spot i sent you?

hidden sable
#

that'll work?

#

what's pattern

#

lemme guess pattern is the search part

#

and payload is the replace

red flower
#

yes

hidden sable
#

my brain, it's getting bigger

#

so i gotta find my own pattern for drawing cards

red flower
#

the pattern is the one i sent

#

the payload shold be something similar to what you did in the context

#

but modify hand_space so that it doesnt draw extra cards

tired kestrel
#

@red flower Good news I think I managed to get the ovely patches to work however I think somehow it's not activating the four of a kind.

ivory coral
#

trying to make a joker with a different mult effect depending on poker hand
and so im trying to make a way for the joker to reference which value corresponds to which poker hand
my idea was to create a meta-table of subtables in the joker's config which have the information i need (since i cant make a string as a config variable name) like this:

    {'High Card', 1},
    {'Pair', 2},
    {'Two Pair', 4}
    {'Three of a Kind', 6},
    {'Straight', 8},
    {'Flush', 7},
    {'Full House', 10},
    {'Four of a Kind', 12},
    {'Straight Flush', 14},
    {'Five of a Kind', 18},
    {'Flush House', 22},
    {'Flush Five', 26}
},```
but my problem now is if i get say a global variable with a specific poker hand (ex `example_hand = 'Three of a Kind'`) how would i tell things such as my `loc_vars` function which subtable to get the values it needs from?
theres probably a simple answer to this but i cant think of it
hidden sable
red flower
#

the serpent part doesnt matter thats just what the line says

red flower
hidden sable
#

so this will be

<code>
if G.GAME.blind.name == 'The Serpent' and
ivory coral
hidden sable
ivory coral
#

so i could just use mult_ref['Pair']?

red flower
red flower
ivory coral
hidden sable
#

now i just replace payload, would it be similar to what im doing with the hook

#

this wouldnt work right

red flower
#

yes

#

just try putting the loop there

hidden sable
#

😭

#

the glink nugget error

red flower
#

youre missing the manifest yeah

hidden sable
#

patching is scary, because the errors are even MORE incomprehensible

red flower
#

dont put the context there, just the loop

hidden sable
#

oh ko

#

wow that worked

#

now uhhh

#

gotta fix the overdraw error

#

mods tie him up

red flower
#

oh wow this one is new

#

<@&1133519078540185692>

tired kestrel
#

is it real?

#

Holy!

#

uhh.

hidden sable
#

that guy is in the nubert facility discord too

red flower
hidden sable
red flower
#

no, it's local to that function youre injecting into

hidden sable
#

wait, what exactly does hand space represent, how many cards to draw?

red flower
#

yes

hidden sable
#

treat it like a global

#

for that function only

ivory coral
# red flower yes

quick followup, for a modded poker hand should i still use its name or key instead

red flower
#

modprefix_key

sonic cedar
#

so your setup works, but as i said it lags/crashes my game whenever it tries to get used. did i set it up wrong?

hidden sable
#

so make hand_space equal to hand size - 1 for every beaming card in hand (ill make beaming overdraw fix later)

#

whats the hand size global again

red flower
#

no, you also need to take into account the cards already in hand