#💻・modding-dev

1 messages · Page 582 of 1

long sun
#

is there an alternative to using the front?

hardy viper
#

what is it that you're trying to do anyways

daring fern
long sun
hardy viper
#

ah

#

is the hat a soul sprite

long sun
#

nope, it's the card's front right now

#

as are all of my Jokers' overlay sprites, except for the Legendaries and Possession

hardy viper
#

that works?

daring fern
long sun
#

apparently :3

hardy viper
long sun
#

part of the reason why i want this alternative

daring fern
frosty rampart
long sun
#

lemme take a look at DrawStep

hardy viper
#

pretty outlandish

long sun
#

still

#

i have Entropy crossmod so

hardy viper
#

drawstep good yes

long sun
#

i've never used a DrawStep iirc so i'd like some help with the bits i don't understand yet

frosty rampart
#

making the new drawstep should be relatively easy, you can probably just copy the front drawstep and change a few things

long sun
#

grand

frosty rampart
#

(all the vanilla/smods drawsteps are in src/card_draw.lua in smods)

long sun
#

yupyup

#

thanks for your help :D

#

/gen

#

okay question

#

the func for the front drawstep mentions self.children.front a lot

#

i assume that was assigned earlier

#

what do i need to do to assign a new layer?

#

is that done automatically?

daring fern
long sun
#

could you give an example?

#

actually wait i think i've got this

#

lemme try something

daring heron
#

thanks, tho the stake description says "applies black stake" instead of "applies all previous stakes" now

#

but still amazing

#

i'll credit you instead of me since i really didnt do anything lol

long sun
#

how's this looking?

mystic river
daring heron
#

thanks tho

rotund sable
#

literally the same thing

daring heron
#

i tried looking for smth like this but i couldnt

#

yeah

daring fern
rotund sable
#

you just stole the idea smh

long sun
hardy viper
#

create it in set_sprites probably

long sun
#

;u;

#

overwhelmed

hardy viper
#

@umbral zodiac noway

hardy viper
#

if u wanna read that

long sun
#

where do i define it? on the card, or elsewhere?

#

do i hook it?

daring fern
hardy viper
#

normal function on a center

long sun
#

okay i've got two answers now ;u;

#

oh ya one more question

#

what should self.T.y be if i'd like the extra sprite's bottom edge to be 1/4 of the card's height from its top?

#

like

#

about here

#

it was said that it's not related to pixel size so i'm wondering what it depends on

#

if it was pixel size, it'd be ((3/4 * card height) + extra height) / 2 i think (from the bottom)

hardy viper
#

virtual pixels or smth

#

there's an smods function converting between the two (it is a one liner)

long sun
#

right, goodgood

#

what's it called? i don't see it in the docs

distant junco
#

yo, ive looked in the utils and documentations and im still not sure, how can i check if a card is destroyed?

daring fern
distant junco
#

playing card

long sun
#

okay i'm very lost 😭

daring fern
willow scroll
#

this should just make cards that are flipped still show their description right?

#

or did i forget smth

long sun
#

taking a break

round lion
#

should i avoid declaring local variables in calculate all together

#

it seems like all the variables are getting reset as soon as any calculate triggers

mystic river
daring fern
round lion
#

if i dont leave a global variable in g.game will i be affected by ramifications as well

mystic river
#

global variables in G.GAME get reset when a new game starts
other global variables generally do not

#

if you make your own global variable it definitely won't, though it will get reset when the game is shut down

#

