#💻・modding-dev

1 messages · Page 467 of 1

mental nacelle
#

do you have a localization file

orchid dawn
#

What do you mean by installed? Doesn’t it need to be inside the game files? is it meant to be used like an API, as a requirement, just like all the mods that need Steamodded?

mental nacelle
#

it is a steamodded mod, it just allows for other mods to make challenges with less code

#

at some point tomorrow i’ll see if i can get something working on one of my mods

#

(with challenger deep rules in a deck)

pastel kernel
#

I’m never getting the Sisyphus joker finished.

pastel kernel
mental nacelle
#

what’s exactly the issue

pastel kernel
#

I’ve been saying this multiple times

#

It does not trigger value multiplication after defeating a boss blind, in which it should

frigid perch
#

This replaces photograph which is /1.2 y scale in the game's code, how would I go about reversing that

pastel kernel
#
        if context.end_of_round and context.main_eval and not context.blueprint and G.GAME.blind.boss then
            card.ability.extra.xchips = card.ability.extra.xchips * card.ability.extra.xchips_mod
            card.ability.extra.interest = card.ability.extra.interest * card.ability.extra.dollar_mod
            return {
                message = "Yes, that's it!",
                sound = "sisyphus_yesthatsit",
                colour = G.C.GOLD
            }
        end
#

this is the snippet in question

daring fern
mental nacelle
#

either that or i need sleep

pastel kernel
#

no

red flower
pastel kernel
#

i also tried context.cardarea == G.jokers

normal crest
#

Is that your entire calculate function

pastel kernel
#

here's the full code

frigid cargo
#

joker

normal crest
mental nacelle
#

i’m guessing the first one overwrites the second

daring fern
granite nymph
#

bump

mental nacelle
#

do you have a localization file

pastel kernel
daring fern
daring fern
mental nacelle
#

(am i right in thinking labels for packs are stored in dictionary = {} of a localization file?)

normal crest
mental nacelle
#

k_prefix_packname or something

#

pesky markdown

frigid cargo
pastel kernel
normal crest
#

the point is just to remove it temporarily to see if it's the cause of your 2nd one not triggering

mental nacelle
daring fern
mental nacelle
#

:(

pastel kernel
#

still nothing

#

even after temporarily removing the first one

#

sorry

#

brainfart

#

i meant

#

context.end_of_round

formal quest
#

How do I set the chips & mult on the UI?

pastel kernel
#

removing the first context.end_of_round didn't work.

normal crest
#

what does your code look like after removing it

pastel kernel
#
--        if context.setting_blind and context.cardarea == G.jokers and not context.blueprint then
--            G.GAME.dollars = G.GAME.dollars + card.ability.extra.interest
--            return {
--                dollars = card.ability.extra.interest,
--                message = "+$" .. card.ability.extra.interest,
--                sound = "sisyphus_keepemcoming",
--                colour = G.C.MONEY
--            }
--        end
#

yea it still works

#

the double hyphen

normal crest
#

wdym it still works

pastel kernel
#

ok hold on, brainfart

#

it still does not work

#

the context.end_of_round still does not work

normal crest
#

Do you have any other mods enabled

#

What steamodded version are you using

#

And does your mod have any lovely patches

granite nymph
#

bump one last time except seals on everything

pastel kernel
#

Do I have to turn off cryptid?

pastel kernel
#

No lovely patches at all

normal crest
pastel kernel
#

Sisyphus is currently a standalone

mental nacelle
#

these are questions only true balatro fans can know…

daring fern
frigid perch
#

Is there not a way to just move the middle card up? It's just retextured Photograph

pastel kernel
#

CRYPTID IS THE PROBLEM AGAIN??

normal crest
pastel kernel
#

This is also a problem for my Sans joker

formal quest
#

How do I change the displayed chips and mult? This isn't working

normal crest
pastel kernel
#

Originally Sans was going to add club aces for every scored card in played hand

daring fern
ocean goblet
#

aight so i am working on a

very funny joker

pastel kernel
#

But because of cryptid’s overrides, sans instead creates random enhanced playing cards

ocean goblet
#

how would one go about checking a card's sprite's position in its atlas during calculation

formal quest
daring fern
ocean goblet
#

it's based on an injoke between friends and i where

you get a bonus if a card is scored literally when the thing blinks lmao

#

checking that is like the one roadblock to it for me

ocean goblet
#

thank!! will try now

granite nymph
ocean goblet
#

like so?

calculate = function(self, card, context)
        if context.cardarea == G.play and context.individual and card.config.center.pos == { x = 0, y = 1 } then
            G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
                    return{
                message = "blink",
                chips = card.ability.extra.mod1,
                card = card
            }
                end }))
        end
    end
normal crest
#

inside loc_txt

pastel kernel
#

Ok so selecting a boss blind works.

#

That’s a better workaround

ocean goblet
#

I CANT SEND MY MARIO GIFS

granite nymph
#

so does that mean i would have to port everything i’ve already did to a loc.txt

ocean goblet
#

but tis the block that switches powerup sprites

#

and it could be a joker thats some shit like "when x happens gain y" based on that sprite

daring fern
formal quest
ocean goblet
formal quest
#

237 is the highlighted line

ocean goblet
#

any other ideas on how to check the thing?

daring fern
normal crest
formal quest
normal crest
#

no, you swap value to index

ocean goblet
normal crest
daring fern
idle plaza
normal crest
ocean goblet
formal quest
normal crest
wild escarp
#

Anyone know why the joker doesn't draw this when it has an edition (excluding foil)?

draw = function(self, card, layer)
    if card.config.center.discovered then
        if (layer == 'card' or layer == 'both') and card.sprite_facing == 'front' then
            local scale_mod = 0.05 + 0.05 * math.sin(1.8 * G.TIMERS.REAL) +
                0.07 * math.sin((G.TIMERS.REAL - math.floor(G.TIMERS.REAL)) * math.pi * 14) *
                (1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL))) ^ 3
            local rotate_mod = 0.1 * math.sin(1.219 * G.TIMERS.REAL) +
                0.07 * math.sin((G.TIMERS.REAL) * math.pi * 5) * (1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL))) ^ 2

            local image = Sprite(0, 0, 71, 95, G.ASSET_ATLAS["willatro_WillatroOrgans"], {x = 1, y = 0})
            image.role.draw_major = card
            image:draw_shader('dissolve', 0, nil, nil, card.children.center, scale_mod, rotate_mod, nil,
                0.1 + 0.03 * math.sin(1.8 * G.TIMERS.REAL), nil, 0.6)
            image:draw_shader('dissolve', nil, nil, nil, card.children.center, scale_mod, rotate_mod)
        end
    end
end
formal quest
pastel kernel
#

Why does Optimus prime transform whenever a hand is played?

ocean goblet
formal quest
normal crest
#

Okay I see, for some reason contained has a key called top

#

In your if statement do if played ~= index and G.GAME.hands[index] then

formal quest
normal crest
#

well that's cus you're updating the value but not the text

formal quest
#

Do I need to update the text after?

#

Alright

#

I tried figuring out updating the text a while back but couldn't quite get it

normal crest
#

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

wild escarp
normal crest
#

actually I haven't asked what your goal is

formal quest
#

My goal is to add the chips & mult of contained hands to the hand

normal crest
#

tho depending on when you're doing this those values might be overridden when you play the hand

formal quest
#

That's probably fine. I've been assuming I'd have to implement showing the base score and actually adding it separately.

formal quest
ocean goblet
formal quest
normal crest
#

maybe you're doing this too early

formal quest
normal crest
#

try doing hand_chips = (hand_chips or 0) + contain_chips

#

same with mult

formal quest
#

It could be another line at fault here but it could still be this one

normal crest
formal quest
#

