#💻・modding-dev

1 messages · Page 603 of 1

slim ferry
#

you just didnt close the SMODS.Joker

viscid talon
#

LOL

#

oke

native bone
#

This code is supposed to trigger when 5 seals are scored in the same hand. But it does not trigger at all. And I do not understand why, I've been tinkering with the code and yet it doesnt work.

viscid talon
#

oh i got another error

slim ferry
#

code?

viscid talon
#

this is the code for "night vision" (reworked)

    key = "nightvision",
    config = {
        extra = {
            amogus = 0,
            index = 0
        }
    },}
    loc_txt = {
        ['name'] = 'Night Vision',
        ['text'] = {
            [1] = 'Copies ability of',
            [2] = 'a random {C:attention}Joker{}',
            [3] = 'every round',
            [4] = '{C:inactive}(Currently #1#){}'
        },
        ['unlock'] = {
            [1] = ''
        }
    },
    pos = {
        x = 0,
        y = 0
    },
    display_size = {
        w = 71 * 1, 
        h = 95 * 1
    },
    cost = 4,
    rarity = 3,
    blueprint_compat = false,
    eternal_compat = true,
    perishable_compat = true,
    unlocked = true,
    discovered = true,
    atlas = 'Joker',

    loc_vars = function(self, info_queue, card)
        
        return {vars = {card.ability.extra.amogus}}
    end,