(unless you actively save it, which i don't know how to do)

faint yacht
#

-# As long as it is defined under G.GAME and is not a Card object(?) or a recursive table, it'll get saved.

round lion
#

DUDE I FORGOT EVERYTHING NOW

mystic river
#

if you want something to be saved between games, you can save it in SMODS.current_mod.config["variable name"]
if you also want it to be profile-specific you can save it in G.PROFILES[G.SETTINGS.profile]["variable name"]

wild berry
#

how to get the current tags owned

daring fern
wild berry
#

k

mystic river
#

(though you would want to have a line somewhere before that that says SMODS.current_mod.config[G.SETTINGS.profile] = SMODS.current_mod.config[G.SETTINGS.profile] or {} so you don't go around indexing nil values)

#

(probably in the first few lines of your main file)

#

?

#

well, i didn't say "only do this before saving profiles"

#

G.SETTINGS.profile is a variable containing your profile number

#

it's always accessible

#

well yes
you can add things to it

#

the game doesn't save it once and then throw it away forever

wild berry
#

is it possible to prevent a joker from repetition from context.repetition_check

wild berry
#

wait

#

i meant retrigger joker check

lofty elm
#

Hey guys, I'm having an issue where changing my seed for pseudorandom_element doesn't seem to change the result. Any ideas? I loop a number of times and do a pseudorandom_element with the loop index stapled to the end of the seed so that it would theoreitcally change the result every time, though idk if thats the best way at all

#

this might be super niche or just a thing ppl know abt pseudorandom_element, no worries if it's weird and you don't wanna troubleshoot for me lol

lofty elm
#

this'll return a number right? I spose I could do that

mystic river
#

that will return a boolean

wild berry
#

it returns a boolean

#

true if it passed the probability check

#

false otherwise

lofty elm
#

oh, no I need to be able to pick from a *table

#

anyone know what to do for that?

wild berry
#

table[psuedorandom("insertseedhere", 1, #table)]

lofty elm
#

got it, ill try that

frosty rampart
#

there's actually a pseudorandom_element function

lofty elm
rocky plaza
#

hey
leaving this here if anyone has answers
does anybody here know a formula for converting a Joker's position in T into love2D coords?

frosty rampart
lofty elm
#

oh wait

#

nvm gimme a second

lofty elm
frosty rampart
#

show your full code

lofty elm
#

I can give you all of it if you want theres just a bunch that I don't think is relevant

for i=1, (num_planets_destroyed) do
    planet = pseudorandom_element(most_played_planets,  pseudoseed('collapse!'))
    G.E_MANAGER:add_event(Event({
        func = function()
            SMODS.add_card{key = planet, edition = 'e_negative'}
            card:juice_up(0.5, 0.5)
            return true
        end
    }))
end

most_played_planets is a table of keys of planets that correspond to your most played hand. So like if theres a tie there's multiple. I've been testing this with them all at 0 so all the hands should be in there

frosty rampart
#

the events don't trigger until after the for loop is done

#

move the pseudorandom call inside the event

lofty elm
#

oh god im so dumb

#

sorry for wasting your time ty

frosty rampart
#

no worries, that's why we're here

magic crane
#

i cant find a functions to create my own buttons im currently trying to add some stuff to the main menu and i cant find any functions for making buttons by default

ocean sinew
#

UIBox_button

magic crane
#

thanks

ocean sinew
#

maybe It's what u looking for

#

np

hidden notch
#

it doesn't seem like context.hand_drawn activates if no cards are drawn
So, I stumbled upon the same Problem - In my case it's for a Blind:
It works similar to Crimson Heart -> Debuff "Something" after a Hand is drawn.
I was thinking this was a Vanilla Bug, but Crimson Heart works perfectly fine!
Then I tested the Vanilla Remade Crimson Heart, and that doesn't work either (when you don't draw any cards)!
Now, it's not the worst thing for my current Blind to have this issue, but I wanted to ask:
Is this intended or should I put in a Bug report (for SMODS)?
-# The very rare direct Ping: @wintry solar

timid zinc
#

Is there a way to make generating a negative card skip the little animation and noise it makes?

daring fern
timid zinc
#

the 3rd input?

#

I'm using SMODS.add_card

daring fern
lavish elm
#

hey what location should sounds be is it assets->sounds or something else and what file type should it be

lavish elm
#

oh ok thx

wintry solar
lavish elm
daring fern
hidden notch
# wintry solar try using `context.drawing_cards`

Yeah works but also triggers too early:
Works when trying to Debuff Jokers but when Debuffing Hand-Cards it triggers before the hand finishes drawing. Then again: I could check if the amount of cards exceeds the hand-limit and only then check for this context...
It just seems very... Convoluted?
At the end of the day it helps in my case (Thank you!) but, uh, yeah :D

I kinda liked using context.hand_drawn as "This is the Start of a new Turn" Context

lavish elm
daring fern
frosty rampart
lavish elm
#

SMODS.Sound{
key = "error",
path = "error.ogg"
}
sound = { sound = "error", per = 1.2, vol = 0.4 }
pretty sure there is nothing wrong here

wintry solar
lavish elm
hidden notch
#

It's not even about Debuffing at this point, kinda applies to all things regarding that ^^'

hidden notch
long sun
#

okay, getting back to this

#

this code is blatantly wrong, but what have i done wrong?

#

T is nil when the Sprite is being made

daring fern
long sun
#

👍

#

oh wait yeah i see what you mean

#

what do i replace the selfs with?

#

i assume i've put this code in the wrong place

daring fern
long sun
#

ah awesome ^u^ thanks

#

what would Y be if the sprite was 1 card height above where it would otherwise be?

#

would it be 95, or some magical mystery unit?

daring fern
#

Also move the SMODS.DrawStep out of the hook.

long sun
#

it seems to be running before G.phanta_extra_sprites is initialised

daring fern
long sun
#

will try

#

thanks

daring fern
wintry solar
daring fern
long sun
#

oh true :3

robust marsh
#

How is a card added to the main menu besides the existing one? I kinda forgot that's a thing that can be done and I recently got a cool idea for it

daring fern
hidden notch
hidden notch
sturdy compass
#

We love undocumented functionality 🔥

daring fern
#

long sun
#

so it's trying to index into it before it's ready

#

i'll try nil-checking it

wintry solar
turbid tiger
#

Still the same.

#

I've tried to write it a bunch of other ways but, I really don't know what i'm doing.

#

Just copying things from other jokers.

long sun
#

code atm

#

i don't know what i missed ;u;

hidden notch
#

Welp, Ignore silly me then - Sorry to have bothered ya' lewxen_cry

sturdy compass
#

I'm with flow on that lmao

#

browser cache be annoying sometimes

wintry solar
#

when on earth is your cache from, this page has always had the function on

#

nless I am misreading things

long sun
#

eremel can u help ;u; i'm trying to get a second layer on top of my cards, similar to front, but it's not working

#

i've never used DrawStep before

wintry solar
turbid tiger
#

realized i replied wrong, here.

wintry solar
#

this is how I do it

long sun
#

thanks ^U^ will take a look

#

oh ya mine needs to use sprites ;u;

#

will try your things

echo parrot
#

--in "enhancements.lua"

SMODS.Enhancement {
    key = 'bone',
    atlas = 'TBOJ_enhancements',
    pos = {x = 1, y = 0},

    config = {x_chips = 1.25, extra = { odds = 6} },
    shatters = true,
    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'tboj_bone')
        return { vars = { card.ability.x_chips, numerator, denominator } }
    end,

    loc_txt = {
        name = 'Bone Card',
        text = {
            [1] = '{X:chips,C:white}X#1#{} Chips',
            [2] = '{C:green}#2# in #3#{} chance to',
            [3] = 'destroy card',
        }
    },

    calculate = function(self, card, context)
        if context.destroy_card and context.cardarea == G.play and context.destroy_card == card and
            SMODS.pseudorandom_probability(card, 'tboj_bone', 1, card.ability.extra.odds) then
            return { remove = true }
        end
    end,
}

--in "reverse_tarots.lua"

SMODS.Consumable {
    key = 'reverse_hierophant',
    set = 'Tarot',
    atlas = 'reverse_tarots',
    unlocked = true,
    discovered = true,
    cost = 3,
    pos = {x = 4, y = 2},

    config = { max_highlighted = 1, mod_conv = 'm_tboj_bone'},
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = G.P_CENTERS[card.ability.mod_conv]
        return { vars = { card.ability.max_highlighted } }
    end,

    loc_txt = {
        name = 'The Hierophant?',
        text = {
            [1] = 'Enhances {C:attention}#1#{} selected',
            [2] = 'card into a',
            [3] = '{C:attention}Bone Card',
        }
    },

    can_use = function(self, card)
        return G.hand and #G.hand.highlighted > 0 and #G.hand.highlighted <= card.ability.max_highlighted
    end,

    use = function(self, card, area, copier)
        for i = 1, #G.hand.highlighted do
            G.hand.highlighted[i]:set_ability(card.ability.mod_conv)
        end
        return true
    end
}```

Hey all! I'm new to Balatro modding, so I apologize in advance if this is a really obvious mistake, but I'm not able to get my modded enhancement working. Whenever I try to use the reverse hierophant, I get an error that it "Could not find center 'm_tboj_bone'"
frosty rampart
#

is your mod's prefix exactly "tboj" (including capitalization)?

echo parrot
#

I'll double check, but I believe it is

#

yes it is

sturdy compass
#

Does the enhancement exist?

echo parrot
#

wym?

frosty rampart
sturdy compass
#

It's been a day for me Pensive_Cowboy

#

Is your enhancements.lua file being loaded properly?

echo parrot
#

would it appear with the enhancements in the collection? or does smods not have that functionality yet

sturdy compass
#

It should yes

daring fern
echo parrot
#

it's not in there

sturdy compass
#

Then your enhancements.lua is probably not loading properly

echo parrot
#

Thank you! I figured it out, there was a typo in main

sturdy compass
#

u got it

long sun
#

pulling my hair out why won't this workkkkk

vale grove
#

i wanna add to this that the hand has to contain two heart suits, how do i do that?

cursive gazelle
wispy falcon
#

What is context.other_card.sprint?

daring fern
long sun
wispy falcon
frosty rampart
#

yea it's probably something that a mod added

wispy falcon
#

Would you guys understand this code?

    key = "foxy",
    atlas = "fnaf1",
    pos = {x = 5, y = 1},
    rarity = 1,
    cost = 4,
    unlocked = true,
    discovered = false,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true,
    config = {extra = {chips = 0}},
    loc_vars = function(self, info_queue, center)
        return {vars = {card.ability.extra.chips}}
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if not context.other_card.sprint then
                context.other_card.sprint = true
                local c = context.other_card
                G.E_MANAGER:add_event(Event({
                    func = function()
                        if c then
                            c.sprint = nil
                        end
                        return true
                    end,
                }))
            else
                if context.individual and context.cardarea == G.play and not context.other_card.debuff then
                    carde = context.individual
                    card.ability.extra.chips = card.ability.extra.chips + carde.base.nominal
                else
                    return 0
                end
            end
        end
    end,
})```
daring fern
wispy falcon
wispy falcon
#

What does context.other_card.base.nominal do?

gusty iron
#

would there be a way to add a 4th blind to the ante via patching?

frosty rampart
thorny ether
#

Weird question but is there a way to make the collection menu of Spectral cards to show 11 cards like Tarot? I made 4 more custom Spectral cards and I dislike how they spill to a new page

#

I changed create_UIBox_your_collection_spectrals to match the tarot one in UI_definitions.lua but it still displays 9 spectrals per page in game

rotund sable
#

😢

thorny ether
#

Oh dear, let me check

rotund sable
#

You'd have to make a patch

#

That won't work...

thorny ether
#

I'll make the patch then, was throwing edited file directly to the exe

frosty rampart
#

lovely/dump is where lovely dumps all the vanilla files after they get patched

thorny ether
#

Ooops

rotund sable
twilit wing
#

something kewl

true jasper
# twilit wing

this is peak, you should have the mult decrease after the joker is scored tho

weary grail
#

giraffe joker

twilit wing
#

why does its neck do that

weary grail
#

upgraded design

twilit wing
#

is this the wrong context?

true jasper
true jasper
obtuse wraith
twilit wing
twilit wing
#

Alright

#

Wacky

twilit wing
idle plaza
twilit wing
#

how do i do it then

#

,_,

idle plaza
#

Looks like you already do to me. Final Scoring Step occurs after Joker Main.

twilit wing
#

nothing in the if statement triggers, like the message n stuff

true jasper
frosty rampart
twilit wing
#

lemme try

idle plaza
winter flower
#

how do i make it so that if i play a hand with a joker from my mod, this happens

frosty rampart
#

G.jokers.cards is a table of all the jokers the player currently has
iterate over that and check if [joker].config.center.original_mod == SMODS.Mods["mod id goes here"] for any of the jokers

rigid solar
#

Does anyone know a mod that changes the background color on the main menu? I'd like to do that but have no idea how and so I'd like to check how it's done

red flower
#

mine

twilit wing
#

i fixed it!!

rigid solar
#

oh neat

red flower
#

hi dilyy

#

dilllyy

frosty rampart
winter flower
#

im trying to do

modern kindle
red flower
#

how are u doing

modern kindle
#

i am doing

#

still have not resumed working

winter flower
#

i dont know if im doing this completely wrong

willow scroll
#

what would be the best way to change the texture of a joker using based on a run variable using draw?

#

can i just change the card.config.center.pos?

winter flower
#

like just changing it’s sprite?

willow scroll
winter flower
# willow scroll yeah

you can use update=function(self,card,dt), then do “if (var) then card.children.center:set_sprite_pos { x = newx, y = newy }”

#

for soul_pos you can use children.floating_sprite

willow scroll
#

aha i see

winter flower
#

that’s how i did it, and it works pretty well

willow scroll
#

ill just use draw though i think as its for that

frosty rampart
#

no, overwriting the draw function means it stops doing the regular draw function stuff

#

i.e. things will probably go bad

willow scroll
frosty rampart
#

no, the editions handle their own drawing. but every joker comes with a default draw function that draws its sprite, and defining your own draw function won't do that automatically anymore

willow scroll
#

well, i have this in the smods joker

#

and quick testing shows it works fine

#

so far

winter flower
gusty iron
#

so im trying to make it so that the small and big blinds are bosses, but they seem to be the same two bosses every ante. any help?

[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "self.GAME.round_resets.blind_choices.Boss = get_new_boss()"
position = "before"
payload = '''
if G.GAME.modifiers.JCJ_bossrush then
    self.GAME.round_resets.blind_choices.Small = get_new_boss()
    self.GAME.round_resets.blind_choices.Big = get_new_boss()
end
'''
match_indent = true
rigid solar
paper lava
#

is there a SMODS.Enhancements, simillar to SMODS.Ranks and SMODS.Suits?

paper lava
#

basically, im trying to get the number of distinct enhancement types in your deck

frosty rampart
rigid solar
frosty rampart
rigid solar
#

And you use it on all cards in deck to retrieve their enhancement and then you can check all unique enhancement

faint yacht
#
SMODS.get_enhancements(card, extra_only)
#
function SMODS.get_enhancements(card, extra_only)
    if not SMODS.optional_features.quantum_enhancements or not G.hand then
        return not extra_only and card.ability.set == 'Enhanced' and { [card.config.center.key] = true } or {}
    end
    if not SMODS.enh_cache:read(card, extra_only) then

        local enhancements = {}
        if card.config.center.key ~= "c_base" then
            enhancements[card.config.center.key] = true
        end
        local calc_return = {}
        SMODS.calculate_context({other_card = card, check_enhancement = true, no_blueprint = true}, calc_return)
        for _, eval in pairs(calc_return) do
            for key, eval2 in pairs(eval) do
                if type(eval2) == 'table' then
                    for key2, _ in pairs(eval2) do
                        if G.P_CENTERS[key2] then enhancements[key2] = true end
                    end
                else
                    if G.P_CENTERS[key] then enhancements[key] = true end
                end
            end
        end
        SMODS.enh_cache:write(card, enhancements)
    end
    return SMODS.enh_cache:read(card, extra_only)
end
frosty rampart
#

also yea, it would be a lot more efficient to just loop over playing cards and get their enhancements instead of looping over playing cards once per every enhancement in the game

rigid solar
#

^

paper lava
#

i see

#

good idea

faint yacht
#

...I also have a Joker that does check for unique enhancements too.

iron haven
#

I wanted to make letter tarots then I changed my mind

paper lava
#

oh hi F

iron haven
#

hi

stiff locust
#

hey chaaat

#

I'm trying to inject cards into a pool again and it's not working and I don't know why

#

i feel like it's the fault of :inject()

#

but idk how to use that function properly

#

i am trying 1 other thing and if that doesnt magically fix it then im stumped

#

nevermind it didn't work

#
function Fusionpack()
    SMODS.ObjectType({
        key = "mjp_fused_pack",
        default = "j_fuse_dynamic_duo",
        cards = {
            ["j_fuse_dynamic_duo"] = true
        }
    })
    for _, v in ipairs(FusionJokers.fusions) do
        ---Dynamic Duo is the default Joker for this pool and does not need to be injected into it again
        if G.P_CENTERS[v.result_joker].rarity == "fusion" and v.result_joker ~= "j_fuse_dynamic_duo" then
            SMODS.ObjectTypes["mjp_fused_pack"]:inject()
            SMODS.ObjectTypes["mjp_fused_pack"]:inject_card(G.P_CENTERS[v.result_joker])
        end
    end
end

this code should be putting every fused joker into the pool but it's not putting any jokers into the pool, and packs using it only create dynamic duo

#

so I am very confused

ocean sinew
ocean sinew
stiff locust
#

the rarity key is "fusion"

#

why does it need a mod prefix now

ocean sinew
#

cuz every rarity needs mod prefix

stiff locust
#

it never needed that before

ocean sinew
#

cry_epic

#

cry_exotic

stiff locust
#

I guess that does explain why the code was working, until it stopped working randomly 🤔

ocean sinew
#

probably

stiff locust
#

smods must've updated it to need one

loud summit
#

oof

stiff locust
#

well that doesn't explain why the other one isn't working

#

i've got one here which is supposed to do it with fusion materials

function Materialpack()
    for _, v in ipairs(FusionJokers.fusions) do
        for _, vv in ipairs(v) do
            local tempkey = vv.Jokers[1].name
            local tempkey2 = vv.Jokers[2].name
            ---Splash is the default Joker for this pool and does not need to be injected into it again
            SMODS.ObjectTypes["mjp_material_pack_pool"]:inject()
            if G.P_CENTERS[tempkey].rarity ~= 4 and G.P_CENTERS[tempkey].rarity ~= "fusion" and tempkey ~= "j_splash" then
                SMODS.ObjectTypes["mjp_material_pack_pool"]:inject_card(G.P_CENTERS[tempkey])
            end
            SMODS.ObjectTypes["mjp_material_pack_pool"]:inject()
            if G.P_CENTERS[tempkey2].rarity ~= 4 and G.P_CENTERS[tempkey2].rarity ~= "fusion" and tempkey2 ~= "j_splash" then
                SMODS.ObjectTypes["mjp_material_pack_pool"]:inject_card(G.P_CENTERS[tempkey2])
            end
        end
    end
end

it has the same problem although all of its if checks are not equals

stiff locust
#

i fixed it

#

and i don't know how

#

so i'm gonna not touch it

#

and it's gonna keep working

jolly shadow
#

Is it possible to blueprint the effect of a joker that the player doesnt have?

stiff locust
#

ive been waiting so long for this idea to be the only good solution

#

what if you created an invisible joker outside G.jokers and just put it offscreen somewhere

#

and it runs the effect

red flower
#

look at ortalab pinkprint

fallow breach
#

does anyone know what color is used for the negative effect

#

on text specifically

red flower
#

dark_edition

fallow breach
#

thank you

clear ocean
#

wait i see why

#

i forgot to delete that when copying tooth

unkempt thicket
#

I'm attempting to get a variable i set on the creation of playing cards in function Card:set_sprites(_center, _front) or more specifically get_front_spriteinfo(_front) i got a way to pass self(the card) in set_sprites to get_front_spriteinfo though it seems to work different when running, the code is getting the correct atlas and pos that i would like when reviewing it through debug plus though it does not seem to be properly applying them.

clear ocean
daring fern
#

fallow breach
#

does G.GAME.edition_rate also affect negative spawn rates?

daring fern
#

It affects all editions.

fallow breach
#

is there a way to target a specific edition when modifying the rate

fallow breach
daring fern
fallow breach
#

what does take_ownership do?

daring fern
fallow breach
#

so then what do i call in the code for the card i want the modification effect to be for?

fallow breach
#

well yeah. but i want a modification to the rates once a voucher is redeemed

#

how do you go about htat

daring fern
lucid owl
#

is it easy to retrigger specific effects? would retriggering only effects from seals be difficult?

daring fern
#

And add {message = localize('k_again_ex'), message_card = card} in the middle.

lucid owl
lucid owl
# daring fern Yes.

here's the eval_card snippet i patched, seemingly disables red seals and doesn't do anything to others

daring fern
lucid owl
#

i had it like that before but had swapped to see if that would fix anything lol, my bad

#

ohhh wait i see what you mean

daring fern
#

Also it would be SMODS.merge_effects({seals, seal2})

lucid owl
#

like this?

#

original code is just with the if seals and ... part removed

daring fern
lucid owl
#

ah i see

lucid owl
daring fern
lucid owl
daring fern
hidden mirage
#

is it possible to use calculate on seals (or otherwise) on cards still in the deck?

lucid owl
daring fern
lucid owl
#

hmm, guess i'll have to target seals individually

hidden mirage
lucid owl
#

i guess i could.. retrigger all cards with seals but that comes with the fact that full retriggers are definitely not intended

daring fern
daring fern
#

Also are you patching both times when card:calculate_seal is called in eval_card?

hidden mirage
hidden mirage
hidden mirage
daring fern
lucid owl
hidden mirage
#

cards that arent "in deck" or in hand

daring fern
hidden mirage
#

Yeah kinda but also after played

daring fern
hidden mirage
#

Ok thanks

ashen drift
#

how can i make color in a ui change dynamically without having to reload it

daring fern
hidden mirage
#

how to set main badge text of a seal

ashen drift
#

something akin to ref_table and ref_value in here, except for colours

lucid owl
daring fern
lucid owl
#

yeah, i'm only getting one trigger on purple

daring fern
lucid owl
daring fern
# lucid owl

Are both locations successfully getting patched?

lucid owl
#

..huh. it was the if seals and part somehow??

#

works great now...

daring fern
lucid owl
daring fern
lucid owl
#

also, where would i put that {message = localize('k_again_ex'), message_card = card} at?

lucid owl
daring fern
lucid owl
#

ah, didn't realize it took arguments like that

hidden mirage
#

why does if context.end_of_round and context.main_eval and context.game_over == false then not work, when context.end_of_round does (just with the multiple triggers)

daring fern
hidden mirage
daring fern
hidden mirage
true jasper
daring fern
hidden mirage
naive musk
#

wait how do i make a custom suit

robust marsh
naive musk
robust marsh
robust marsh
#

yuup ofc

prisma loom
#

How much sell value Negative gives to a consumable card?

true jasper
robust marsh
#

It increases the cost of any card by 5 so the sell value increase is 2 but I could be wrong clueless

prisma loom
#

Wierd but thanks!

gilded blaze
#

I'm gonna assume this is how take_ownership respects other mod's take_ownership

pastel kernel
#

destroying asriel dreemurr creates a negative eternal astro joker, how do i do that?

daring fern
pastel kernel
daring fern
pastel kernel
#

(no eternal sticker)

daring fern
pastel kernel
daring fern
lavish elm
#

G.jokers.cards[i].edition == "e_foil" is this correct?

daring fern
lavish elm
#

ok so vscode is telling me there .holo and .holographic which one is the right one?

lavish elm
#

ok thx alot

pseudo furnace
#

Does creating a custom sticker require a hook on the function when the joker is created?

robust marsh
#

How exactly would I go about reducing mult/chips/dollars given by all jokers?

daring fern
robust marsh
lavish elm
#

ease_dollars(card.ability.extra.dollars, true)
return{
message = '+' .. card.ability.extra.dollars .. "$",
colour = G.C.money
}
ok so this does not make money sound when retriggered, why?

daring fern
lavish elm
#

I tried this but for some reason it triggered twice

daring fern
robust marsh
#

because you're also using ease_dollars alongside it

lavish elm
#

yeah no it triggers twice

#

no ease_dollars with it

#
if context.setting_blind and G.GAME.blind.boss then
            return{
                dollars = card.ability.extra.dollars,
                message = '+' .. card.ability.extra.dollars .. "$",
                colour = G.C.money
            }
        end
        if context.end_of_round and context.game_over == false and G.GAME.blind.boss then
            return{
                dollars = card.ability.extra.dollars,
                message = '+' .. card.ability.extra.dollars .. "$",
                colour = G.C.money
            }
        end
daring fern
#

No message and no colour

lavish elm
#

oh ok thx

#

how to make the joker give multiple messages with different colors?

#
message = '+' .. card.ability.extra.chips .. " Chips",
message = "+" .. card.ability.extra.mult .. " Mult",
daring fern
lavish elm
#

then what is the difference between mult_mod and mult etc

manic rune
lavish elm
#

so does their non mod counterparts

manic rune
lavish elm
#

oh wait my my iletrate brain didn't notice the don't in the first message my bad

robust marsh
daring fern
robust marsh
daring fern
wispy falcon
#

How do I check if a set is fully unlocked?

daring fern
wispy falcon
daring fern
wispy falcon
daring fern
vale grove
#

i have this currently and the joker functionally works great but i just have one issue,
the value up visual effect happens on the card instead of the joker

#

does anyone know why this is happening?

vale grove
#

when i run this i get that error

#

does anyone know why

daring fern
vale grove
#

whats a table in this context?

loud summit
#

{ key1 = "value1", key2 = "value2" }

vale grove
#

oh like that

#

where would i apply that here?

#

what i want it to do is a have a 50% chance to summon itself back into your deck

loud summit
#

SMODS.add_card { }

#

its syntax sugar for calling a function with a table

loud summit
#

so things like oops all 6 can modify it

vale grove
#

uh-huh

#

i was thinking of asking how to make it unaffected

#

bcs it could create an infinte money glitch

#

but then i realized i can just set its sell value to zero

loud summit
#

lol

vale grove
#

wait so are they key's the outcome or the jokers?

loud summit
#

keys?

vale grove
#

bcs if so wouldnt i just need key1 ="goochelaar"

vale grove
#

i give my goochelaar the key "goochelaar" to later identify it as such

loud summit
#

the keys are kinda parameters to the add card call

daring fern
loud summit
#

look at the smods docs

loud summit
red flower
vale grove
#

im hearing so many things at once

loud summit
red flower
loud summit
#

and also using a loc_var for the numerator and denominator

vale grove
#

so what am i supposed to do to fix this...

red flower
#

you need to fix the create card bit like candycane said

vale grove
#

so use a table?

red flower
#

yes

vale grove
#

bcs im still kinda confused about what keys are

#

i thought they were just labels

#

so you can call it later

loud summit
#

tables are usually reffered to as key/value pairs

vale grove
#

idk if anyone here is familiar with java but is a table just a form of collection

#

like an array

#

or array list

red flower
#

it's more like a map or dictionary

vale grove
#

hmm

red flower
#

that can also act as an array

vale grove
#

it just seems so counterintuitive to create something like that for one value

#

and im not insulting you or candycane you guys are probably correct

#

it just seems so weird in my mind

red flower
#

it's so it's easier to get all the arguments

loud summit
red flower
#

if not then this would lead to SMODS.create_card("Joker", nil, nil, nil, nil, nil, "e_negative", nil, ...)

robust marsh
#

Alright so I finally have a somewhat functioning mechanic which makes it so jokers are half as effective (mult, chips, etc. are reduced by 50%). How would I make their localization reflects this

vale grove
#

idk why my college says you dont need programming experience yet also expects you to get a fairy decent mastery over it and more in a year

loud summit
#

fun

vale grove
#

what is fun tho is balala modding

#

having a blast just coding random things

loud summit
#

yeahh

loud summit
# red flower

all this because lua doesnt support named arguments lmao

robust marsh
#

alright, i can think of something else

vale grove
loud summit
#

what line is the error on

vale grove
#

this lol

loud summit
loud summit
vale grove
#

or something similar

#

it was just a minor issue in the code that time

vale grove
loud summit
#

no

#

add_cardi think requires "set" to be defined

#

so set set to "Joker"

vale grove
#

so it needs a type?

loud summit
#

you give a set argument to add_card

vale grove
#

adding just set = "joker", still gives the same error

daring fern
vale grove
daring fern
vale grove
loud summit
vale grove
#

i completely forgot my prefix

loud summit
#

sorry

vale grove
#

nah dw abt it

#

you helped plenty

#

one more quick question then ill fuck off (for now)

#

how do you set sell value

#

bcs i need this guy to be worth 0 to prevent infinite money lol

loud summit
#

hang on ill check necromancer

daring fern
loud summit
#

ok so use a local var to save the add_card return var

loud summit
#

i think

vale grove
#

i mean

#

both work tbh

#

im not picky XD

loud summit
#

hooking it would set the sell value on the joker itself, not the one it created

vale grove
#

i must admit i dont know how hooks work tho

vale grove
loud summit
#

???? whicj do you want to have 0 sell value

#

the joker itself

#

or the joker it creates

vale grove
#

ig the one it creates

#

maybe ill change it later for balancing

#

but i do like ur idea more for now

loud summit
#

and do var.sell_cost = 0

vale grove
#

do i create a return on my if that has the variable?

loud summit
#

local card = SMODS.add_card...
card.sell_cost = 0

vale grove
#

ohhhh

#

thats interesting

loud summit
# red flower

yea u can see add_card returns the card it created (because the definition ends with -> Card) and cards are also just tables

vale grove
#

i know i probably seem stupid its just so different from what im used to with java

loud summit
#

fair, lua is a lot more fast and loose lol

long sun
#

getting back to Doug Dimmadome again

vale grove
long sun
#

i've reverted it to what it was before, but commented out the new code

vale grove
#

bcs my mind insctively went to the if statement

#

bcs thats where you define the SMODS.add_card

#

but that gives an error

loud summit
#

yeah right below

#

what error

vale grove
vale grove
loud summit
#

waitwait

#

did you delete what you originally had with SMODS.add_card

vale grove
#

i did what mr seals on everything said

#

which was add the J_prefix_ before my joker

#

okay why does it dothat

loud summit
#

send your current code

vale grove
#

J _ prefix _

#

MF

vale grove
#

the error is on line 392 now

#

bcs i did smth unrelated to this issue

loud summit
daring fern
vale grove
#

capital C?

loud summit
#

do local card = SMODS.add_card { key = "j_YA_Goochlear" }

daring fern
vale grove
#

oh like that

vale grove
loud summit
daring fern
loud summit
#

@vale grove does it matter if the jokers sell value can be increased after being created

vale grove
#

quite alot

#

bcs this guy is basically lucky cat

#

but for sell value

loud summit
#

oh

vale grove
#

and bcs he is a goochelaar (magician in dutch) i just thought it'd be cool to make him do a magic trick to make him reappear lol

#

and him not getting the abillity to increase his own sell value (after reappearing) makes it kinda pointless

frosty dock
vale grove
daring fern
long sun
#

okay i'm very lost with the DrawStep shenanigans i'm attempting

#

i'd like to add a DrawStep to render a sprite over center

#

the sprite will be referenced by the card via pos_extra and atlas_extra

vale grove
#

wait now i keep getting an error when i just rolled back to a previos version that worked

#

tf

long sun
#

i'm not sure what the best thing to do is

#

i've checked Ortalab's curse code but i don't quite get it

frosty dock
# vale grove can you define that in an if statement?
if context.selling_self and SMODS.pseudorandom_probability(...) then
  local new_card = copy_card(card)
  new_card:add_to_deck()
  G.jokers:emplace(new_card)
  new_card.ability.extra_value = new_card.ability.extra_value - new_card.sell_cost
  new_card:set_cost()
end

I'm thinking something like this. Copy the card being sold instead of making a new one so that it keeps any modifications, and the rest is as I said

vale grove
#

i had a previous working version except for sell value

#

and now it just goes back to an old error despite to my knowledge not touching any of it

frosty dock
# vale grove

I'll also note that SMODS.add_card returns the card being added, so if you want to do anything to the card afterwards, you should save the result of that function call and not the function itself

long sun
#

so, the Ortalab code creates the relevant sprites when it's injected

#

okay i'm very lost again ;u;

frosty dock
#

this just sets the sell value to 0, so no

vale grove
#

like i had this version

#

that worked except for

#

j_ya

#

on my line of code

frosty dock
#

yeah exactly

#

extra_value is reduced by the current sell cost of the copy

#

effectively setting the sell cost of the copy to 0

vale grove
#

like am i not seeing something?

#

isnt this the except same version

#

besides

#

the prefix on SMODS.add_card

frosty dock
#

did you try what i sent?

vale grove
#

i mean i could

frosty dock
#

i mean i suggested you copy the card in a different way..?

vale grove
#

oh i didnt really look at it yet

#

i was too busy trying to figure this out

#

ill see if that works

#

im still so confused

#

bcs i was asking abt sell value bcs the copying worked

#

but now it doesnt anymore

#

oh yeah that works

long sun
#

so i was gonna put all of the extra sprites into a list, but i can't do that if i want them to be animatable

vale grove
#

thank you mr smods

frosty dock
long sun
#

(wait no maybe i can)

#

(trying something)

vale grove
#

lol

frosty dock
#

oh well lol

vale grove
#

but

frosty dock
#

maybe you didn't save

vale grove
#

this works

vale grove
#

but

#

it doesnt matter anymore

#

bcs this now works

#

thank you

#

im also kinda proud of the concept

#

i think a lucky cat for sell value is very fun

frosty dock
#

yeah it's a fun idea

#

maybe you should add a message when it reappears though

vale grove
#

ohhh

#

that is a very fun idea

#

and a sound

#

yeah youve committed me to this

#

im looking up a magic smoke sound

frosty dock
#

-# and make the reappearing part also incompatible with blueprint unless you want it able to give duplicates?

long sun
vale grove
frosty dock
vale grove
#

yeah just checked it doesnt dupe the ability

#

OH LIKE THAT

#

LOL

#

well thats fixed

#

i hope

long sun
#

okay self.sprite seems to be nil

#

i don't get it

vale grove
long sun
vale grove
#

it still gets destroyed by cards like ceremoinal dagger and madness

#

now i did some digging and changed the context to "getting sliced"

#

but that still makes it get destroyed

frosty dock
vale grove
#

currently using this still makes it get destroyed

#

with a oops all sixes

red flower
#

what's the goal here again?

vale grove
#

this works just fine

frosty dock
#

whoops, i gtg

red flower
vale grove
#

ill see how that goes

#

i kinda forgot that was a command i could do lowk

vale grove
#

i think the issue lies in that its trying to copy the card that no longer exists

red flower
vale grove
#

having it in my deck get destroyed by dagger

#

with an oops all sixes

#

doesnt make it reappear

frosty dock
#

might be that getting_sliced is set at that timing? idk

#

try adding new_card.getting_sliced = nil, but I'm not positive that's it

vale grove
#

which should be 100% with oops all sixes (as it does with selling)

red flower
vale grove
#

this is what i tried last

red flower
vale grove
frosty dock
#

with joker_type_destroyed, just throw it at the end of the if block

red flower
vale grove
long sun
#

so with reference to this crash:
engine/sprite.lua:149: bad argument #3 to 'setColor' (number expected, got nil)

#

this is causing it

vale grove
#

no that doesnt make sense

long sun
#

but self.children.phanta_extra.sprite is not nil

#

so how could it be crashing??

#

wha

daring fern
long sun
#

oh, oh i see

#

lemme remove that then

#

is that better?

#

or do i need to remove more

red flower
# vale grove so throw this up there with my loc_vars
remove_from_deck = function(self, card, from_debuff)
    if not from_debuff and SMODS.pseudorandom_probability(...) then
        local new_card = copy_card(card)
        new_card:add_to_deck()
        G.jokers:emplace(new_card)
        new_card.ability.extra_value = new_card.ability.extra_value - new_card.sell_cost
        new_card:set_cost()
    end
end

you should also remove the selling self stuff for this

vale grove
red flower
#

yes this works for all forms of removal

long sun
#

okay this can't be right 😭 (cards removed so i could see behind them)

#

i don't know why The Riddler's specifically is rendered twice and also massive

vale grove
long sun
#

render the extras on top of the centers normally :3

#

they were fronts before this

static valley
#

quick question. is there a way to keep track of which jokers you've sold or destroyed during a run?

daring fern
long sun
#

ortalab did the same

daring fern
# long sun

No, the shadow_height is nil instead of 0 on the second one.

long sun
#

oh ;u;

daring fern
#

Also you should be drawing it on card.children.center

long sun
#

i missed that, i didn't copy and paste it

#

ohhhh true

#

omg i'm so close pleading

#

i just need to fix the thing with the Jokers on the Doug Dimmadome page and i'm done

vale grove
#

im trying to make a silly sound effect play when it happens

#

is this not how to do it?

#

or does it require a message

frosty rampart
#

indent your code

vale grove
long sun
#

here's my code now

daring fern
frosty rampart
daring fern
#

Also remove_from_deck doesn't take returns.

frosty rampart
vale grove
vale grove
daring fern
vale grove
red flower
#

SMODS.calulate_effect({message = "message"}, card)

frosty rampart
#

and if you're doing that then you can put a sound in that table in the calculate_effect call

long sun
#

is this just a rendering issue balatro has ;u;

vale grove
daring fern
frosty rampart
long sun
#

hold on lemme grab a screenshot

long sun
vale grove
#

but when i add a colour

#

it breaks

red flower
#

does G.C.WHITE exist

vale grove
frosty rampart
#

it should

vale grove
#

this tells me it does

robust marsh
#
    calculate = function(self, back, context)
        if context.post_trigger then
            if context.other_ret and context.other_ret.jokers then
                for k, v in pairs(context.other_ret.jokers) do
                    if type(v) == "number" then
                        context.other_ret.jokers[k] = reduce(v, k)
                    elseif type(v) == "string" then
                        context.other_ret.jokers[k] = reflect(v)
                    end
                end
            end
        end

How would i check for a specific edition in my deck's calculate? I've tried a few things but yeah idk atp

red flower
vale grove
#

i might be stupid

#

i was thinking abt sound

vale grove
#

i dont think the message works either lemme try

robust marsh
vale grove
daring fern
red flower
vale grove
red flower
#

then send the crash!!!

vale grove
#

mb twin

long sun
#

yeah i have no idea what's causing this ;u;

long sun
robust marsh
#

calulate

vale grove
#

alr

#

i might kms

long sun
#

do not do that

#

i hate it when people joke about that

red flower
#

dont trust anything i type because my keyboard is not working

vale grove
long sun
#

thanks :D

vale grove
#

np

#

idk what people are/aren't okay with so if you tell me ill make sure to respect ur boundaries

long sun
#

respectable! ✨

long sun
#

i reformatted things and now the extras aren't being rendered, do you see why?

#

(ignore the reference to v here, i forgot to fix that)

#

wait i'm actually such a klutz omg

#

i forgot to remove the big if statement 😭

#

okay wait the big sprite issue isn't a problem with Dimmadome

#

it happens with all of them

#

weird, removing the dissolve shader does nothing to that

#

so something else is rendering them

daring fern
long sun
#

oh wait that renders them automatically right

#

lemme try that

#

wait that fixed it :D!!!!

#

tysm omg pleading

#

one more thing, why isn't the T being applied?

#

[note dimmadome's hat is not scaled, and not repositioned over his head]

#

do i have to do something other than setting the X, Y, W and H in Sprite()?

daring fern
long sun
#

i thought i already set the first two inputs

#

0, Y

#

do you mean elsewhere?

#

OH wait i see what you mean

#

how do i set those?

floral marsh
#

what should I hook to modify the final score of each hand (without a joker/voucher/blind)

red flower
#

you can use the mod global calculate

floral marsh
#

wha

#

like a whole calculate outside of any tables

red flower
#

gimme a sec that my keyboard isnt letting me copy the link lol

daring fern
red flower
long sun
#

ah ye it seems to

#

lemme add that ^u^

daring fern
long sun
#

ya das what i meant

floral marsh
#

so I suppose SMODS.current_mod.calculate = function(self, context)

long sun
#

like so, then?

daring fern
long sun
#

ah

#

is it the sixth then? do i pass that in as a table?

#

mm, no, it seems to be a number value

#

can i scale just the Y axis?

daring fern
long sun
#

how may i do that?

daring fern
long sun
#

👍 will try

#

little tiny sprite :3

#

also my jokers with animated extras have had their animated extras stop animating for some reason

lavish elm
#

how to do ^ mult?

daring fern
lavish elm
#

ok nvm I don't wanna add more dependencies

frosty rampart
#

if you have cryptlib as a dependency (I think I remember that being something we helped you with before), I think it also implements emult in the same way

wild berry
#

how can i forcefully draw specific cards into hand regardless of hand size

frosty rampart
#

SMODS.draw_cards(x) should draw x cards to hand

daring fern
#

lavish elm
#

seals helped me implement the thing I wanted without cryptlib

lavish elm
#

how to change the weight of rarities when a joker is present?

red flower
#

change G.GAME.<rarity in lowercase>_mod

long sun
#

why is the extra so small 😭

#

i cannot figure this out

lavish elm
#
if context.card == card then
            return{
                card = card,
                G.GAME.common_mod = 0.5

            }
        end
red flower
#

dont put it in the return

#

you dont need a return at all

#

context.card == card is also probably not correct

slim ferry
#

exact same return

static valley
#
        if context.cardarea == G.play and context.individual and #context.full_hand == 1 then
            if G.GAME.current_round.hands_played == 0 or G.GAME.current_round.hands_left == 0 then
                context.other_card:set_seal("comedy_smiley_seal", true, true)
                return {
                    message = "Imbued with Chaos",
                    card = card,
                }
            end
        end

getting the error "attempt to index a nil value"

slim ferry
#

send log?

static valley
lavish elm
slim ferry
#

oh okiay

#

just steal cryptlib 🧠

slim ferry
slim ferry
#

hm

#

that doesnt even have a crash in it

#

wierd

#

though it had something about an smods patch failing, maybe somethings with your smods installation?

static valley
#

do you think i might need to reinstall Smod

slim ferry
#

is your smods nested

static valley
slim ferry
#

hm

#

i imagine its just fine then i guess?

#

idk what else the issue would be though

long sun
#

took at look at Paya's Terrible Additions' Cyan joker, but i'm getting a stranger bug now

#

the extra moves faster than the center, when being dragged

#

the scale is now fine though, so there's that

#

wait i think i see the issue? maybe?

slim ferry
#

why are you even setting Y actually

#

you dont use it at all

long sun
#

i'm setting Y because the sprite should be off the card if the Joker is Doug Dimmadome

#

however i neglected to actually assign that