An explanation of the code at play here would help cause I'm new to lua/balatro and I want to learn from this, not just fix one problem

#

Is this code even filtering the contained hands?

fallow breach
#

how do i get the game to read which suits are held in hand

normal crest
daring fern
fallow breach
#

because it's a joker that only activates when you have one suit in hand

#

similar to blackboard but generic

#

so if you hold all diamonds in hand or all clubs in hand

#

i wrote this out for each specific instance of suit

daring fern
fallow breach
#

i did and that's where i got the base from

normal crest
# formal quest How would I do this any later?

so you're summing up the mult and chips of every hand contained in the highlighted cards that isn't the played one, then you're modifying the global variables that balatro vanilla uses to set chips and mult (hand_mult should be just mult btw), and then you're updating the text

#

that's pretty much it

fallow breach
#

mine on the left and blackboard on the right

formal quest
daring fern
fallow breach
#

how does that work

formal quest
fallow breach
#

also yes i'm aware my code on the left is absurd but i wanted to try it myself before coming here lol

ocean goblet
daring fern
# fallow breach how does that work
local nonwild
for k, v in pairs(G.hand.cards) do
    if not SMODS.has_any_suit(v) then
        nonwild = v
        break
    end
end
local pass = true
if not nonwild then nonwild = G.hand.cards[1] end
for k, v in pairs(G.hand.cards) do
    if not v:is_suit(nonwild.base.suit) then
        pass = false
        break
    end
end
if pass then
    -- add chips
end
```?
snow breach
#

How do I create a consumable that makes a joker of a certain pool? Here's the current code that does not work.

daring fern
formal quest
# normal crest all

Could you indicate more clearly what you're suggesting? Cause I tried your suggesstion multiple ways, and even fixed some of them, and none of them work right

fallow breach
normal crest
#

tho idk what the issue is anymore

snow breach
#

On use.

daring fern
snow breach
daring fern
keen atlas
snow breach
formal quest
daring fern
snow breach
#

No, I guess not. Where and how do I do that.

formal quest
daring fern
formal quest
keen atlas
# formal quest

try

local playedHandType, handText, contained = G.FUNCS.get_poker_hand_info(self.highlighted)
local chips, mult = G.GAME.hands[playedHandType].chips, G.GAME.hands[playedHandType].mult

for handType, handInfo in pairs(G.GAME.hands) do
    chips = chips + handInfo.chips
    mult = mult + handInfo.mult
end

update_hand_text({ delay = 0 }, { mult = mult, chips = chips })
formal quest
#

I'm pretty sure it's not actually filtering for contained hands at all

normal crest
#

In your if add and #value > 0

#

That'll check if there's at least one match for that hand

#

Sorry I was distracted with something else I didn't realize that was missing

keen atlas
formal quest
# normal crest In your if add `and #value > 0`

Looks good. I put that in and it adds all the contained hands, though it doesn't actually add the played hand. I can fix that pretty easily. In the meantime though I want to add your part onto @keen atlas 's solution cause the code has gotten pretty messy by this point.

normal crest
#

Also your code is fine as it is and frostice's isn't really a solution to what you wanted

formal quest
#

I should probably just clean up the code myself so yeah

#

It seems to work. I'm gonna test planet cards real quick

#

Yep. Pair lv. 2, high card & two pair 1

#

One small issue, using a planet card while cards are selected clears the entire text display

keen atlas
#

its vanilla effect. try calling the G.hand:parse_highlighted() after using planet card

formal quest
#

For some reason it's applying the effect even though I don't have the joker

normal crest
formal quest
#

if SMODS.find_card("j_givl_orbit", false) then

normal crest
#

find_card returns a table of every card found, next checks that it has at least 1 element

round furnace
#

ok

#

anyways how does one get started

normal crest
orchid thunder
#

anyone know why this isnt working

#

shoot wait

#

too big to send as message

shell timber
umbral zodiac
#

hi smg

normal crest
# orchid thunder

assuming this is inside the calculate joker function and if your joker is made with smods then you don't need to lovely patch this

lone dove
#

hey yall i have the debug mod and every time i spawn in one of my own jokers it crashes, im tryna test em and idrk what to do

#

i cant tell if its the debug mod or mine

umbral zodiac
#

i know nothing about this but if i had to assume its either your mod or a buggy version of debugplus and you should just update

orchid thunder
umbral zodiac
#

again you can change the effect
so long as it is an objectively better version of the original and it's unique in some way its good

#

the doc was just an initial guideline, i don't follow it most of the time if i come up with a better idea last minute

orchid thunder
normal crest
#

what was the issue

orchid thunder
#

its not doing the copying

#

and when i tried it with smods i would only get it to work with a weird retrigger error message

#

whats worse is i have a joker that is almost exactly like this and it works but this doesnt

formal quest
#

The score is displaying as it should. I can move on to actually scoring it now.

orchid thunder
formal quest
#

On the side, I want this joker to also make contained hands count as played hands for effects like to-do, hand counts, etc. How possible is that and what interactions could get confusing?

fallow breach
#

is there a way to track which poker hand was played last

#

across everything, not just a single round

formal quest
#

Possible either way but your definition of everything makes a big difference

#

Between runs or no?

fallow breach
#

no just within a single run

fallow breach
#

lay it on me discountimp

daring fern
fallow breach
#

alrighty

crisp coral
#

what was the calculate return for not pitching when scoring mult

orchid thunder
#

how do i add the compatable to a joker

celest aspen
#

anyone know how to prevent a joker that retriggers other jokers from also retriggering itself? Its main ability is chips, but has a slim chance to retrigger other jokers,

hasty mist
#

does this work? im somewhat confident that it works for the modded consumables since i was able to find a gateway in a spectral pack during testing, but im not so sure soul and black hole work

daring fern
balmy hearth
#

idk why its swapping 3 and 2 and adding "remaining" behind the 2

orchid thunder
fallow breach
#

i cannot figure it out 😔

#

the only time i see this used in an official joker is for hanging chad's unlock condition

fallow breach
#

i tried that, not sure if i did it right tho

lone dove
#

SMODS.Atlas{
key = 'freddy',
path = 'freddy.png',
px = 71,
py = 95
}

SMODS.Joker{
key = 'freddy',
set = 'Joker',
rarity = 1,
order = 1,
cost = 5,
unlocked = true,
discovered = true,
blueprint_compat = true,
config = {},
loc_txt = {
name = 'Freddy Fazbear',
text = {
'Gains {X:mult,C:white}x1.5{} {C:black}Mult{} after defeating {C:attention}5{} {C:attention}Blinds{}.',
'{C:inactive}Blinds defeated: {C:attention}#1#{}'
}
},
atlas = 'freddy',
pos = {x = 0, y = 0},
loc_vars = function(self, info_queue, center)
self.ability = self.ability or {}
return {vars = {self.ability.blinds or 0}}
end,
effect = function(self, context)
self.ability = self.ability or {}
self.ability.blinds = self.ability.blinds or 0
self.ability.upgraded = self.ability.upgraded or false

    if context.blind and context.won then
        self.ability.blinds = self.ability.blinds + 1
        if self.ability.blinds >= 5 and not self.ability.upgraded then
            self.ability.upgraded = true
            return {message = "Freddy powered up! x1.5 Mult"}
        end
    end
    if self.ability.upgraded and context.individual then
        return {x_mult = 1.5}
    end
end

}

#

my joker completely crashes my game could someone help look over my code

#

😭

#

im new to this so idk much

orchid thunder
#

i dont think context.won is a context

fallow breach
#

i want to keep track of the previous hand played, not the last played hand in a round

#

i don't think there's a way to that with vanilla mechanics though

hasty mist
#

what is the default soul_rate? literally every source i have is conflicting

daring fern
fallow breach
#

ok well idk what i'm missing