calculate = function(self, card, context)
    if (context.selling_card and context.card.sort_id == card.ability.extra.target or context.setting_blind) and not context.blueprint then
        local compatible = {}
        for _, c in ipairs(G.jokers.cards) do
            if c.config.center.blueprint_compat then
                compatible[#compatible+1] = c
            end
        end
        local new_target = pseudorandom_element(compatible, "seed")
        if new_target then card.ability.extra.target = c.sort_id end
    end
    for _, c in ipairs(G.jokers.cards) do
        if c.sort_id == card.ability.extra.target then
            return SMODS.blueprint_effect(c, context)
        end
    end
end
slim ferry
#

probably this

#

that doesnt look right at least

viscid talon
#

oh hm

#

should it be smth like

}```
slim ferry
#

no that bracket just shouldnt be there

viscid talon
#

oh odd

elder rune
slim ferry
#

also SMODS.Joker is still not being closed

#

unless that just wasnt in the copy paste

viscid talon
#

it goes green whenever i close it

slim ferry
#

wdym green

viscid talon
#

guessing its because --Night Vision is a text thing?

#

wait no it would be orange

slim ferry
#

its a comment

viscid talon
#

i must be getting mixed up with javascript i think

slim ferry
#

but also

#

youre supposed to close the joker like. after all of the joker stuff

#

put the closing bracket after the end of calculate

viscid talon
#

done!!!!!

#

thank youuu

#

lets test

#

did it after alias joker

#

NOOO ITS STILL BROKEN

slim ferry
#

what happens now

viscid talon
#

idk, but i think i know how to fix it

#

ok the code rn is ```SMODS.Joker{ --Night Vision
key = "nightvision",
config = {
extra = {
}
},
loc_txt = {
['name'] = 'Night Vision',
['text'] = {
[1] = 'Copies ability of',
[2] = 'a random {C:attention}Joker{}',
[3] = 'every round',
[4] = '{C:inactive}(Currently #1#){}'
},
['unlock'] = {
[1] = ''
}
},
pos = {
x = 0,
y = 0
},
display_size = {
w = 71 * 1,
h = 95 * 1
},
cost = 4,
rarity = 3,
blueprint_compat = false,
eternal_compat = true,
perishable_compat = true,
unlocked = true,
discovered = true,
atlas = 'Joker',

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

calculate = function(self, card, context)
if (context.selling_card and context.card.sort_id == card.ability.extra.target or context.setting_blind) and not context.blueprint then
    local compatible = {}
    for _, c in ipairs(G.jokers.cards) do
        if c.config.center.blueprint_compat then
            compatible[#compatible+1] = c
        end
    end
    local new_target = pseudorandom_element(compatible, "seed")
    if new_target then card.ability.extra.target = c.sort_id end
end
for _, c in ipairs(G.jokers.cards) do
    if c.sort_id == card.ability.extra.target then
        return SMODS.blueprint_effect(c, context)
    end
end

end
}```

slim ferry
#

missing , after the loc_vars

viscid talon
#

oh oke

slim ferry
#

oh

#

well u thunk

viscid talon
#

hmm

slim ferry
#

i think

#

since that crash is not on the same line idk

viscid talon
#

me thunk>??????

#

unexpected = on line 36

#

oh it opens now

#

i just got rid of loc vars

#

time for more testing

slim ferry
#

you probably will need loc_vars if you want the joker to be displayed in the description

#

eventually

viscid talon
#

yeah ur right

#

i dont want it displayed, that was just for testing

slim ferry
#

anyway im doing a wild guess that the loc_vars is line 36 and you did not put the comma after the end of loc vars

viscid talon
#

attempted to index field "atlas" (a null value)

#

oh i did that and it had the same error

slim ferry
#

idk how that happens but uhhhhh

viscid talon
#

maybe the atlas should be customjokers

#

thats the case for dawn, dakimakura, etc

slim ferry
#

look for an SMODS.Atlas

#

or all of them idk where jf puts them

viscid talon
#

i launched it and for some reason "Night Vision" had the same art as another joker

slim ferry
#

okay then open the image file and correct the pos in the joker

#

the top-left sprite being { x= 0, y = 0 }

split acorn
#

Hello everyone

#

Is anyone able to explain why

#

When I enable or disable pixel art smoothing, the changes caused by this code are reverted?

#

I'm trying to change the color of the cards from white to black

slim ferry
#

do you have both a 1x and 2x image

#

in the assets

elder rune
split acorn
slim ferry
#

odd

split acorn
#

if im inside a game with 1x texture and click on "pixel art smoothing" the texture goes white

#

but if i leave run and go to the main menu, i'll se the 2x texture being applied

#

does my explanation make sense?

slim ferry
#

thats really wierd

#

idk what could cause that tbh

split acorn
#

it is! thanks anyways

viscid talon
#

new error

#

attempt to globalise c, im guessing c is meant to be local

#

do i wrote "local c"

#

for local c in ipairs?

slim ferry
#

no

viscid talon
#

oh hm

#

line 47: if new_target then card.ability.extra.target = c.sort_id end

slim ferry
#

oh wait

viscid talon
#

it presumes c is a null value

slim ferry
#

it should be

#

new_target.sort_id

#

mb

viscid talon
#

what does . mean btw?

#

is it like "new target" matches "sort id" ?

slim ferry
#

. indexes a table

viscid talon
#

whats a table?

#

index im guessing is a set value

slim ferry
#

variable that has a bunch of other values in it

#

new_target.sort_id gets the value sort_id in table new_target

viscid talon
#

i see

#

so a variable with a group of values..

slim ferry
#

they are also a bit funny in how they work

viscid talon
#

same error

slim ferry
#

no i meant

#

c.sort_id should be new_target.sort_id instead

viscid talon
#

o oke

#
``` ?
slim ferry
#

yes

viscid talon
#

new error

slim ferry
#

buh

#

that shouldnt happen i dont think

#

idk how it would happen

pure salmon
#

how would i check if a card has retriggered during a hand

wind steppe
slim ferry
#

set a flag in context.individual

wind steppe
#

or that

slim ferry
#

and if its already set when it triggers then set a different flag to destroy it

wind steppe
#

yeah nvm thats better

stiff locust
#

how do I hide an entire consumable set in the collection

#

I don't want it to have a button in the consumables section

slim ferry
#

SMODS.ConsumableType can have a no_collection

stiff locust
#

oh

#

cool

sweet pelican
#

Is it possible to have multiple sounds play sequentially in a joker return? I want to use multiple of the "voice" sound files that jimbo uses to imitate the joker talking during scoring

#

a single voice file is like one syllable

#

first time using sound and I couldnt find anything on multiple files on the smods github* unless I missed something

sage crater
#

Bump

long sun
#

is there a way to check if a card isn't already in existence, or is able to exist multiple times?

#

this is for a call to create_card

#

or if there's a way to let SMODS select a card from a table to create, that'd work too

stiff locust
#

if I set a card to be hidden can it still be spawned by effect like "creates a spectral card"

long sun
#

no

stiff locust
#

ok

long sun
#

if in_pool is false then no

reef bobcat
#

hi, how do I make a joker apply debuffs to certain cards? I've been using jokerforge so far to create my mod but the program can't do everything, so I'm trying to get better at actually coding (tho im very beginner)

charred widget
#

Hi lads, I'm trying to import a deck into my mod, but it's giving me this error. Would anyone know what the problem might be?

crystal perch
#

how do i get the # of chips a playing card scores for, including things like enhancements & perm bonuses (like from hiker)

slim ferry
#

Card:get_chip_bonus()

viscid talon
#

trying to make a joker that tracks retriggers

#

i made a retrigger counting flag but idk how to like

#

acc implement it LOL

#

the random joker night vision thing isnt working so i changed its effect to something more simple

#

maybe that wont work either

#

hmmm

#

i need to give night vision a good effect 😭

plucky berry
#

how do you make custom shop slots?

vocal helm
tight pumice
#

Is there a way to go about having a joker make a card count for more than one enhancement?

vocal helm
#

quantum enhancements

granite jay
#

Anyone know how to make a joker trigger other playing cards if a certain playing card is triggered?

slim ferry
#

SMODS.score_card(card, contex) scores a card with the given context table

#

I assume thats what youre looking for

sweet pelican
#

I'm getting this error on boot, any clue how to fix this? I assume something is wrong with my atlas in my main .lua file but I can't seem to find it.

#

my assets are in mod>assets>x2 (and x1)> WebsJokers.PNG

#

nvm fixed it

#

I was missing
atlas_table = "ASSET_ATLAS"

mystic river
stiff locust
#

right

frosty rampart
#

hidden cards still count as hidden even for the set they actually count as

mystic river
#

yes

frosty rampart
#

(that's why the soul and black hole are still rarer than other spectral cards in spectral packs)

mystic river
#

i guess they can also be created if their key is passed directly but that's not what anyone was asking about :v

solid salmon
#

Is there a method or context that can change rarity weights

frosty rampart
#

i think it's just a variable in G or G.GAME that you can change

#

like one variable for each rarity

#

lemme check in-game real quick

sweet pelican
#

Trying to play a sound in joker scoring, any help would be extremely appreciated 😭

jolly shadow
#

its just bigmoney.ogg you dont need to add assets/sounds/

sweet pelican
#

okay I'll give that a try, thank you

#

you're my fucking goat thank you king

#

🙏

frosty rampart
# solid salmon Is there a method or context that can change rarity weights

by altering the value of G.GAME.raritykey_mod, where raritykey is the full key of the rarity (common/uncommon/rare for vanilla rarities), it changes the rates that that rarity will spawn at. all the rarity_mod values start at 1 for the default value i think, increasing it above one makes them more common and decreasing it below one makes them less common

jolly shadow
solid salmon
frosty rampart
#

or more if you're still not satisfied with how much the chance increases, but yes that's the idea

crystal perch
#

though keep in mind that quantum enhancements can be a bit laggy at times

solid salmon
#

Is there a context for entering the shop

jolly shadow
#

starting_shop

gilded narwhal
#

hey so for scale_card on context.individual, I don't like how it shows the message before the card scores, is there a way to do it so the message shows afteR?

native bone
#

How do you score a card in hand? Not like Steel cards that do something when held in hand but like score them?

sweet pelican
#

is there a context I can check for to make sure a consumable can only be used in a blind? like not during a shop or something similar?

#

oh would it be hand_drawn?

#

that makes sense nvm lol

red flower
sweet pelican
#

ohhhhh wonderful, thank you very much :)

azure valley
azure valley
#

yeah, it's pretty cursed

hardy viper
#

?????????????

#

at least it's commented ..

vale zinc
#

@umbral zodiac, here's the basic structure of what I'm doing:

-- the variable
local active_message = localize {
    type = 'variable',
    key = 'k_lapsems_when_ready',
    vars = {
        localize('k_active_ex')
    }
}
-- the localization file
return {
    misc {
        dictionary {
            k_lapsems_when_ready = "Displays \"#1#\" when ready",
        }
    }
}
umbral zodiac
#

ya try putting the loc entry into descriptions.Other rather than misc.dictionary

vale zinc
umbral zodiac
#

descriptions.Other not misc.descriptions

#

like this example from another mod

vale zinc
umbral zodiac
#

what does your localization file look like

vale zinc
umbral zodiac
#

yeah im just gonna say sorry i completely misunderstood the problem from the beginning because i was heavy multitasking and only half reading

gilded narwhal
#

is it just me or did smods change the animation on wee joker

unkempt bronze
#

The timing for stuff like Gros Michel is also a touch off, now that you bring it up.

gilded narwhal
#

i'm not a fan

#

PLEASE smods fix it 🙏

sage crater
#

third bump for the night 😔

#

it's been 7 hours 😩

azure valley
#

Did you make sure that the function add_to_deck is running as you expect?

#

because I'm not seeing where it explicitly gets run

#

and I don't think it's implicitly getting run from the emplace though I could be wrong

#

@sage crater

sage crater
#

it was at one point

#

it's probably not any more, since iirc I swapped where the parentB and parentA were-- or something like that-- but yeah, I don't see why it wouldn't work

#

but then again, it mustn't be working, because the pseudorandom isn't triggering properly

#

oh also, I fixed the mult issue

#

that was because I put a var2 instead of mult var in the calculate's return

sage crater
azure valley
#

you're initializing parentA with parentA?

#

no that wouldn't work

sage crater
#

what?

azure valley
#

oh, that's not one line

sage crater
#

yes, sorry

azure valley
#

that should work yeah.

sage crater
#

ok cool, just checking

azure valley
#

but when does add_to_deck get called?

sage crater
#

so given there's no random changes to the numbers and also all the numbers are exactly the same, I'm inclined to believe it must be that the add_to_deck is not being properly called

sage crater
#

... I think

azure valley
#

the lovely patched emplace method reads as follows:

function CardArea:emplace(card, location, stay_flipped)
if self == G.jokers then
    Cartomancer.handle_joker_added(card)
end
    self:handle_card_limit(card.ability.card_limit, card.ability.extra_slots_used)
    if location == 'front' or self.config.type == 'deck' then 
        table.insert(self.cards, 1, card)
    else
        self.cards[#self.cards+1] = card
    end
    if card.facing == 'back' and self.config.type ~= 'discard' and self.config.type ~= 'deck' and not stay_flipped then
        card:flip()
    end
    if self == G.hand and stay_flipped then 
        card.ability.wheel_flipped = true
    end

    if #self.cards > self.config.card_limit then
        if self == G.deck then
            self.config.card_limit = #self.cards
        end
    end
    
    card:set_card_area(self)
    self:set_ranks()
    self:align_cards()

    if self == G.jokers then
        local joker_tally = 0
        for i = 1, #G.jokers.cards do
          if G.jokers.cards[i].ability.set == 'Joker' then joker_tally = joker_tally + 1 end
        end
        if joker_tally > G.GAME.max_jokers then G.GAME.max_jokers = joker_tally end
        check_for_unlock({type = 'modify_jokers'}) 
    end
    if self == G.deck then check_for_unlock({type = 'modify_deck', deck = self}) end
end
frosty rampart
#

it is not called during emplacement

#

you have to call it manually

azure valley
#

add to deck is not called automatically from this function

frosty rampart
sage crater
sage crater
umbral zodiac
#

if you dont know the benefits then you wouldn't benefit from not using it

#

at least i have to imagine

azure valley
#
function SMODS.add_card(t)
    local card = SMODS.create_card(t)
    if t.set == "Base" or t.set == "Enhanced" then
        G.playing_card = (G.playing_card and G.playing_card + 1) or 1
        card.playing_card = G.playing_card
        table.insert(G.playing_cards, card)
    end
    card:add_to_deck()
    local area = t.area or G.jokers
    area:emplace(card)
    return card
end
frosty rampart
#

add_card is literally just a wrapper that calls create_card, calls the card's add_to_deck, adds the card to G.playing_cards if it's a playing card, and then emplaces the card where it should go

azure valley
#

it's probably what you wanted to do

frosty rampart
#

the only reason you need to be using something else is in very special cases (e.g. putting a joker on the title screen, where not even create_card works properly and you need to manually create a new Card object)

red flower
#

i just use create_card for the title screen

frosty rampart
#

oh right maybe it does work properly and it just didn't work in my use case because i was trying to create a random joker from a pool

#

and either the random part or the pool part didn't work on the title screen

lucid owl
#

currently trying to modify played cards before they're calculated/scored but context.before doesn't seem to be right for that, any other applicable contexts?

red flower
#

context.press_play?

umbral zodiac
#

press play works for me it should work for you

frosty rampart
#

to be clear, do you want this modification to happen once before the hand scores, or once every time an individual card scores
and is this coming from the card being scored or an external source

lucid owl
#

oh i tried that before, there wasn't context.scoring_hand in that context but that should be easy to replace

sage crater
lucid owl
sage crater
#

like this?

red flower
red flower
lucid owl
red flower
peak coral
#

okay i feel like a complete dope for asking this but is there any particular reason this displays as nil? i don't know what i'm doing wrong in particular, but i know i'm missing something big here

    key = "jumptime",
    pos = { x = 1, y = 0 },
    rarity = 2,
    blueprint_compat = false,
    cost = 6,
    discovered = true,
    config = { extra = { h_size = 2, }, { every = 2, }, {jump_remaining = 2 } },
    loc_txt = {
        name = "Ourgughrgggh",
        text = {
            "{C:attention}#1#{} hand size every {C:attention}#2#{} rounds",
            "{C:inactive}(#3# hands remaining)",
        },```
sage crater
frosty rampart
peak coral
#
  1. oh true
  2. i initially had it in one table but changed it because i didnt know what i was doing wrong 😭
frosty rampart
peak coral
#

OH WAIT i had one but i didnt include it in the snippet i sent . my mistake

#

after what i sent prior:

        return {
            vars = {
                card.ability.extra.h_size,
                card.ability.extra.every + 1,
                localize { type = 'variable', key = (card.ability.extra.jump_remaining == 0 and 'jump_active' or 'jump_inactive'), vars = { card.ability.extra.jump_remaining } }
            }
        }
    end,```
#

ill read the localisation documentation and come back to this

#

lowkey i just took it from loyalty card but i Know i fucked up LOL

frosty rampart
#

hm that seems fine

peak coral
#

but alas...

rocky plaza
#

this should be the solution

SMODS.Joker {
    key = "jumptime",
    pos = { x = 1, y = 0 },
    rarity = 2,
    blueprint_compat = false,
    cost = 6,
    discovered = true,
    config = { extra = { h_size = 2, every = 2, jump_remaining = 2 } }, -- copy this line
    loc_txt = {
        name = "Ourgughrgggh",
        text = {
            "{C:attention}#1#{} hand size every {C:attention}#2#{} rounds",
            "{C:inactive}(#3# hands remaining)",
        },
rocky plaza
# peak coral but alas...

ur config table as u showed would have been

{
    extra = {h_size = 2},
    [1] = {every = 2},
    [2] = {jump_remaining = 2}
}
peak coral
#

bless your soul

rocky plaza
#

which is wrong

peak coral
#

still new to this (obviously) so i appreciate it a ton

#

that makes a lot of sense

#

okay im convinced they just hate me LOL

#

WAIT I FIGURED IT OUT NVM

#

i put loc_txt after loc_vars and it works now

#

...oh, wait

rocky plaza
#

ur loc vars is screwed up

frosty rampart
# peak coral ...oh, wait

this one is due to the localize call you make inside the loc_vars function, i figure since you're using loc_txt you don't have a central localization file and therefore you never defined jump_active or jump_inactive

peak coral
#

OH true

#

entirely just my own laziness jdfgjfsdhg

sage crater
#

will this work?
I'm getting an error and I'm kinda thinking it's either this or another thing in my code

frosty rampart
#

what's the error say

#

that's generally helpful

sage crater
sage crater
peak coral
sage crater
peak coral
#

not necessarily in how its programmed but i just realised i worded it COMPLETELY wrong LOL

loud summit
#

is it possible to have an effect on "scoring" a debuffed card

azure valley
#

@loud summit does the following work?

if context.individual and context.cardarea == G.play and context.other_card.debuff and not context.end_of_round then
obsidian spear
#

how do I check if any jokers had gone off in joker_main, in a joker that will add effects (based on used jokers amount) with post_joker

elder rune
plucky berry
plucky berry
vast tusk
#

is there a way to detect a card being selected? as in just hovered over or clicked on without playing

#

cause this code is currently triggering nada...

vast tusk
#

thx once more!

vast tusk
#

soooo, why is this still not doing anything? i have tried 3 variations of the activation hook and it's returns...

vast tusk
#

bruh, then i have been gaslit by my friend... should it just be a calculate function then?

slim sundial
#

Is there a simple guide to getting started with balatro modding?

slim sundial
#

Oh thanks

solid salmon
#

How do i make custom variables

elder rune
solid salmon
#

Like if i made a present variable

#

That

#

If i get 5 makes a jonkler

elder rune
#

present variable?

plucky berry
#

what do i call instaed of assert(SMODS.enhance_card(v, 'm_napoli_garbage')) to add an enhancement

slim ferry
#

v:set_ability('m_napoli_garbage')

plucky berry
slim ferry
#

whats the code

plucky berry
#
    key = "carta",
    dollars = 5,
    mult = 2,
    atlas = "blinds",
    pos = { y = 0 },
    boss = { min = 1 },
    boss_colour = HEX("2d5b4f"),
    calculate = function (self, blind, context)
        if blind.disabled then
      return
    end

    if context.before then
        use_consumable_animation(nil, context.scoring_hand[1], function()
        for k, v in pairs(context.scoring_hand[1]) do
          v:set_ability('m_napoli_garbage')
        end
      end)
    end
  end  
}```
slim ferry
#

yeah thats because context.scoring_hand[1] is a single card

#

not a table of cards

plucky berry
#

yeah i want just the first card to transform

slim ferry
#

then

#

why a for loop

#

if its just one card

plucky berry
#

i'm lazy and i copied from another blind i made that converts all cards

#

thought it'd still work

#

it works without the for loop

solid salmon
plucky berry
#

ofc

solid salmon
#

If i get 5

#

It makes a joker

slim ferry
#

you can just set any value in G.GAME if you want it to be saved with the run

hardy viper
slim ferry
#

asterisk

#

?

hardy viper
#

not aaaany value

slim ferry
#

well yeah but

#

most values

slim ferry
#

they get hit with the MANUAL_REPLACE special

hardy viper
#

it doesn't let you save functions? weird

plucky berry
#

when i enhance the card in context.before it doesn't act like that enhancement, do i need to recalc?

slim ferry
#

so they cant be saved

hardy viper
#

string.dump

slim ferry
#

i guess but the game doesnt do that

#

functions on their own cant be saved

hardy viper
#

blehg

slim ferry
#

you need to do stuff

hardy viper
#

i don't think the upvalues are guaranteed to still be there

faint yacht
slim ferry
#

like you can also save cards if you do :save_card

hardy viper
#

so idk how it'd work

#

regardless you don't ever need to save a function in G.GAME so it's understandable that thunk didn't implement the behavior for it

plucky berry
slim ferry
#

it should act like the enhancement immediately

#

midas mask in vanilla works like that

daring fern
faint yacht
#

But it also depends on the enhancement itself if it does anything specific.

plucky berry
#

like not having chips

#

also it's not inside an event

#
    key = "cazzimma",
    dollars = 5,
    mult = 2,
    atlas = "blinds",
    pos = { y = 1 },
    boss = { min = 2 },
    boss_colour = HEX("73231e"),
    calculate = function(self, blind, context)
    if blind.disabled then
      return
    end

    if context.before then
      use_consumable_animation(nil, context.full_hand, function()
        for k, v in pairs(context.full_hand) do
          v:set_ability('m_napoli_cazzimma')
          SMODS.recalc_debuff(v)
        end
      end)
    end
  end
}```
daring fern
plucky berry
# daring fern What is `use_consumable_animation`?
  -- If it's not a list, make it one
  if cards_to_flip and not cards_to_flip[1] then
    cards_to_flip = { cards_to_flip }
  end

  if card then
    G.E_MANAGER:add_event(Event {
      trigger = 'after',
      delay = 0.4,
      func = function()
        play_sound(sound or 'tarot1')
        card:juice_up(0.3, 0.5)
        return true
      end
    })
  end

  if cards_to_flip then
    for i = 1, #cards_to_flip do
      local c = cards_to_flip[i]
      local percent = 1.15 - (i - 0.999) / (#cards_to_flip - 0.998) * 0.3

      G.E_MANAGER:add_event(Event {
        trigger = 'after',
        delay = 0.15,
        func = function()
          c:flip()
          play_sound('card1', percent)
          c:juice_up(0.3, 0.3)
          return true
        end
      })
    end

    delay(0.2)
  end

  G.E_MANAGER:add_event(Event {
    trigger = 'after',
    delay = 0.1,
    func = function()
      if action and type(action) == "function" then
        action()
      end
      return true
    end
  })

  if cards_to_flip then
    for i = 1, #cards_to_flip do
      local c = cards_to_flip[i]
      local percent = 0.85 + (i - 0.999) / (#cards_to_flip - 0.998) * 0.3

      G.E_MANAGER:add_event(Event {
        trigger = 'after',
        delay = 0.15,
        func = function()
          c:flip()
          play_sound('tarot2', percent, 0.6)
          c:juice_up(0.3, 0.3)

          -- Update the sprites of cards
          if c.config and c.config.center then
            c:set_sprites(c.config.center)
          end
          if c.ability then
            c.front_hidden = c:should_hide_front()
          end

          return true
        end
      })
    end
  end

  G.E_MANAGER:add_event(Event {
    trigger = 'after',
    delay = 0.2,
    func = function()
      G.hand:unhighlight_all()
      return true
    end
  })

  if cards_to_flip then
    delay(0.5)
  end
end```
plucky berry
#

so? how would i make it work

daring fern
plucky berry
#

i need the event to flip the card

daring fern
plucky berry
#

oh so i put end before the enh change not after

daring fern
plucky berry
#
        end)
        for k, v in pairs(context.full_hand) do
          v:set_ability('m_napoli_cazzimma')
          SMODS.recalc_debuff(v)
        end```

this triggers the change before the animations
daring fern
plucky berry
#

before the enhancement key?

slim ferry
#

after

slim ferry
#

why is this crashing? it crashes with could not find enhancement "Red", and printing enh_options reveals that its a list of seals instead of enhancements for some reason

solid salmon
#

Wait so i just use G.GAME.present_points for the custom variable?

slim ferry
#

yeah

#

thought usually if you add custom variables in G.GAME you should add your mod prefix or smth to them

solid salmon
#

Where do i put it

slim ferry
#

wdym where do you put it

#

you can set it anywhere that isnt during load

solid salmon
#

Like where do i declare/initialize it

lean whale
#

does anybody know how to code a boss blind in the game? I've just started my modding journey and am quite inexperienced

final jewel
#

Why do some of my things arent discover even if I play with them several time

slim ferry
#

discovery doesnt really exist for decks, enhancements and seals

#

the mod additions tab still shows discovered total for them for some reason though

final jewel
#

so how do I correct that so its showing the right way

slim ferry
#

i dont think you can

#

it should look normal in the regular collection though

final jewel
#

but like I want to show like this in my repo so people see how much stuff my mod have

slim ferry
#

hm

#

try opening the tabs ig

#

that might fix it

red flower
#

just add discovered = true

maiden phoenix
#

Rate the ui

#

Keyboard players in shambles

final jewel
#

it was just discoverd omg

clear ocean
#

working on my mod again and on stakes but not sure what i did wrong but it crashes

tepid crow
clear ocean
#

that's weird

tepid crow
#

your key says sliver, not silver

clear ocean
#

minor spelling mistake

tepid crow
#

that's how they get ya

clear ocean
slim ferry
#

ruby

clear ocean
#

sorry link i can't give credit

#

come back when you are mhm richer

slim ferry
#

lamp oil, rope, bombs?

#

its yours my friend!

#

as long as you have enough rupees

clear ocean
umbral spire
#

i have no idea why this ain't workin':

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

SMODS.Joker{
    key = 'jj_shiningmask',
    atlas = 'ShiningMask',
    pos = { x = 0, y = 0 },
    rarity = 3,
    unlocked = true,
    discovered = true,

    loc_txt = {
        name = "Shining Mask",
        text = {
            "All {C:attention}face cards{} in the",
            "played hand gain the {C:attention}Foil{} enhancement"
        }
    },

    calculate = function(self, card, context)
        -- this matches how Midas Mask works
        if context.scoring_hand and not context.blueprint then
            local faces = {}
            for _, v in ipairs(context.scoring_hand) do
                if v:is_face() then
                    if not (v.edition and v.edition.foil) then
                        faces[#faces+1] = v
                        G.E_MANAGER:add_event(Event{
                            func = function()
                                v:set_edition({foil = true})
                                if v.juice_up then v:juice_up() end
                                return true
                            end
                        })
                    end
                end
            end
            if #faces > 0 then
                return {
                    message = 'Foiled!',
                    colour = G.C.GREEN,
                    card = self
                }
            end
        end
    end
}
slim ferry
#

its v:set_edition("e_foil")

umbral spire
#

oh

#

ty

clear ocean
#

which one do you prefer? (attention is what the other stake stickers use)

umbral spire
# slim ferry its `v:set_edition("e_foil")`

i tried to select a face card while i had the joker and it crashed?

Oops! The game crashed:
functions/common_events.lua:1259: attempt to call method 'juice_up' (a nil value)

Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-1016c-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows
Steamodded Mods:
    1: ZokersModMenu by Zoker [ID: ZokersModMenu, Version: 2.1.1]
    2: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.5.2~dev, Uses Lovely]
    3: Jarz Mod by Jarz [ID: JarzMod, Version: 1.0.0]
Lovely Mods:
umbral spire
#

oh mb, thanks.

#

(This is supposed to be *like * Midas Mask) I think it applies the Foil a lil' early? How can I make it apply later

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

SMODS.Joker{
    key = 'jj_shiningmask',
    atlas = 'ShiningMask',
    pos = { x = 0, y = 0 },
    rarity = 3,
    unlocked = true,
    discovered = true,

    loc_txt = {
        name = "Shining Mask",
        text = {
            "When a hand is {C:attention}played{},",
            "all {C:attention}face cards{} gain the",
            "{C:attention}Foil{} enhancement"
        }
    },

    calculate = function(self, card, context)
        if context.before and context.scoring_hand and not context.blueprint then
            local faces = {}
            for _, v in ipairs(context.scoring_hand) do
                if v:is_face() and not (v.edition and v.edition.foil) then
                    faces[#faces+1] = v
                    v:set_edition('e_foil')
                end
            end

            if #faces > 0 then
                return {
                    message = "Foiled!",
                    colour = G.C.GREEN,
                    card = card
                }
            end
        end
    end
}
atomic edge
#

talisman changes g.game.dollars to a table it looks like. how can i change it back to a number to compare it?

clear ocean
#

what about this idea

atomic edge
#

thanks

real crown
#

What's the easiest way to make Legendary Jokers appear in the normal joker pool?

umbral spire
plucky berry
#

sto mettendo le carte napoletane in balatro

lean whale
#

hahahah

#

I need help implementing blinds, I've never done it

plucky berry
#

i'm doing it right now

umbral spire
#

like ZokersModMenu

#

press c to open the menu thingy

slim ferry
#

does zokersmodmenu even work

umbral spire
#

works for me

slim ferry
#

also i assume this is for an actual effect and not just testing

umbral spire
#

prol

slim ferry
#

since otherwise the debugplus console always works

umbral spire
#

that has joker spawning stuff?

slim ferry
#

yes?

umbral spire
#

oh

plucky berry
#

what do i do to remove enhancements from cards?

umbral spire
#

i frgot;-;

slim ferry
#

2 to discover, 1 to unlock

umbral spire
#

o cool

slim ferry
slim ferry
# umbral spire o cool

works for any card except boosters iirc, and also works with boss blinds and tags iirc

real crown
daring fern
slim ferry
#

ive tried it in the shop and it said that there is no area for the booster

#

so i just eval SMODS.add_booster_to_shop

daring fern
slim ferry
#

i did it with 3

#

oh it works now

#

huh

clear ocean
#

not sure if i word it right

umbral spire
slim ferry
#

why negates

wind steppe
clear ocean
#

negates?

wind steppe
#

this is understandable

#

that being said this stake sucks

slim ferry
#

what does negating $1 even mean

wind steppe
#

nobody skips blinds anyways

umbral spire
#

its the verb of 'negative' isn't it?

clear ocean
#

yeah i dont have much ideas for stakes

unkempt bronze
slim ferry
#

i know but

wind steppe
slim ferry
#

it cancels out one of your dollars by giving you -$1 balatrojoker

clear ocean
umbral spire
clear ocean
# clear ocean

maybe ill come back to stakes later but i think ruby is fine

umbral spire
#

Why does the foil enhancement apply to the card before it even says (on the joker) "Foiled!"?

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

SMODS.Joker{
    key = 'jj_shiningmask',
    atlas = 'ShiningMask',
    pos = { x = 0, y = 0 },
    rarity = 3,
    unlocked = true,
    discovered = true,

    loc_txt = {
        name = "Shining Mask",
        text = {
            "All {C:attention}face cards{} in the",
            "played hand gain the {C:attention}Foil{} enhancement"
        }
    },

    calculate = function(self, card, context)
        if context.joker_main and not context.blueprint then
            local faces = {}

            for _, v in ipairs(context.scoring_hand or {}) do
                if v:is_face() and not (v.edition and v.edition.foil) then
                    table.insert(faces, v)
                    v:set_edition('e_foil')
                end
            end

            if #faces > 0 then
                return {
                    message = 'Foiled!',
                    colour = G.C.GREEN,
                    card = card
                }
            end
        end
    end
}
umbral spire
wind steppe
#

im not the most qualified to explain it

umbral spire
wind steppe
#

yeah

burnt tide
#

What's wrong ? It crashes the game

it's in SMODS.Back, I want to show a tooltip of my custom tag

daring fern
#

You use T: in the description.

#

Also it would've been G.P_TAGS

burnt tide
#

oh okay

#

thanks

lean whale
#

code to make blind debuff enhanced cards?

daring fern
plucky berry
#

is it possible to make a joker that sets all boss blinds to be a specific one?

slim ferry
thorn basin
#

I'm trying to make a joker that makes 3oak's appear more often but I'm unsure about how should I make this joker that whenever you draw cards, draw 3 cards of the selected randomRank...

thorn basin
daring fern
thorn basin
daring fern
#

You always need a context check.

thorn basin
#

(also I should check if there are exactly 3 or more cards in the full deck, if not then it selects the randomRank again)

plucky berry
slim ferry
#

no

#

one moment

#

also you should just return a string, not put it in a table

lean whale
#

how does the mod prefix work and how do I use it correctly

slim ferry
#

the mod prefix automatically gets added to all objects you create, resulting in <class prefix>_<mod prefix>_<key>

daring fern
slim ferry
plucky berry
hidden notch
#

Have you maybe figured it out yet?

#

-# Ope sorry for the Ping xwx

daring fern
thorn basin
slim ferry
# plucky berry i didn't really understand what to do tbh
local new_boss_ref = get_new_boss --save original function
function get_new_boss()
    if next(SMODS.find_card("j_modprefix_key")) then --check for the joker
        return "<boss key>"
    end
    return new_boss_ref() --use original function if you dont have the joker
end
plucky berry
#

tnx

languid canopy
#

Hey, what sort of code do i have to use to change the main menu logo?

daring fern
languid canopy
#

Thx

astral sleet
#

tried avoiding this but i've got a joker that's meant to cost $1, but due to applying an edition to itself it ends up costing $6, not sure how to fix this

#

i've tried manually setting its cost in a few areas but i think i'm missing something

thorn basin
# daring fern Yes.

ok I just tested it and for some reason... the base queue starts to... increase? that at some point I cannot play hands or discards

thorn basin
thorn basin
lean whale
#

I'm getting an Error: attempt to index field 'atlas' (a nil value), but I have no clue how to interpret that
I'm trying to code a blind

daring fern
lean whale
#

oh

thorn basin
lean whale
#

now it says
attempt to perform arithmetic on field "frames" (a nil value)

red flower
#

you need to add the frames

astral sleet
# daring fern Hook `Card:set_cost()`

can i ask why (other than making things easier for myself later down the line)? i just changed :set_cost() to .set_cost() and this seems to work (i will need to fix the sell value but that's relatively easy)

#

if i were to hook all i'd really write in the hook would be to .set_cost and some other shit so it's just globalising the solution that i only really needed here

lean whale
#

best result I've had all day, thanks everybody for your help! (it's my own boss, just need to actually customise it)

astral sleet
#

i just found .set_cost used somewhere else

#

and it works?

#

i can't explain why

red flower
#

sorry i dont have the entire context, what are you changing

wicked leaf
#

can I just use strings for add_card's rarity or does it have to be numbers

wicked leaf
#

that makes me happy

astral sleet
red flower
astral sleet
#

oh

#

card:set_cost(1)

#

it's when it

#

adds to deck

red flower
#

thats not how the function works

astral sleet
#
        card:set_edition('e_negative', true, true)
        card.set_cost(1)
    end,```
red flower
#

that should crash

astral sleet
#

it doesn't!

#

¯_(ツ)_/¯

#

i'm really confused

red flower
#

i can assure you it will

astral sleet
#

it hasn't

red flower
#

so if it doesnt then its not running

astral sleet
#

it's working

#

hm

#

but it's turning negative

wicked leaf
#

Also is it "Three Of A Kind" or "Three of a Kind"

red flower
#

maybe you didnt save?

astral sleet
#

no.. it's doing both

#

it's fixing the cost

#

and

#

originally it would always cost $6

red flower
#

well idk maybe you did some other change

astral sleet
#

what

#

hold on

#

yeah it did just crash what the fuck

#

how did i fix this

#

what

#

uuhhhh hold on

#

hold on

#

OH

lean whale
astral sleet
#

IM STUPID

red flower
#

card:set_cost() is just a function that calculates the cost, it only takes the card and no other value. card:set_cost(1) will ignore the 1. card.set_cost(1) will treat 1 as the card and crash

astral sleet
#

i had it saved

#

as card.cost=1

#

which works

#

but for some reason

#

i rewrote it

#

to be card.set_cost=1

#

and i was reading that

red flower
#

that will work but only until another card calls set_cost on it

astral sleet
#

i'm really not sure how i forgot what i did

#

oh really

#

hm

red flower
#

so not permanently

lean whale
#

I had the same issue with the blind

#

but now it's fixed

red flower
lean whale
#

If I don't include the blind in the game the joker works

stiff locust
#

anyone know why i'm getting this crash when using SMODS.destroy_cards on some cards

stiff locust
#

i would like to not show that if I can help it but I'm mostly concerned because I'm using the vanillaremade hanged man code for this

astral sleet
stiff locust
#

it's identical except I changed the max destroyed cards (but no value makes it not crash)

astral sleet
#

hm

red flower
astral sleet
#

oh also the vanilla remade is very useful for figuring things out just wanted to thank you while you're here

red flower
#

❤️

stiff locust
#
function SMODS.destroy_cards(cards, bypass_eternal, immediate)
    if not cards[1] then
        cards = {cards}
    end
    local glass_shattered = {}
    local playing_cards = {}
    for _, card in ipairs(cards) do
        if bypass_eternal or not SMODS.is_eternal(card, {destroy_cards = true}) then
            card.getting_sliced = true
            if SMODS.shatters(card) then
                card.shattered = true
                glass_shattered[#glass_shattered + 1] = card
            else
                card.destroyed = true
            end
            if card.base.name then
                playing_cards[#playing_cards + 1] = card
            end
        end
    end
    
    check_for_unlock{type = 'shatter', shattered = glass_shattered}
    
    if next(playing_cards) then SMODS.calculate_context({scoring_hand = cards, remove_playing_cards = true, removed = playing_cards}) end

    for i = 1, #cards do
        if immediate then
            if cards[i].shattered then
                cards[i]:shatter()
            elseif cards[i].destroyed then
                cards[i]:start_dissolve()
            end
        else
            G.E_MANAGER:add_event(Event({
                func = function()
                    if cards[i].shattered then
                        cards[i]:shatter()
                    elseif cards[i].destroyed then
                        cards[i]:start_dissolve()
                    end
                    return true ---this is 2538
                end
            }))
        end
    end
end
red flower
#

are you checking the lovely dump

stiff locust
#

the lovely dump only has balatro's files in it

#

this is an smods file that crashed

red flower
stiff locust
#

wait no

#

it has smods too???

#

didn't know that

red flower
#

anything that gets patched

stiff locust
#

okay now it's this

#

I still don't get it

astral sleet
#

i'll go figure out how to do it properly

stiff locust
#

adding SMODS.destroy_cards to my enemy functions list

red flower
#

does your card have card[1] for some reason

stiff locust
#

cards is the list of cards put into SMODS.destroy_cards

wicked leaf
#

what's the variable for blind scaling?

stiff locust
#

which is 4 highlighted cards right now (crashes with any number of highlighted cards though)

red flower
#

i would need to see the log

stiff locust
#

so it's trying to access a card that doesn't exist which makes no sense

stiff locust
umbral spire
#

using this tarot card crashes the game? something like card.lua:607 : attempt to index nil value

#

dw bout the names

slim ferry
#

fart

red flower
umbral spire
lean whale
#

What’s a good way to create the 1x and 2x for icons (like a joker or a blind tag), I usually create the 1x but when I try to upscale to 2x it’s all blurred, and I have not found a way to do this reliably

stiff locust
# red flower hmm what i think may be happening is that you're using a value in an event that ...

i'm using the vanillaremade hanged man code :( i thought it would be easy

use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                play_sound('tarot1')
                card:juice_up(0.3, 0.5)
                return true
            end
        }))
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.2,
            func = function()
                SMODS.destroy_cards(G.hand.highlighted)
                return true
            end
        }))
        delay(0.3)
    end,
#

why would this not be working

lean whale
red flower
stiff locust
#

gifs are blocked

#

just know i wanted to send one

red flower
#

hmm no works fine for me

umbral spire
# lean whale Krita

iirc -- try to go to Image > Select Image to New Size . . . and in the scaling dialog thing set "Filter" to "Nearest Neighbour" and 200% new size.

stiff locust
#

well fuck me I guess

#

i'll just destroy the cards manually

lean whale
#

I’ll try thx

stiff locust
#

there's so much shit wrong with my modpack bro

#

I can't save runs anymore and I thought everyone else also had this problem

umbral spire
stiff locust
#

now you're telling me SMODS.destroy_cards doesn't work

#

its going in the bucket with SMODS.change_base and SMODS.add_card

red flower
#

i think you have a virus

stiff locust
#

it's probably deluxe consumables

#

but that mod is so cool

#

it's just not updated for newer smods

#

half the things are broken

#

but I want it so bad

umbral spire
stiff locust
#

thats all i can see

umbral spire
#

o right

lean whale
lean whale
#

Thank u

umbral spire
#

32x32, 100% scale.

lean whale
#

Fuck I did 64 haha

#

Thanks

umbral spire
#

np lol

#

and i think everything else is 71x95

#

mostly

dapper sun
#

didn't even need to ping mods for them to get purged,, ,

sturdy compass
#

Cuz it was posted in modding-chat too lol

dapper sun
#

ah lol

#

that'd do it lol

wild pine
#

is there a way to use contexts in the use function for consumables?

#

like if i wanted a consumable that permanently increases probabilities when used

slim ferry
#

there isnt

wintry solar
wild pine
#

oof

slim ferry
#

though you can increase a global variable

#

and then use that in a mod calculate

#

SMODS.current_mod.calculate

wild pine
#

what like G.GAME.probabilities.normal?

#

oh

#

but would that affect odds on vanilla cards

slim ferry
#

wdym

#

if you use mod calculate you can just make it affect whatever you want

wild pine
#

oh fr

slim ferry
#

its just a calculate function but global and not attached to a specific game object

shell timber
#

do mod calculates trigger before or after jokers

slim ferry
#

idk

sturdy compass
#

mod calculate was such a sneaky good addition and I feel like nobody talks about it lmao

slim ferry
#

when do we get mod calc_dollar_bonus

#

and mod calc_scaling

#

fr

umbral spire
#

why doesn't my seal work? , no crash or anything, it just does nothing on a card

----    SEALS
------------------------------

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

SMODS.Seal{
    key = 'Doodoo',
    atlas = 'DoodooSeal',
    pos = { x = 0, y = 0 },
    badge_colour = G.C.BROWN,
    config = { extra = { x_mult = 1.1, x_chips = 1.1, flat_chips = 11, flat_mult = 1 } },

    loc_txt = {
        name = "Doodoo",
        text = {
            "{X:mult,C:white}x#1#{} Mult, {X:chips,C:white}x#2#{} Chips,",
            "{C:chips}+#3# Chips{}, {C:mult}+#4# Mult{}."
        }
    },

    loc_vars = function(self, info_queue, card)
        local e = self.config.extra
        return { vars = { e.x_mult, e.x_chips, e.flat_chips, e.flat_mult } }
    end,

    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            local e = card.ability.seal.extra

            return {
                x_mult = e.x_mult,
                x_chips = e.x_chips,
                mult = e.flat_mult,
                chips = e.flat_chips,
                card = card
            }
        end
    end
}
slim ferry
#

it has to be context.main_scoring

#

instead of context.individual

#

also card.ability.seal isnt a table

#

you need to use self.config.extra

umbral spire
#

like?

SMODS.Seal{
    key = 'Doodoo',
    atlas = 'DoodooSeal',
    pos = { x = 0, y = 0 },
    badge_colour = G.C.BROWN,
    config = { extra = { x_mult = 1.1, x_chips = 1.1, flat_chips = 11, flat_mult = 1 } },

    loc_txt = {
        name = "Doodoo",
        text = {
            "{X:mult,C:white}x#1#{} Mult, {X:chips,C:white}x#2#{} Chips,",
            "{C:chips}+#3# Chips{}, {C:mult}+#4# Mult{}."
        }
    },

    loc_vars = function(self, info_queue, card)
        local e = self.config.extra
        return { vars = { e.x_mult, e.x_chips, e.flat_chips, e.flat_mult } }
    end,

    calculate = function(self, card, context)
        if context.main_scoring and context.cardarea == G.play then
            local e = self.config.extra

            return {
                x_mult = e.x_mult,
                x_chips = e.x_chips,
                mult = e.flat_mult,
                chips = e.flat_chips,
                card = card
            }
        end
    end
}

?

slim ferry
#

yes

daring fern
slim ferry
#

what

#

how long has that been a thing

#

i thought it was a string at some point

red flower
#

thats card.seal

umbral spire
slim ferry
#

oops

#

i wonder why so many mods use self.config for seals then

slim ferry
#

btw

#

you can do if not G.GAME.voidextraodds instead of == nil

wild pine
#

oh true

slim ferry
#

not sure if theres a difference i think using not is usually better

wild pine
#

ill take your word for it thx

#

first time making a mod so lmao dont know much about that stuff

#

my code is probably Not That Great

slim ferry
#

oh ive seen way worse things in this chat

#

dw

#

this doesnt look that bad at all from what ive seen

daring fern
charred widget
#

Hi friends! I've been trying to implement a deck into my mod, but it's just been giving me this crash. anyone have any ideas as to how we can fix this?

charred widget
unkempt bronze
#

Is greater than or equal >= or =>?

lean whale
#

=

unkempt bronze
#

I had a suspicion, just wanted to check. Thank you, Romeo.

daring fern
lean whale
#

I need help with localisation, I want to make a file to store names and descriptions of whatever I add, but I have no clue on how to actually "link" it to the files containing jokers n shi

glass scaffold
#

This hooked code only returns Polychrome when I redeem the Hallucination voucher and I have no idea why.

slim ferry
lean whale
#

the prefix is the one specified in the json file right?

daring fern
violet oasis
#

Oh lol

#

Nobody saw it

daring fern
charred widget
#

nevermind

glass scaffold
lean whale
slim ferry
#

what does your localization file look like

glass scaffold
lean whale
daring fern
daring fern
glass scaffold
lean whale
final monolith
#

are there resources for making music replacement mods?

lean whale
#

Oh shit I spelled it localisation not localization

#

ok now it works :>

vale grove
#

anyone have any clue why this wouldnt work?

#

it says something about atlas being a nil value when i hover over the page of the blind

#

which i find strange because i feel like it shouldnt do that?

lean whale
#

do u have other things referencing the same atlas

#

as in do u have other cases where u have called the atlas "Ode" and referenced it with another object

red flower
slim ferry
red flower
slim ferry
#

oh

#

atlas_table then

vale grove
red flower
slim ferry
#

also doesnt it need a frames field or is that on the blind

red flower
#

yes

#

this should probably be in the blind wiki but nobody reads it so

daring fern
unkempt bronze
#

In {set = 'whatever'}, is set intended to be a table?

#

Because I have a precise set of cards I want a making card to pull from, and I don't want to cut up those cards to their own group.

slim ferry
#

set is meant to be the key of an objecttype as a string

frosty rampart
lean whale
unkempt bronze
# slim ferry `set` is meant to be the key of an objecttype as a string
SMODS.Consumable {
    key = "lanthanides",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 0, y = 5 },
    unlocked = true,
    discovered = true,    
    can_use = function(self, card)
        return (card.area == G.consumeables)
    end,
    use = function(self, card, area, copier)
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                func = function()
                        SMODS.add_card({ set = 'xiferp_Element' })
                    return true
                end
            }))
        end,    
    loc_txt = {
        name = 'Lanthanides',
                text = {
                    'Creates a random Lanthanide card',
                },
            }

}```

Here's the code of it, and I want it to pull from a list of 15 cards. What do I place in ``SMODS.add_card()``?
slim ferry
#

you need to create an SMODS.ObjectType with that set of cards

#

and then put the key of that in there

unkempt bronze
slim ferry
#

what do you mean "inside" other types

#

its just a list of centers

unkempt bronze
#

Hmm, will pseudorandom_element{list of keys for the cards} work?

slim ferry
#

that can also work

unkempt bronze
#

I'll go with that, it's easier on my brain. (I love this bit of coding, like a road trip.)

stone dagger
#

Hello, is there any way for an event to access context? I wanted to create a consumable that on use makes it so next shop has an uncommon joker. But since the consumable is destroyed on use. I can't use calculate()

unkempt bronze
#

Have it add an uncommon tag?

daring fern
unkempt bronze
#

(best idea I had)

stone dagger
daring fern
# stone dagger How would I do that?

G.GAME.modprefix_next_shop_uncommon_joker = true and:

local oldcreatecard = create_card
function create_card(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
    if G.GAME.modprefix_next_shop_uncommon_joker and key_append == 'sho' then
        _type, _rarity = 'Joker', 'Uncommon'
        G.GAME.modprefix_next_shop_uncommon_joker = nil
    end
    return oldcreatecard(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
end
unkempt bronze
# slim ferry that can also work

{ pseudorandom_element({'xiferp_lanthanum', 'xiferp_cerium', 'xiferp_praseodymium', 'xiferp_neodymium', 'xiferp_promethium', 'xiferp_samarium', 'xiferp_europium', 'xiferp_gadolinium', 'xiferp_terbium', 'xiferp_dysprosium', 'xiferp_holmium', 'xiferp_erbium', 'xiferp_thulium', 'xiferp_ytterbium', 'xiferp_lutetium' }, 'Lanthanide_pull' )}
Is this what I should go for?

slim ferry
#

yes

unkempt bronze
#

table with the lanthanides first, then the seed.

#

I'm getting better at this whole coding thing

#

On an unrelated note, one line in my code has breached 375 characters long.

stone dagger
stone dagger
#

Ok. Sorry Im kinda lost cause I haven't overriden functions yet.

So the key_append = 'sho' means it is for when the jokers are created for the shop?

When/Where in the code would I override this function? Can I place it just in my file outside any class so when the mod is loaded it overrides?

stone dagger
#

Nice, thank you

#

though this seems like the kind of solution I wouldn't be able to come up on my own xD

vale grove
# red flower

okay so currently it displays the flash but it also moves

#

this is what it looks like rn

daring fern
solid salmon
#
    key = "wrapped",
    pos = {x = 0, y = 0},
    config = {extra = {present_points = 5, present_points_mod = 1, present_points_reset = 5}},
    discovered = false,
    loc_vars = function(self, info_queue, card)
        return {
            vars = { card, card.ability.extra.present_points_mod, card.ability.extra.present_points, card.ability.extra.present_points_reset}
        }
    end,
    calculate = function (self,card,context)
        if context.cardarea == G.discard then
            for _, discarded_card in pairs(G.discard.cards) do
                card.ability.extra.present_points = card.ability.extra_present_points - card.ability.extra.present_points_mod
                if card.ability.extra.present_points == 0 then
                    SMODS.add_card({ set = 'Joker' })
                    card.ability.extra.present_points = card.ability.extra.present_points + card.ability.extra.present_points_reset
                end
            end
        end
    end,
atlas = "wrapped"
}
)
SMODS.Atlas {
    key = "wrapped",
    path = "wrapped.png",
    px = 71,
    py = 95
}```
#

i want this to lower the present points whenever a wrapped card is discarded

queen meadow
#

how does one properly implement a malverk skin to a modded card?
when the skin is enabled via mod menu but not in use via the malverk ui, it defaults to using the default balatro sprite
I copied the way Celestial Funk implemented a modded skin (it skinning Asteroid of Multiplayer (?)) Is there any other way to implement modded skinning that doesn't have this happen?

unkempt bronze
#
SMODS.Consumable {
    key = "potassium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 15, y = 2 },
    unlocked = true,
    discovered = true,
    can_use = function(self, card)
      return true
    end,
    use = function(self, card, area, copier)
        G.GAME.xiferp_alkimetal_chips = (G.GAME.xiferp_alkimetal_chips or 0) + 20
    end,
    loc_txt = {
        name = 'Potassium',
                text = {
                    'Adds +20 chips for the hand',
                    'after this is used, and adds one',
                    'new card to the deck',
                },
            },
    calculate = function(self, card, context)
      local alki_card = SMODS.add_card { set = "Base" }
      G.GAME.blind:debuff_card(alki_card)
      G.hand:sort()
      SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
    end
}```

These kinds of cards snap the game upon buying from the shop. I think it has something to do with the ``can_use`` part, saying you can use it even in the shop.
#

Should I change it to something like context.blind?

stone dagger
daring fern
red flower
unkempt bronze
#

Also, is there any way to put a card into the shop with debug plus?

daring fern
unkempt bronze
#

but not standard consumable?

daring fern
unkempt bronze
#

Welp, better make good use of that $10 button

daring fern
unkempt bronze
#

Still doesn't help with the fact that the code is still breaking the game it seems

unkempt bronze
#
SMODS.Consumable {
    key = "cesium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 16, y = 4 },
    unlocked = true,
    discovered = true,
    can_use = function(self, card)
      return G.GAME.blind.in_blind
    end,
    use = function(self, card, area, copier)
        G.GAME.xiferp_alkimetal_mult = (G.GAME.xiferp_alkimetal_mult or 0) + 10
    end,
    loc_txt = {
        name = 'Cesium',
                text = {
                    'Adds +10 mult for the hand',
                    'after this is used, and adds one',
                    'new card to the deck',
                },
            },
    calculate = function(self, card, context)
      if context.blind.in_blind == true then
      local alki_card = SMODS.add_card { set = "Base" }
      G.GAME.blind:debuff_card(alki_card)
      G.hand:sort()
      SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
    end
    end
}```
Like this?
daring fern
unkempt bronze
daring fern
unkempt bronze
daring fern
unkempt bronze
#
        if context.[???] then
          local alki_card = SMODS.add_card { set = "Base" }
          G.GAME.blind:debuff_card(alki_card)
          G.hand:sort()
          SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
        end
    end,```
what should be in place of [???]
nova sleet
#

Is there a dedicated color palette restriction for Balatro?

#

or can you use any colors

unkempt bronze
#

there is a palette for jokers if you'd like to follow it, but you don't need to

maiden phoenix
unkempt bronze
solid salmon
#

Hey

unkempt bronze
#

Hey!

nova sleet
unkempt bronze
#

Not really

maiden phoenix
daring fern
gilded goblet
#

#000000 looks really dark in-game and i assume it's something to do w saturation
its not to say you cant use it, u just need to figure out a way to not make it seem odd

unkempt bronze
#

not just that, but the pack's good too

#

Well, actually...

gilded goblet
#

uh oh

unkempt bronze
#
SMODS.Consumable {
    key = "magnesium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 17, y = 1 },
    unlocked = true,
    discovered = true,
    can_use = function(self, card)
      return true
    end,    
    loc_txt = {
        name = 'Magnesium',
                text = {
                    'Gives 1 random card a random seal',
                    'and adds +10 chips to your next hand.',
                },
            },
    use = function(self, card, area, copier)
        G.GAME.xiferp_alkemetal_chips = (G.GAME.xiferp_alkemetal_chips or 0) + 10        
    calculate = function(self, card, context)
            local xiferp_seal_the_deal = SMODS.poll_seal({guaranteed = true, type_key = 'shuffletheseed'})
            local card_to_change = pseudorandom_element(G.hand.cards, 'shufflethedeck')
                      G.E_MANAGER:add_event(Event({
                           func = function()
                                card_to_change:set_seal(xiferp_seal_the_deal, nil, true)
                           return true
                     end
             }))  
        end   
   end 
}```

this doesn't work, doesn't add seals.
daring fern
unkempt bronze
#

I did that for literally every other one

#

This one slipped through

mystic river
#

what would y'all call a certificate-alike that creates enhanced cards instead of sealed cards

unkempt bronze
#

Level-Up

#
SMODS.Consumable {
    key = "potassium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 15, y = 2 },
    unlocked = true,
    discovered = true,
    can_use = function(self, card)
      return G.GAME.blind.in_blind
    end,
    use = function(self, card, area, copier)
        G.GAME.xiferp_alkimetal_chips = (G.GAME.xiferp_alkimetal_chips or 0) + 20
          local alki_card = SMODS.add_card { set = "Base" }
          G.GAME.blind:debuff_card(alki_card)
          G.hand:sort()
          SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
    end,
    loc_txt = {
        name = 'Potassium',
                text = {
                    'Adds +20 chips for the hand',
                    'after this is used, and adds one',
                    'new card to the deck',
                },
            },
}```
WHERE IS THE ERROR NOW!!??? (can't even copy it in without the game closing on itself)
#

(The cards just like it are perfectly fine)

unkempt bronze
solid salmon
#
    key = "wrapped",
    pos = {x = 0, y = 0},
    config = {extra = {present_points = 5, present_points_loss = 1, present_points_reset = 5}},
    discovered = false,
    loc_vars = function(self, info_queue, card)
        return {
            vars = { card, card.ability.extra.present_points_loss, card.ability.extra.present_points, card.ability.extra.present_points_reset}
        }
    end,
    calculate = function (self,card,context)
        if context.discard and context.other_card == card then
            card.ability.extra.present_points = card.ability.extra.present_points - card.ability.extra.present_points_loss
            if card.ability.extra.present_points == 0 then
                    SMODS.add_card({ set = 'Joker' })
                    card.ability.extra.present_points = card.ability.extra.present_points + card.ability.extra.present_points_reset
            end
        end
    end,
atlas = "wrapped"
}
)
SMODS.Atlas {
    key = "wrapped",
    path = "wrapped.png",
    px = 71,
    py = 95
}``` 
is there a way to make all the wrapped cards share the same present points?
#

like this works

#

BUT the points stuck to individual cards

daring fern
solid salmon
#

how do i make it global?

unkempt bronze
#

Nevermind, somehow seemed to fix it

unkempt bronze
solid salmon
#

so G.GAME.present_points

unkempt bronze
#

yeag

daring fern
solid salmon
#

do i declare that in the enhancement?

unkempt bronze
#

I have similar variables thanks to that

unkempt bronze
solid salmon
#

like this?

unkempt bronze
solid salmon
#

othe

daring fern
unkempt bronze
#

then swap modprefix with othe

solid salmon
#

so like this

unkempt bronze
#

yep!

solid salmon
#

neat

#

now i can make a variable called splunksplosioncore and no one can stop me now

final jewel
#

I crash when I start the game

solid salmon
#

i fixed the issue

#

but the only small error left is

#

before discarding any of them it shows nil cards

#

instead of 5

#

fixed it

#

i just put or 5

daring fern
final jewel
#

yeah

unkempt bronze
#
    key = 'radi',
    shader = 'radi',
    config = { x_mult = 2, prob = 15 },
    in_shop = true,
    weight = 3,
    extra_cost = 5,
    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.edition.prob, 'e_xiferp_radi')
        return { vars = { card.edition.x_mult, numerator, denominator } }
    end,
    get_weight = function(self)
        return (G.GAME.edition_rate - 1) * G.P_CENTERS["e_negative"].weight + G.GAME.edition_rate * self.weight
    end,
    calculate = function(self, card, context)
        if context.post_joker or (context.main_scoring and context.cardarea == G.play) then
            if SMODS.pseudorandom_probability(card, 'e_xiferp_radi', 1, card.edition.prob) then
                SMODS.destroy_cards(card, nil, nil, true)
            end,
            return {
                x_mult = card.edition.x_mult
            }
        end
    end
}```
Where do I put the visual for this, and will this do as I think it will?
#

(i.e. destroy itself if the odds hit)

daring fern
unkempt bronze
#

The card or the edition?

daring fern
#

You need to put return nil after SMODS.destroy_cards

unkempt bronze
final jewel
daring fern
unkempt bronze
final jewel
#
SMODS.Blind {
    key = "selfish",
    dollars = 5,
    mult = 2,
    atlas = "Blinds",
    pos = {x = 0, y = 0},
    boss = {min = 1},
    calculate = function(self, blind, context)
        if not blind.disabled then
            if context.discard and not context.blueprint and #context.full_hand == 5 then
                return {
                    function ()
                        ease_dollars(-5)
                        delay(0.2)
                    end
                }
            end
        end
    end,
    boss_colour = HEX("03fcb6"),
}`
daring fern
final jewel
#

oh yeah oups

final jewel
#

it crash again

unkempt bronze
final jewel
#

nevermind I made it work somehow

native bone
#

I got this error when I played a card with the irken seal. It just says I cant index extra, but the line it points to as an error is an else condition, so that is confusing me.

native bone
#

I replaced it

final jewel
#
func = function ()
   for i = 1, #G.discard.cards do
       G.E_MANAGER:add_event(Event({
             func = function()
                   G.discard.cards[i]:juice_up()
                   return true
              end
       }))
       ease_dollars(-1)
       delay(0.2)
       return true
    end
end

why does it work only after the first discard

daring fern
final jewel
daring fern
final jewel
#

oh yeah

stone dagger
#

Why am I being able to use my consumable when in the shop?

can_use = function (self, card)
        if G.GAME.blind and G.hand and G.GAME.dollars >= G.GAME.bankrupt_at + card.ability.extra.amount then
            return true
        end
        return false
    end
sharp arch
#

wsg chat

stone dagger
sharp arch
#

yall my localiztion file isn't workin and i KNOW i fucked up so can yall help me

wicked leaf
#

my deck is crashing when I hover over it

#

wait I think I see the issue

#

why isnt the text separate.

copper perch
wicked leaf
#

X: removes spaces apparently

copper perch
#

ahhh

chrome widget
#

Winter mods release in ETA whenever an artist gets me one more joker. So probably tomorrow

maiden phoenix
copper perch
#

Would anyone know how to make a playing card in a specific position (like left-most for instance) be destroyed? I know how to do random, but unsure how to do a specific one. My current code below, which is for random

local card_ = pseudorandom_element(G.hand.cards, 'seed')
            SMODS.destroy_cards(card_, nil, true)
slim ferry
#

G.hand.cards[i] is the card in position i from the left

copper perch
#

assuming 1 would be leftmost and up from there, or start at 0?

slim ferry
#

yes, starts at 1 as leftmost

copper perch
#

thank you :)

clear ocean
#

is there a way to ban the blue seal?

#

should i ban the arm and or flint for balancing or should they not be banned

slim ferry
#

i mean the arm does nothing

#

so might as well

clear ocean
#

well you can still level up with i was thinking a space joker and maybe oops

slim ferry
#

also you can ban blue seal but idk if itll work if you put it into banned_keys, you can ban it in apply instead though

clear ocean
#

doesnt look like it will work the normal way

#

does the spectral cards that create cards spawn with seals?

sweet pelican
#

First time making consumables, how would I get this to force draw 3 cards (beyond hand limit)? I saw a similar mod use this "assert" but I haven't used it. Any advice would be great appreciated!

#

(also just realised even if this did work it would draw nine cards but I can fix that lol)

clear ocean
copper perch
#

Confused whats going on here...was working just fine before, but now its not. It has to compare to the number of cards in hand, but saying it cant for some reason-

if context.end_of_round and not context.game_over and context.main_eval and SMODS.find_card("j_DRY_Wyfole") > 0 and #G.hand.cards > 1 then
            local nullcard1_ = G.hand.cards[2]
            if #G.hand.cards > 2 then
                local nullcard2_ = G.hand.cards[3]
                SMODS.destroy_cards(nullcard2_, nil, true)
            end
            SMODS.destroy_cards(nullcard1_, nil, true)
sweet pelican
wild pine
#

this is gonna sound real stupid but is there a way to have a booster pack not return SMODS.create_card
im making an alternate set of tarots with the hidden property so they have a chance of showing up in tarot packs, but you can also open a pack of just those alternate ones
issue is since theyre all hidden the alt pack gives nothing but the default card, since the cards still count as hidden even for their own set

#

so when i run this i get a variety of 5 cards from the upper bit and then 5 default cards from the lower bit

#

but removing that return statement just causes a crash

native bone
#

Is there a code example of a Red Seal by any chance?

frosty rampart
#

the humble vanillaremade:

wind steppe
#

me when the vanilla is remade

sweet pelican
#

the vanilla remade in question:

native bone
sweet pelican
#

as a new modder myself this shit is like the bible dawg

native bone
#

Wait, can I post images?

sweet pelican
#

yeah

#

like screencaps

copper perch
sweet pelican
#

This consumable is supposed to discard 3 cards, everything works pretty much as intended but it just doesnt discard the selected cards at all, am I using "G.FUNCS.discard_cards_from_highlighted(nil, true)" in the correct way?

#

NVM FIXED IT

#

I didnt need the check for selected

#

istg I should just type this into a personal text document I always post here then fix it 5 minutes later somehow

native bone
#

This current function to check if I have Zim doesnt work when I tested it.

#

It is Jokerforge generated code, so there is probably a smarter way to do it lol

frosty rampart
#

what is jokerforge on mr_bones
you don't need a whole-ass function when smods already has a function for it
next(SMODS.find_card("j_modprefix_zim")) is true if you have at least one Zim joker
(replace "modprefix" with your mod's actual prefix ofc)

native bone
#

So does the find card return true or false depending on if it actually found it?

frosty rampart
#

SMODS.find_card returns a table that contains every instance of the card you're looking for. if you don't have the card, it returns an empty table
putting it in next() means that it ends up returning the first card object in the table, or nil if the table is empty. nil counts as false, and pretty much anything else (including a card object) counts as true

clear ocean
#

should i add an oops for balancing?

frosty rampart
#

curious why you ban standard packs
anyway another option for balancing would be to give the player a rocket for some bonus econ, it's thematic too

clear ocean