lone dove
fallow breach
#

something like this

orchid thunder
#

you can use the smods wiki to help you

frigid cargo
#

what does local ret = {} do?

orchid thunder
daring fern
frigid cargo
#

ah ok im just tweaking that

orchid thunder
daring fern
frigid cargo
#
if context.main_scoring and context.cardarea == G.play then
            if pseudorandom('GamblerAtHeart') < G.GAME.probabilities.normal / card.ability.extra.xmult_odds then
                return {
                    xmult = card.ability.extra.xmult
                }
            end
            if pseudorandom('GamblerAtHeart') < G.GAME.probabilities.normal / card.ability.extra.dollars_odds then
                return {
                    dollars = card.ability.extra.dollars
                }
            end
        end

i dont understand how psuedorandom works, can someone help me?

fallow breach
# fallow breach

for context, this ALWAYS triggers the xmult, as your last played hand and your current hand are techincally the same thing

#

i'm trying to figure out a way to store the hand you play when you play it, to then be compared and replaced by subsequent hands

#

but that's way outside my knowledge

snow vale
#

how can i make so i cant destroy a joker without using eternal sticker?

faint yacht
hasty mist
#

why is this always applying, instead of just when the variable is true?

#

did i return wrong somehow

hard flume
#

Does anyone have a guide on lovely patching?

gaunt thistle
#

I don't think a guide exists. Best option is to copy what other mods have done.

hard flume
#

Oki oki got it

gaunt thistle
#

It's conceptually simple: search for some code that matches some pattern, insert a payload before, after, or at (which replaces the matched code)

#

They patches are complicated but they operate more or less the same way

#

Copy just wholesale moves code into the target file.

#

And module patches inject Lua modules

chrome widget
#

Is there an effective way to rotate a card in place?

chrome widget
#

Cards have their origins at the top left rather than the center so I imagine it's not straightforward

hasty mist
gaunt thistle
#

Can you transform along an width/2 and height/2 offset from the origin?

hard flume
#

Tysm... what do i call you? Do I call you meth? Rul? Just metherul?

gaunt thistle
#

Meth is fine haha

gaunt thistle
#

Let me know if you have any issues. I can forward complaints to the lovely dev as well

hard flume
#

Oki, got it. Sorry, wasn't sure.

#

Tysm again though!

chrome widget
gaunt thistle
#

Gotcha

gaunt thistle
#

These general chats move fast

native zinc
#

John Lovely is usually pretty busy yeah

gaunt thistle
#

Psh

subtle merlin
#

Nvm, i think i understand

hard flume
#

The reason I need lovely patches is cuz im trying to make a custom modifier. I know stickers would be easier, but that wouldn't be allowing for what I want it to do tbh.

gaunt thistle
#

That's pretty reasonable

#

Just refrain from deleting code and you'll be fine

hard flume
#

I assumed that's the case, yeah, haha.

gaunt thistle
#

Lovely patches take some finesse to ensure that they don't break other mods

hard flume
#

Yeah; im gonna make sure to test compatibility with other mods

faint yacht
#

-# me with overwrite = true:

gaunt thistle
#

Ah yeah and give me feedback on the dev process in the lovely thread. I'm working on dev tooling on my vacation so I'd like input on what sucks.

gaunt thistle
faint yacht
#

...does it not?

gaunt thistle
#

iirc nope

#

never had

faint yacht
gaunt thistle
#

the overwrite field doesn't make sense considering the only way to overwrite code is with at so

gaunt thistle
#

Tbf I just woke up haha

hasty mist
faint yacht
#

Fair.

gaunt thistle
#

I knew I wasn't crazy haha

faint yacht
#

...I stand corrected-

next timber
#

how do i make the value in a joker description live update? i know there's misprint but that just changes randomly through a random feature with dynatext, which isnt what i need

gaunt thistle
#

bwahaha

#

I plan on reforming the patch format soonish

hasty mist
gaunt thistle
#

have you verified that your hook is being run?

next timber
#

its fine ive already figured it out lol

tranquil cypress
ancient mango
#

how do i make it so that bottom_hat only activates if its adjacent to top_hathere is the code:

SMODS.Joker {
    key = "bottom_hat",
    atlas = 'SpiderSushiMod',
    pos = { x = 1, y = 0 },
    config = { extra = { chips = 50, mult = 50 } },
    rarity = 1,
    discovered = true,
    cost = 3,
    blueprint_compat = true,
    loc_vars = function(self, info_queue, card)
            return { vars = { card.ability.extra.chips, card.ability.extra.mult, colours = { HEX('FF9A00') } } }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                chips = card.ability.extra.chips,
                mult = card.ability.extra.mult
            }
        end
    end
}
next timber
#

G.UIT.T objects have config.ref_table and config.ref_value, so i gave each joker a table at ability.extra.id_table to use as a key in G.GAME.rend_lowpercent_vals, set the ref_table to G.GAME.rend_lowepercent_vals, and set the ref_value to ability.extra.id_table
the id_table can just be empty since every table in lua is unique

#

so when the game shows the text, it checks ref_table[ref_value]

#

very useful

rotund sable
#

Bump

maiden phoenix
#

Ceremonial Dagger does the pos thing if you need a ref

ancient mango
maiden phoenix
#

Ah

#

Do you know of VanillaRemade

ancient mango
#

thats why i need help

tranquil cypress
ancient mango
#

i know the logic just not the code

maiden phoenix
#

Cant give more specific help rn sorry

ancient mango
maiden phoenix
#

Darn

copper thorn
#

how can i regroup all of my jokers in one group to make it that i can make something like that

25 * all_jokers_from_thismod

frigid cargo
#

have you put your jokers in a pool? if so you can just call that pool

next timber
#

moving it from G.GAME to REND (my mod variable) might help?

copper thorn
frigid cargo
lapis minnow
#

Hey so, I wanna make a balatro mod. How do you get started? I want to at first, just add a few simple Jokers. That makes wild cards give +50 chips, +5 mult, and x2 mult when scored.

I just have no clue where to start is the thing, not sure what programs I’ll need, what language I’ll code in, or any other info. I was wondering if there’s a beginner guide of sorts?

copper thorn
#

Visual Studio Code *

lapis minnow
copper thorn
#

try going bit by bit

#

and install steammoded that's easier and just a must-have for making mods

lapis minnow
#

Thank ya, I will go grab that

copper thorn
#

i think it's just needed to have steammodded

copper thorn
#

i can lend you one of my begginer .lua (im a begginer too) so you can see :) just don't steal my jokers pretty please

#

and gosh has this server helped me

lapis minnow
#

I will steal nothing, stealings no good

copper thorn
#

good

frigid cargo
#

DO NOT be shy to ask for help here, as a beginner myself people here were VERY helpful

copper thorn
#

i'd say 25% of my mod if not more is possible because of these incredible persons

frigid cargo
#

Also when asking help on your code, use three of these little thingy on the beginning and end (`)

#
It creates this
lapis minnow
#

Thank ya

hasty mist
#

how would i create a booster pack in the consumable slot?

crisp coral
#

smods.create_card the booster, then g.consumeables:emplace it

copper thorn
#

and put "lua" just after the first three thingy to make it more enjoyable to read

SMODS.Joker{
    key = "Parada",
    loc_txt = {
        name = "{C:legendary}Pa{}{C:gold}ra{}{C:common}da{}",
        text = {
            "Gains {X:mult,C:white}X1{} Mult",
            "every time that {C:attention}scoring hand",
            "contains {C:attention}three{} scoring cards",
            "{C:inactive}(Currently {X:mult,C:white}X#1#{C:inactive} Mult)"
        }
    },
    atlas = "LegParada",
    soul_pos = {x = 0, y = 1},
    rarity = 4,
    pos = { x = 0, y = 0},
    cost = 10,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true,
    config = { extra = { repetitions = 1 } },

#

for exmple

ancient mango
#

how do i make it so that bottom_hat only activates if its adjacent to top_hathere is the code:

SMODS.Joker {
    key = "bottom_hat",
    atlas = 'SpiderSushiMod',
    pos = { x = 1, y = 0 },
    config = { extra = { chips = 50, mult = 50 } },
    rarity = 1,
    discovered = true,
    cost = 3,
    blueprint_compat = true,
    loc_vars = function(self, info_queue, card)
            return { vars = { card.ability.extra.chips, card.ability.extra.mult, colours = { HEX('FF9A00') } } }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                chips = card.ability.extra.chips,
                mult = card.ability.extra.mult
            }
        end
    end
}
copper thorn
#

and it seems i don't know how to do such simple things as pools

frigid cargo
ancient mango
#

i dont know how

copper thorn
#

i jut put

pools = 
{ 
  [name of pool] = true

}
#

in the jokers infos ?

crisp coral
ancient mango
#

yea ik but i dont know how to loop like i barely know lua andi dont know where to learn lua

feral cove
#

is perma_mult not usable when discarded or

frigid cargo
# copper thorn i jut put ```lua pools = { [name of pool] = true } ```

What i do is this

SMODS.Joker{
    key = 'TWOPAIR',
    loc_txt = {
        name = 'TWO PAIR!!!',
        text = {
            'Gain {C:money}$2{} if poker hand is a {C:attention}Two Pair{}.'
        }
    },
    atlas = 'TWOPAIR',
    pools = {["Batrocities"] = true},

As you can see in the very bottom i have it as a pool for my mod

-- Batrocity joker pool
SMODS.ObjectType({
    key = "Batrocity",
    default = "j_Batrocities_MichaelWave",
    cards = {},
    inject = function(self)
        SMODS.ObjectType.inject(self)
    end,
})

In my core i have this

copper thorn
#

'k thanks :)

frigid cargo
#

Np

feral cove
copper thorn
#

what's wrong ? it crashes when i get my mouse on the joker that uses j_deity_all and when said joker triggers, every joker has the pools = {["deity"] = true}

hasty mist
#

what have i done wrong here

copper thorn
hasty mist
maiden phoenix
#

What crash do you get

hasty mist
#

this is what i get

maiden phoenix
#

Oh I didnt see properly, the paameter for SMODS.create_card isnt the same as the og create_card

hasty mist
#

ah

maiden phoenix
#

SMODS.add_card{key = boosterkey, area ...}

#

Smt like this

feral cove
frigid cargo
frigid cargo
copper thorn
#

still crashed :/

feral cove
#

this one

copper thorn
#

you don't wanna use it for that just makes it so that card_ability_mult = card_ability_mult + card_ability_extra_mult

feral cove
#

bonus**

frigid cargo
feral cove
#

yes I did

frigid cargo
#

Lemme check it rq

feral cove
copper thorn
#

for if a scoring hands coontains 3 scoring cards

#

i don't use perms and it does the same job as your should do

feral cove
#

would it save the previously obtained mult though
the idea behind this deck is "gain permanent +2 mult after discard"

feral cove
#

oh

#

interesting

copper thorn
#

i fell like it's easiet imo

feral cove
#

k I'll try it when I get back on my pc I gotta go offline now

copper thorn
#

'k byeeeee

frigid cargo
copper thorn
#

yeah

#

have all mu jokers in one pool

#

my*

#

then make it so that one of my jokers does X25 mult for every card in this pool in the joker space

frigid cargo
#

Wait, so all your jokers total? Or joker you have just in the joker area?

copper thorn
#

? let me re explain

the jokers does X25 mult for every joker in the pool you own (during game not in collection)

the poll has every card from the mod

frigid cargo
#

Heres what i have for a similar joker i have so you can just have reference if you want

SMODS.Joker{
    key = 'Grooph',
    loc_txt = {
        name = 'Grooph',
        text = {
            '{C:attention}Shape{} Jokers give {X:red,C:white}X1.3{} Mult.'
        }
    },
    atlas = 'Grooph',
    pools = { ["Shape"] = true, ["Batrocities"] = true },

    rarity = 2,
    cost = 7,
    pos = {x=0, y=0},
    unlocked = true,
    discovered = false,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true,

    config = { extra = {xmult = 1.3} },

    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.xmult } }
    end,
    calculate = function(self, card, context)
        if context.other_joker then
            if (context.other_joker.config.center.pools or {})["Shape"] then
                return {
                    xmult = card.ability.extra.xmult
                }
            end
        end
    end,
}

#

Did you understand what i did for mine?

copper thorn
#

yes and no, i understand you code but it doesn't help me understand what i should do on mine

idle plaza
copper thorn
#

ena mentioned

frigid cargo
#

That might be what you need

#
calculate = function(self, card, context)
        if context.other_joker then
            if (context.other_joker.config.center.pools or {})["deity"] then
                return {
                    xmult = 25
                }
            end
        end
    end,
}

Might this work for your calculate?

copper thorn
frigid cargo
#

Lemme see ur code

copper thorn
#

sooo uh it doesn't crash anymore but it retriiggers other "deity" cards and does X25 at each retrigger

copper thorn
frigid cargo
copper thorn
#

... x)

copper thorn
#

no, i just want X25 per "deity" not a retrigger

frigid cargo
#

OH

#
calculate = function(self, card, context)
    local deitycount = 0
    for i = 1, #G.jokers.cards do
        if G.jokers.cards[i].config.center.pools and G.jokers.cards[i].config.center.pools.deity then
            deitycount = deitycount + 1
        end
    end
card.ability.extra.xmult = deitycount * 25
    if context.joker_main then
        return {
            xmult = card.ability.extra.xmult
        }
    end
end,

Might that be it? Sorry it took a while im doing this on phone

copper thorn
#

no worries i can wait, your helping me i won't complain

frigid cargo
#

Can i see code for line 279?

copper thorn
frigid cargo
#

Oh mb do you have a config variable for xmult?

copper thorn
#

nope, that's what i thought

frigid cargo
#

Yeah add an xmult variable and set it to 25

#

That should fix it

copper thorn
#

to be clear, like this ?

frigid cargo
#

Yes but you can also put it in a line like this: config = { extra = { xmult = 25 }},

#

Makes it cleaner if you want

copper thorn
frigid cargo
#

Real

copper thorn
#

but i tested and the card just does not triggers now

frigid cargo
#

Does it give the mult?

copper thorn
#

no, nothing it just stands here, menacingly

frigid cargo
#

Send the entire joker ss including the atlas parts and stuff

copper thorn
#
SMODS.Atlas {
    key = "li",
    path = "li.png",
    px = 71,
    py = 95
}

--im working on this one :
SMODS.Joker { 
key = "li",
    loc_txt = {
        name = "{C:dark_edition}The Abrupt One",
        text = {
            "{X:mult,C:white}X25{} Mult",
            "for every filled joker slot",
            "{C:inactive}This joker included",
            "{C:dark_edition}A voice, acient and vast, booms across the void,",
            "{C:dark_edition} echoing through the herts of all who hear",
        }
        
    },
    atlas = "li",
    pools = {["deity"] = true},
    soul_pos = {x = 0, y = 1},
    rarity = "awak_ab",
    pos = { x = 0, y = 0},
    cost = 50,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true, 
    config = { extra = {
        xmult = 25,
    },
    loc_vars = function(self, info_queue, card)
        return { vars = { G.jokers and math.max(25, (G.jokers.config.card_limit + #G.jokers.cards) + #SMODS.find_card("j_awak_li", false)) or 1 } }
    end,
   calculate = function(self, card, context)
    local deitycount = 0
    for i = 1, #G.jokers.cards do
        if G.jokers.cards[i].config.center.pools and G.jokers.cards[i].config.center.pools.deity then
            deitycount = deitycount + 1
        end
    end
card.ability.extra.xmult = deitycount * 25
    if context.joker_main then
        return {
            xmult = card.ability.extra.xmult
        }
    end
  end,
 }
}
#
-- Deity joker pool
SMODS.ObjectType({
    key = "deity",
    default = "j_awak_deity",
    cards = {},
    inject = function(self)
        SMODS.ObjectType.inject(self)
    end,
})```
#

whata else is needed ?

#

and i misspelled "ancient" in the desc x)

frigid cargo
#

Wait whats the return in the loc_vars supposed to do?

placid star
#

NOO CURSE YOU THUNK

idle plaza
copper thorn
frigid cargo
copper thorn
frigid cargo
#

Huh?

#

No

copper thorn
#

maybe it was sorry i got lost

idle plaza
frigid cargo
copper thorn
#

i figured yeah

#

it still doesn't work

frigid cargo
#

Game was prob wondering why there was so much properties

copper thorn
#

x)

frigid cargo
#

Whats happening now?

copper thorn
#

i feel like sisyphus

copper thorn
#

just here no mult no nothing

frigid cargo
#

Hmm

#

You did remove the } in the end right?

copper thorn
#

and note : in the ss i haven't updtated the desc don,t follow what it says

copper thorn
frigid cargo
#

How bout try checking if the joker main is even working

copper thorn
#

?

frigid cargo
#

We can tell then if its a problem on the context or not

#

Like instead of card.ability.extra.xmult just put 25

copper thorn
#

every extra.mult ?

#

or only the return one

frigid cargo
#

Only the return in the joker_main

copper thorn
frigid cargo
#

Whats on line 283

copper thorn
#

card.ability.extra.xmult = deitycount * 25

frigid cargo
#

Dawg im tweaking as well

copper thorn
#

me too

#

what in the crackheads is happenning ?

frigid cargo
#

Send new code rn

midnight hornet
#

what's the suggested set up for developing a mod? I want to be able to update the mod while developing without restarting the game (im on mac so I have to run steammod with run_lovely_macos.sh). What's your workflow in mod dev?

copper thorn
#
SMODS.Atlas {
    key = "li",
    path = "li.png",
    px = 71,
    py = 95
}

--im working on this one :
SMODS.Joker { 
key = "li",
    loc_txt = {
        name = "{C:dark_edition}The Abrupt One",
        text = {
            "{X:mult,C:white}X25{} Mult",
            "for every deity owned",
            "{C:inactive}This joker included",
            "{C:dark_edition}A voice, ancient and vast, booms across the void,",
            "{C:dark_edition} echoing through the herts of all who hear",
        }
        
    },
    atlas = "li",
    pools = {["deity"] = true},
    soul_pos = {x = 0, y = 1},
    rarity = "awak_ab",
    pos = { x = 0, y = 0},
    cost = 50,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true, 
    config = { extra = {
        xmult = 25,
    }
},
    loc_vars = function(self, info_queue, card)
        return { vars = { G.jokers and math.max(25, (G.jokers.config.card_limit + #G.jokers.cards) + #SMODS.find_card("j_awak_li", false)) or 1 } }
    end,
   calculate = function(self, card, context)
    local deitycount = 0
    for i = 1, #G.jokers.cards do
        if G.jokers.cards[i].config.center.pools and G.jokers.cards[i].config.center.pools.deity then
            deitycount = deitycount + 1
        end
    end
card.ability.extra.xmult = deitycount * 25
    if context.joker_main then
        return {
            xmult = 25
        }
    end
  end,
 }```
ancient mango
#

in smods how do i define my own pker hand parts like i want one that is like the first 4 cards are a flush(like with four fingers) and the last 4 cards are stright(like with four fingers) but i dont know where and how to define the part:

SMODS.PokerHandPart {
    key = "gay"
    func(hand)
}

SMODS.PokerHand {
    key = "Gay Flush",
    mult = 10,
    chips = 110,
    l_mult = 5,
    l_chips = 45,
    example = {
        { 'S_K', true },
        { 'S_J', true },
        { 'S_T', true },
        { 'S_9', true },
        { 'H_8', true }
    }
}
copper thorn
red flower
#

that just changes the name as far as i know

frigid cargo
ancient mango
#

bro how define the fuckiung part hand thing (also the name doesnt really matter)

frigid cargo
copper thorn
#

and the card does not trigger back when it won't crash

placid star
#

what is the line it crashes on

#

the code i mean

frigid cargo
jagged zodiac
#

the art isn't right yet appearently, but I just made this amazing jonkler

copper thorn
#

283, i know the error on this one and corrected it

red flower
#

they mean what's the line in the code

frigid cargo
#

Ah

copper thorn
jagged zodiac
red flower
frigid cargo
#

N' the goat

copper thorn
frigid cargo
#

Put everything outside of the joker_main, inside the joker_main

#

From deitycount to 25

jagged zodiac
placid star
#

u werent lying huh

placid star
jagged zodiac
copper thorn
#

like this

frigid cargo
jagged zodiac
red flower
jagged zodiac
placid star
frigid cargo
frigid cargo
copper thorn
#

like this ?

jagged zodiac
# frigid cargo Code?

ah, I've edited it from SampleJimbos which I found somewhere

SMODS.Joker{
    key = "jimba",                                 --name used by the joker.    
    config = { extra = { chips = 30 } },    --variables used for abilities and effects.
    pos = { x = 0, y = 0 },                              --pos in spritesheet 0,0 for single sprites or the first sprite in the spritesheet.
    rarity = 1,                                          --rarity 1=common, 2=uncommen, 3=rare, 4=legendary
    cost = 2,                                            --cost to buy the joker in shops.
    blueprint_compat=true,                               --does joker work with blueprint.
    eternal_compat=true,                                 --can joker be eternal.
    unlocked = true,                                     --is joker unlocked by default.
    discovered = true,                                   --is joker discovered by default.    
    effect=nil,                                          --you can specify an effect here eg. 'Mult'
    soul_pos=nil,                                        --pos of a soul sprite.
    atlas = 'jimba',                                -- atlas name, single sprites are deprecated.

    calculate = function(self,context)                   --define calculate functions here
        if card.debuff then return nil end               --if joker is debuffed return nil
        if context.joker_main and context.cardarea == G.jokers then
            return { -- returns total chips from joker to be used in scoring, no need to show message in joker_main phase, game does it for us.
                chips = card.ability.extra.chips, 
                colour = G.C.CHIPS
            }
        end
    end,

    loc_vars = function(self, info_queue, card)                              --defines variables to use in the UI. you can use #1# for example to show the chips variable
        return { vars = { card.ability.extra.chips }, key = self.key }
    end
}
red flower
#

you don't need to check for card.debuff

#

idk why they kept that

jagged zodiac
#

oh

#

is that automatically done??

red flower
#

yes

#

key = self.key is also not needed

#

oh the problem is that you're missing an argument in calculate

#

it should be (self, card, context)

jagged zodiac
#

I'll try

#

wowow thanks ^>^

red flower
jagged zodiac
#

thank you ^>^

#

time to add the 7 or 8 orso other ideas I had

#

there should only be one that's actually like, complicated

copper thorn
red flower
copper thorn
red flower
#

did you restart the run before testing?

jagged zodiac
#

wait

#

the spectral card for purple seals is called medium..

copper thorn
#

i restarded now and it triggers but only does X25 even though other "deity"s are here

jagged zodiac
#

I wanted to call one of my jokers 'medium'...

red flower
copper thorn
#

ok now it works just fine, thanks you so much N it has been 2 hours i/we are/am on it

modern kindle
#

Hi N how fares the illness

red flower
#

😞

placid star
frigid cargo
red flower
umbral zodiac
#

how do you get a cards display name from its center

jagged zodiac
#

it's very blurry but I'll fix that later yay

#

also the x1.5 isn't coloured for some reason

red flower
umbral zodiac
jagged zodiac
red flower
umbral zodiac
#

i see

frigid cargo
jagged zodiac
#

I had "{C:xmult}x#1#{} Mult"

rotund sable
#

why is it crashing when i open up the collection??

SMODS.Atlas({
    key = "LetsGoGambling", 
    path = "letsgogambling.png", 
    px = 71,
    py = 95, 
    frames = 40,
    atlas_table = "ANIMATION_ATLAS"
}):register()
...
atlas = "LetsGoGambling",
pos = {x=0, y=0},
...
frigid cargo
#

No mb i ment the #1#

jagged zodiac
rotund sable
#

{X:mult,C:white}

frigid cargo
#

I need to be more specific

jagged zodiac
#

oh yeah that's what the example mod did :v

frigid cargo
#

What #(no.)# does is it represents what the return is on the loc_vars

#

That prob does not makes sense

red flower
rotund sable
#

sure but i had it on every other atlas and it worked ¯_(ツ)_/¯

#

still the same error

red flower
#

is this for a blind?

jagged zodiac
#

how do you scale these images without making them blurry??

frigid cargo
#

What do you use for drawing?

rotund sable
jagged zodiac
#

oh wait

#

I think I found something

red flower
jagged zodiac
rotund sable
frigid cargo
rotund sable
red flower
#

they manually change sprites in update

jagged zodiac
#

can you reload mods without quiting and restarting the entire game??

red flower
#

no

jagged zodiac
#

alright

rotund sable
jagged zodiac
placid star
#

i get a crash here and i know its because of my checking lug, but im not sure why

placid star
red flower
#

not the same thing

#

in lua empty tables are truthy

placid star
#

so lug[1] instead?

#

but the crash only started when i started search through the results from the find_card

red flower
#

yeah but it has to be at the beginning of the check

placid star
#

so this should be better, but i dont think this fixes my crash

red flower
#

remove the not

placid star
#

but this checks that you dont have luggage card and that luggage card has already been drawn, then if you have no hand size game ends

red flower
#

ok then remove the not from around lug[1] and keep it for the other check

placid star
#

yeah i saw the error i think this should fix that problem

solid grotto
#

I'm trying to make a joker that makes wild cards immune to debuffs, so I'm looking at the extra credit mod as reference
But I have absolutely no idea how this joker functions

#

No calculate?

#

I feel like I'm missing something obvious

unborn bay
#

this means that the implementation for this is somewhere else

#

like a hook

#

something that can't really be done via a mere calculate function

#

since its something related to debuffs, it might be a hook related to Card.set_debuff that you're looking for

red flower
#

if you want something simpler, "can't be debuffed by blinds" can be done through calculate easily

solid grotto
#

How would I do that

red flower
#

my thing?

solid grotto
#

Yes

placid star
#

@red flower i finally got all my stuff working, so my change is now implemnted with big thanks to you!

solid grotto
#

I'm trying to cross reference different mods to see how they remove debuffs and all of them do it in a different way lol

#

And all of them are pretty confusing

red flower
# solid grotto Yes
if context.debuff_card and next(SMODS.get_enhancements(context.debuff_card)) then
    return { prevent_debuff = true }
end
solid grotto
#

If I want to only remove debuffs from wild cards do I make it (SMODS.get_enhancements(context.debuff_card)["m_wild"])

#

I'm just looking at other stuff with the get_enhancements

red flower
#

and SMODS.has_enhancement(context.debuff_card, "m_wild")

solid grotto
#

It works

#

Dope

#

Thank you sm

jagged zodiac
#

does somebody know how to have a joker add joker slots??
looking at how the negative edition works hasn't helped me much, because the adding a joker slot doesn't seem to happen there

manic rune
#

i disappeared for one day, surely i didnt miss anything

placid star
manic rune
#

G.jokers:change_size(1)?

red flower
manic rune
#

a

#

i see

jagged zodiac
#

is there a list of all things like add_to_deck and remove_from_deck and calculate??

red flower
jagged zodiac
#

thanks ^>^

jagged zodiac
#

and I couldn't find an event, or whatever those things are, which are triggered when a card is attempted to be bought
otherwise I would put the 'add joker slot' thing at that event

red flower
#

you need to hook G.FUNCS.check_for_buy_space iirc

jagged zodiac
#

ah I'll look it up

rotund sable
jagged zodiac
#

ah I think I figured it out

jagged zodiac
# rotund sable https://github.com/SpectralPack/Cryptid/blob/ee062a6c4bf25747ea2e7d4d0b810ccdea1...

yeah, I looked there already
but the code for being able to buy is this

-- These allow jokers that add joker slots to be obtained even without room, like with Negative Jokers in vanilla
local gfcfbs = G.FUNCS.check_for_buy_space
G.FUNCS.check_for_buy_space = function(card)
    if
        (card.ability.name == "cry-Negative Joker" and card.ability.extra.slots >= 1)
        or (card.ability.name == "cry-soccer" and card.ability.extra.holygrail >= 1)
        or (card.ability.name == "cry-Tenebris" and card.ability.extra.slots >= 1)
    then
        return true
    end
    return gfcfbs(card)
end

in overwrites.lua
not jokers.lua

rotund sable
#

i linked to there

#

👀

jagged zodiac
#

oh x3

#

thank you then~ found it just before

vast night
#

Yippe its me again! Big and small question: How can i have two souls hover over a card (not specifically joker, i mean an ui object)? I think this would involve adding a new draw_step but I'm unsure
Edit: I would also like to know if its possible to adjust the speed of both hovering arts

tall wharf
jagged zodiac
#

hmm

tall wharf
#

you probably have to create a new children

#

and UI definition for it if you're doing UI shenanigans

ruby moon
#

Guys, I wanted to know if anyone here is interested in making a mod just to change the deck's skin to the Rain World theme, I can do the art, but trying to make the mod I saw that it's not my area
Here is an example of what the rest of the art will look like:

#

And sorry for the long text

jagged zodiac
#

do you just want to change the art, nothing else about the game??

feral cove
#
SMODS.Back{
    name = "Scarlet Deck",
    key = "scarlet",
    config = { discards = 3, extra = { mult = 2 } },
    atlas = "scarlet",
    pos = {x = 0, y = 0},

    loc_vars = function(self, info_queue, back)
        return { vars = { self.config.discards, self.config.extra.mult } }
    end,
    calculate = function(self, card, context)
        if context.discard and context.other_card and not context.other_card.debuff then
            self.config.extra.mult = (self.config.extra.mult or 0) + self.config.extra.mult
            return {
                extra = { message = localize('k_upgrade_ex'), colour = G.C.MULT},
            }
        end
    end
}

does anyone know what this crash is

ruby moon
jagged zodiac
#

and I'm getting stuck on the simplest thing

placid star
#

how can i make sure my custom G.GAME var is saved on quit out? it doesnt seem to be saved currently

ruby moon
jagged zodiac
#

maybe I'll know in a week and can help then, I assume it takes a while to make the art anyway

jagged zodiac
#

and one watcher :v

ruby moon
#

For the first deck, I was assuming about 13 days to make it.

placid star
#

so youre making a texture pack?

ruby moon
#

Unfortunately vanilla only has 3 😔

jagged zodiac
#

spades: watcher
hearts: hunter
diamonds: monk
clubs: survivor

something like that??

ruby moon
drowsy acorn
#

anybody know why this doesnt do anything? ``` calculate = function (self, card, context)
if context.selling_self then
card.ability.extra.enabled = false
print'sold'
end

    if card.getting_sliced then
        print'bye'
    end
end,```
placid star
#

@ruby moon read into malverks documentation for how to make texture packs

ruby moon
#

No, where is that document? Is this on the "Modding" channel?

jagged zodiac
#
local gfcfbs = G.FUNCS.check_for_buy_space
G.FUNCS.check_for_buy_space = function(card)
   if
      (card.ability.name == "moderate_jonkler")
   then
      return true
   end
   return gfcfbs(card)
end

is there something obviously wrong with this???
when I just let it return true always, it does work to let you buy anything
but like this, it doesn't work??

#

I had this like too

    key = "moderate_jonkler", atlas = 'moderate_jonkler', name = 'moderate_jonkler',
#

I also tried with 'key' instead of 'name'
also with 'rarity'

placid star
#

its a seperate mod made to handle texture packs, there should be documentation in #1209506514763522108 and on github

ruby moon
jagged zodiac
placid star
placid star
jagged zodiac
#

wow it works like that!!

#

thank you ^>^

#

any idea why my thing didn't work??

placid star
ocean goblet
#

hey. checking in again

ruby moon
placid star
#

sure

ocean goblet
#

trrying to check the atlas position of a joker's sprite which i change over time

ruby moon
ocean goblet
# ocean goblet trrying to check the atlas position of a joker's sprite which i change over time
calculate = function(self, card, context)
        if card.children.center.sprite_pos == {x = 0, y = 1} then
            print("plink")
        end
        if context.cardarea == G.play and context.individual and card.children.center.sprite_pos == {x = 0, y = 1} then
            G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
                    return{
                message = "blink",
                chips = card.ability.extra.mod1,
                card = card
            }
                end }))
        end
    end
#

so far ive tried this but it did not work

#

is there something i'm missing?

placid star
#

does sprite_pos check for atlas position or the actual position on the screen?

ocean goblet
#

lemme try printing that actually

#

good thinking

rotund sable
#

how do i make sure the joker i created at the end of the round doesn't scale in that round?

ocean goblet
#

okay so it DOES check the table

placid star
rotund sable
# placid star whats the code
if context.end_of_round and context.game_over == false and not context.blueprint then
    card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.plus_mult
    SMODS.calculate_effect({message = '+2 Mult', color = G.C.MULT}, card)
end

this is the scaling part.

placid star
#

mhm

#

youll want a context.main_eval so it doesnt trigger multiple times

ruby moon
#

@placid star Just one question, to apply this mod there is no other way other than using steamodded and lovely, right?

placid star
#

so no

ruby moon
#

Ok, thanks 🫡

ocean goblet
placid star
rotund sable
placid star
rotund sable
#

why didn't i think of events 🙏

#

ty

near bay
#

how do i check how many cards with a suit there are in deck

placid star
placid star
#

in my mod is have jokers that retrigger other (not blueprint)

near bay
#

then what do i do

placid star
#

well it depends, are u going to make it a function or use it once

near bay
#

a function.

im making a joker add a random enhanced card with a random rank and the suit being the least amounts of cards with a suit.

placid star
#

well then outside of the joker do

function poll_suits()
--func code here

pallid hemlock
#

where are the decks stored within the gamedata?
i want to get the sprites for every deck but i dont want to just make a big list with all the atlases/pos combos for each deck

primal terrace
#

So I have this Joker that checks for the number of formed Pairs in a played hand

I coded it like this, which works fine for Vanilla, but I feel it's dubious if I for example. install Cryptid and play an Ultimate Pair

How can I code it so that it dynamically checks the number of formable pairs, instead of hard-coding the check?

primal robin
#

Wow, something new

#

<@&1133519078540185692>

formal quest
#

And it's gone 😎

stiff quiver
#

for some reason this is crashing, can someone help? ```lua
SMODS.Shader{
key = "filteredshader",
path = "filtered.fs"
}
SMODS.Edition{
shader = "filteredshader"
-- theres the rest of stuff like name, key etc but they are irrelevant i think
}

primal terrace
#

I feel like I missed something

formal quest
#

Begone spambots

hallow forge
primal terrace
#

Is this what the afterlife is like?

hallow forge
#

:get_id() gets a cards rank

primal terrace
#

Oh cool, so I get a list of all played cards, and check how many ranks have more than two?

formal quest
#

Pretty much yeah

hallow forge
#

note negative ids mean no rank

formal quest
#

Since you're counting any number of a kind as one pair, that's enough

primal terrace
#

Nice

#

I wonder why Cryptid didn't come up with something like this first, they love Pairs

formal quest
#

Vanilla definitely doesn't have enough love for two pair and full house

drowsy acorn
#

im trying to get my joker to do stuff when its destroyed, but doing it like this doesnt do anything and ive got no clue why, does somebody know whats going wrong here? ```SMODS.Joker {
key = 'kamikaze',
loc_txt = {
name = 'Kamikaze',
text = {
"When this Joker is destroyed, create a copy that gains x1.5 Mult (Currently x1 Mult)"
},
},

config = {extra = {Xmult = 1, Xmult_mod = 1.5, enabled = true}},
rarity = 2,
atlas = 'CosmicTomfoolery',
pos = {x=4,y=1},
cost = 6,
blueprint_compat = true,

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

calculate = function (self, card, context)
    if context.selling_self then
        card.ability.extra.enabled = false
        print'sold'
    end

    if card.getting_sliced then
        print'bye'
    end
end,

}```

merry frost
#

Are you able to get the config parameters from another mod using SMODS?

formal quest
#

How do I change base chips & mult when a hand is played?

stiff quiver
placid star
stiff quiver
#

no, someone else im making the mod with did it

#

but they sent it to me and shader isnt shadering

formal parrot
#

Does your shader exist in the mod file

#

Wait

formal parrot
stiff quiver
#

yes

#

lmao

#

glad to be known for that

formal parrot
#

Damn

red flower
formal parrot
#

Tuff times

#

Check your mod folder maybe its a typo

drowsy acorn
red flower
stiff quiver
#

already checked, changed the key three times, copied the entire file path and deleted what wasnt necessary, changed the shader key in the edition to "foil" to see if it set the foil shader (it did)

formal quest
#

How do I modify base chips & mult? This code doesn't do anything to chips and sets mult to 0, even though it works perfectly for the before scoring display.

lament agate
#

need some checking for my code

stiff quiver
#

this is the folders so it isnt that

lament agate
#

the card doesnt retrigger when scored, any ideas? (ignore the vol things)

red flower
formal parrot
red flower
#

i hate discord

stiff quiver
#

not the file name either

#

it just doesnt want to work

formal parrot
#

😭damn

placid star
#

@red flower okay so i get this error on saving and quitting, im assuming its because when i quit and reload G.GAME.luggaged_card doesnt get saved and is instead stored as "MANUAL_REPLACE", so my question is how would i save G.gAME.luggage_card

red flower
#

i think you need a cardarea but im not sure

stiff quiver
#

not the key either, so probably just my computer hating me

placid star
#

the card area only exists as a main_end node in the loc vars of the joker

red flower
#

i mean making a global one but if the card is in deck it doesn't work

#

no idea, never done something like that

normal crest
placid star
#

ill try it without declaring lugagge_card first

placid star
#

so it must be something to do with that...

stiff quiver
#

still nothing

red flower
stiff quiver
#

yeah

red flower
#

or retrigger_joker_check (i think?) for joker retriggers

normal crest
lament agate
#

oh oka

stiff quiver
#

i also asked them if it needed variables and they said no

normal crest
#

okay

formal quest
placid star
red flower
formal quest
#

if context.modify_hand then

red flower
#

that seems like it should work

formal quest
#

Here's the entire calculate function

red flower
drowsy acorn
formal quest
red flower
formal quest
drowsy acorn
#

welp that worked

red flower
# formal quest Yes

you dont need get poker hand info then
replace contained with context.poker_hands

drowsy acorn
#

thanks a bunch

placid star
red flower
#

incorrect?

normal crest
#

are you trying to save a card object

red flower
#

cyclic tables don't get saved, like cards

small tartan
#

Hi guys any guide to mod "Balatro" in the title screen?

placid star
placid star
small tartan
#

Wanted to change the game's name to El balatro, for fun

I have experience with Photoshop so if it's not a font-like thing i can do the graphic too

long sun
#

hiya! does this code suffice if i don't want Zodiac cards to appear at all, if the option is disabled?

fallow breach
long sun
#

oh also, is there a way to disallow the player from selecting a particular deck?

wild escarp
#

Anyone know why this doesn't draw with editions? (excluding foil.)

draw = function(self, card, layer)
    if card.config.center.discovered then
        if (layer == 'card' or layer == 'both') and card.sprite_facing == 'front' then
            local scale_mod = 0.05 + 0.05 * math.sin(1.8 * G.TIMERS.REAL) +
                0.07 * math.sin((G.TIMERS.REAL - math.floor(G.TIMERS.REAL)) * math.pi * 14) *
                (1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL))) ^ 3
            local rotate_mod = 0.1 * math.sin(1.219 * G.TIMERS.REAL) +
                0.07 * math.sin((G.TIMERS.REAL) * math.pi * 5) * (1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL))) ^ 2

            local image = Sprite(0, 0, 71, 95, G.ASSET_ATLAS["willatro_WillatroOrgans"], {x = 1, y = 0})
            image.role.draw_major = card
            image:draw_shader('dissolve', 0, nil, nil, card.children.center, scale_mod, rotate_mod, nil,
                0.1 + 0.03 * math.sin(1.8 * G.TIMERS.REAL), nil, 0.6)
            image:draw_shader('dissolve', nil, nil, nil, card.children.center, scale_mod, rotate_mod)
        end
    end
end
red flower
long sun
#

mm, unfortunate

#

it means that modded Zodiacs would have to have the in_pool stuff

formal quest
red flower
long sun
#

not that it matters much anyway ^u^ they can't appear in the shop

#

rightright

#

where would i put that?

red flower
long sun
#

if i'm using a config to disable them

red flower
red flower
long sun
#

rightright ^^

red flower
#

unless the ui element you use in the config has a callback function

long sun
#

it doesn't have one

formal quest
# red flower remove the update_hand_text line

It doesn't just appear to get added, it actually does. The update text line was unnecessary but it also doesn't fix the behavior by removing it. I probably need to update the if statement inside the loop to filter out the played hand

red flower
#

oh yeah

formal quest
#

How do I check for played and contained hands?

red flower
#

context.scoring_name is the played one

fallow breach
#

this will log your last played hand after the first hand you scored with the joker

#

then each subsequent hand has the previous hand as a check to see if it returns xmult

#

ahaha i did it i'm so good

red flower
# fallow breach

i dont recommend using global variables, specially not with generic names
you should use card.ability.extra.previous_hand

fallow breach
#

would that be effectively the same thing?

red flower
#

yes

fallow breach
#

cool cool

midnight hornet
#

@red flower im looking for a function that can be called in a mod that is able to play the current hand. if the current hand is ♠A, ♣A, ♦K, ♥Q, ♣Q, ♣9, ♠6 ♥5, I'd like to call a function to perfom the action of discard ♣9, ♠6 ♥5. I know which card I want to discard/play but I cannot find a function in smods to perform this action in game.

pure salmon
#

how does the new additive probability work?

midnight hornet
formal quest
# red flower `context.scoring_name` is the played one

It works now, thanks. I could make it seamless and make the display show the extra chips and mult between playing and scoring start, but I might make it like a reverse flint instead and show it with an animation before scoring. Can I do that by bringing back the update text line with some different arguments?

red flower
red flower
midnight hornet
red flower
#

let me check to play a hand

red flower
long sun
#

oh ya @red flower does this look okay? the base rate is 0 anyway, but it's in case someone wants them to appear in the shop

#

i've made sure that the cache exists, btw

red flower
#

that's what i would do yeah

long sun
#

awesome ^u^

#

oh ya there's still Today & Tomorrow Deck

#

lemme see if the documentation has a way to disable decks

#

dfkjngjkdfkjgnd backs can have in_pool

#

very weird

#

me buying a deck in the shop

formal quest
#

Is there a list of vanilla sound IDs?

placid star
#

do playing cards have a unique id that NEVER changes even if other cards are destroyed

formal quest
#

What's the id of the planet upgrade sound?

sturdy compass
#

I think it's tarot1

summer furnace
#

is there a way to make like an instant win? like if a condition is met it just wins the game

long sun
#

hmm, the game's saying dt is nil

#

oops wait i forgot to add self

placid star
primal robin
long sun
#

ya aware ^^ the fix worked

long sun
primal robin
#

Also, in most cases, for hooks, unless you need arguments from it, use ...

#

Who knows which new arguments will appear in next balatro update

#

Better be ready

#

Wait, why you're using game update for setting game variables

#
YourMod.current_mod.reset_game_globals = function(run_start)
  -- set them here
end
#

Maybe it's not 100% covers yor needs, but you' better check it out

fallow breach
red flower
#

I recommend the modprefix to avoid conflicts

fallow breach
#

where would that be nested

red flower
#

you can just use it directly

primal robin
#

Prefix everything which stored in globals, including G.FUNCS and localization keys Lumaflute

fallow breach
#

ok!

river apex
#

Hello
I was making a joker that changes the hand size
I copied what is made with the vanilla remade:

SMODS.Joker {
    key = "juggler",
    blueprint_compat = false,
    rarity = 1,
    cost = 4,
    pos = { x = 0, y = 1 },
    config = { extra = { h_size = 1 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.h_size } }
    end,
    add_to_deck = function(self, card, from_debuff)
        G.hand:change_size(card.ability.extra.h_size)
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.hand:change_size(-card.ability.extra.h_size)
    end
}


But I have an internal counter that will change multiplicatively the hand size this so I wrote :

SMODS.Joker {
    key = "scarabHand",
    blueprint_compat = false,
    rarity = 1,
    cost = 4,
    pos = { x = 0, y = 0 },
    config = { extra = { h_size = 1 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.h_size * G.GAME.pharahos_scarabs } }
    end,
    add_to_deck = function(self, card, from_debuff)
        G.hand:change_size(card.ability.extra.h_size * G.GAME.pharahos_scarabs)
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.hand:change_size(-card.ability.extra.h_size * G.GAME.pharahos_scarabs)
    end
}



The problem is that the initialisation of the hand size and the value of the variable are only made when the joker spawn
After that, any changes will not affect thoses fonction
Can I add them in a "if context then" to refresh theses values ?

midnight hornet
red flower
formal parrot
#

Any idea how can i make face cards unable to be drawn from deck

vast night
#

Hey. Where is the display text joker name stored in its card? Im using center.key, but this dosen't return the name for modded jokers

placid star
#

is there anything wrong with this if?

river apex
vast night
placid star
summer furnace
#

is there somehow a way to make a joker that instantly wins the run?

vast night
placid star
vast night
river apex
summer furnace
#

oh and is it somehow possible to remove the endless mode? (its for a joke)

vast night
summer furnace
#

with ()?

#

doesn't exist sadly

red flower
# river apex It is not documented here that is why I ask

yeah it's not, context.amount is the amount of cards about to be drawn and you can return cards_to_draw to draw extra cards

you might need to use those, but mainly I was suggesting it because that context is called before cards are drawn to hand

summer furnace
#

so is there any other way to do that?

vast night
#

uhm

red flower
summer furnace
#

well what did I do wrong then?