#💻・modding-dev

1 messages · Page 443 of 1

gilded blaze
#

make every Spectral card spawned negative regardless?

wild root
#

Anyone have a mod that adds custom enhancements, that's easy to follow and understand how it's done?

pastel kernel
stiff quiver
#

thank you very much

wild root
pastel kernel
#

why does it make negative spectral cards that take up space

daring fern
gilded blaze
#

it's on wiki, but I'll crop the exact one you need

worthy stirrup
#

@daring fern does SMODS.calculate_effect allow for sounds to be played with it? if not, how could i add sounds to it?

normal crest
#

sound = "sound key"

daring fern
worthy stirrup
#

thank you

#

how do i call for a base game sound, im trying to do the tarot one

daring fern
worthy stirrup
#

thank you

lament agate
#

@daring fern something's wrong with this code

#

it triggers for each cards held in hand

#

instead of

#

the joker itself

#
    config = { extra = {x = 5} },
    calculate = function(self, card, context)
        if context.end_of_round then
            return {
                dollars = G.GAME.dollars * card.ability.extra.x-1,
                message = "HECK.",
                message_card = card
            }
        end
    end
}
daring fern
lament agate
formal parrot
#

:D

#

I was about to say😭

#

I literally just found it lol

#

Thanks somethingcom515

pastel kernel
#
    calculate = function(self, card, context)
        if context.discard and not context.blueprint and not card.ability.extra.discard_triggered then
            card.ability.extra.discard_triggered = true
            local total_created = 0
            G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + card.ability.extra.cards_per_discard
            for _ = 1, card.ability.extra.cards_per_discard do
                local spectral_card = SMODS.add_card({set = "Spectral", area = G.consumeables, edition = "e_negative", key_append = "minos"})
                if spectral_card then
                    G.consumeables:emplace(spectral_card)
                    total_created = total_created + 1
                end
            end

do i write it like this?

manic rune
#

you dont need emplace

#

add_card already handles allat for you

pastel kernel
#

so remove G.consumables altogether?

formal parrot
manic rune
#

remove G.consumeables:emplace(spectral_card), yes

manic rune
#

🥀

formal parrot
#

Btw bepis

pastel kernel
#

and also total_created i guess?

formal parrot
#

I tried making something like

#

Certificate

#

But cards dont show

#

In the deck

manic rune
#

whats the code

#

did you try cross-referencing your code with vanillaremade's

formal parrot
#

Idk not on pc

manic rune
#

oof

manic rune
#

unless you turn on bluetooth i cant help then :3

formal parrot
#

Arrrrr

#

If there like

#

A function im missing ?

#

Like emplace

#

I dont need to emplace them right ?

#

Ohhhhh

#

I got it

#

I was doing a for and

#

I have this outside the for

#

Thanks anyways bepis much love

#

Muah

worthy stirrup
#

How do i put a custom icon for my mod?

gilded blaze
worthy stirrup
#

thank you

#

and thats all i need to set the icon

pastel kernel
#

OH MY G

#

IT WORKS

#

Ok now to add sound

#

since this is a legendary

formal parrot
#

Sound for what

pastel kernel
#

whenever minos gets upgraded, he grunts, whenever he's being used to mult, he goes JUDGEMENT

paper zealot
#

What's the conventionally "correct" size for a mod icon? I've seen both 32x32 and 34x34 used

worthy stirrup
#

why not both

formal parrot
#

How can you

#

Make a card dissolve

#

Like when its destroyed

#

And change its sorite

#

Sprite *

#

I assume draw step and draw shader

lament agate
#

why does my message disappea

#

r

worthy stirrup
lament agate
#

did i send something or not

formal parrot
#

No

lament agate
#

discord fucking tweaking

formal parrot
#

Schizophrenic

lament agate
#

how do i move this little fella

formal parrot
#

🤷

lament agate
#

cooked

formal parrot
#

Ask

#

@minor magnet

lament agate
#

he's offline

#

cooked

formal parrot
#

Or @midnight coyote

snow vale
#

what context should i use to transform cards into a different suit?

formal parrot
#

Depends on what you want after or before scoring

#

Logically after

snow vale
midnight coyote
#

heya

#

what’s going on

formal parrot
midnight coyote
#

ah! the title screen card is just a cardarea

#

not unlike G.jokers or G.hand

daring fern
gilded blaze
#

it's G.title_top btw

formal parrot
#

How can you add a card

#

To it

#

:D

midnight coyote
formal parrot
midnight coyote
#

you can make a card with SMODS.create_card

gilded blaze
#

this is how I add Alice

midnight coyote
#

and then just assign the card object to a variable

lament agate
lament agate
gilded blaze
#

pretty cozy right?

valid leaf
#

Hi anyone knows how to change a sprite of card like when a hand is selected and is being played?

midnight coyote
#

i’m probably about to add a joker to the title screen

formal parrot
lament agate
#

where do you

#

write this

paper zealot
formal parrot
lament agate
lament agate
#

PUT WHERE

formal parrot
#

Main.lua

lament agate
#

thanks

formal parrot
#

Fym where 😭😭

#

Put it in .json 💀 that should work

gilded blaze
#

I put it inside lib/functions.lua
it's super messy there since I store both helper functions and hooks

lament agate
#

get rid of that critters

#

should be good

#

nevermind it crashed

#

HELP

gilded blaze
#

my code above isn't enough
add this too to make the card materialize along with Ace of Spades

daring fern
gilded blaze
#

a hook to Game.main_menu

near bay
#

how to i set the hand counter to a number

daring fern
lament agate
#
-- Materialize the Joker
G.E_MANAGER:add_event(Event({
  trigger = "after",
  delay = 0,
  blockable = false
  blocking = false
  func = function()
    if change_context == "splash" then
        newcard.states.visible = true
        newcard:start_materialize({ G.C.WHITE, G.C.WHITE }, true, 2.5)
    else
        newcard.states.visible = true
        newcard:start_materialize({ G.C.WHITE, G.C.WHITE }, nil, 1.2)
    end
    return true
  end,
}))
#

hold on

gilded blaze
#

that event should also be inside the hook to Game.main_menu

lament agate
#

how do you hook again

#

god i hate hooking

gilded blaze
lament agate
#

im writing this one too

#

hold

worthy stirrup
#

how could i replace the main menu colors and the card in the middle?

daring fern
worthy stirrup
gilded blaze
# worthy stirrup how could i replace the main menu colors and the card in the middle?

to replace the color, do this inside the hook to Game.main_menu:

G.SPLASH_BACK:define_draw_steps({
    {
        shader = "splash",
        send = {
            { name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
            { name = "vort_speed", val = 0.4 },
            { name = "colour_1", ref_table = Sagatro, ref_value = "badge_colour" },
            { name = "colour_2", ref_table = G.C.RARITY, ref_value = 4 },
        },
    },
})

(use your own color by adjusting ref_table and ref_value of colour_1 and colour_2)

worthy stirrup
#

oh my

daring fern
worthy stirrup
#

just to be safe, did i hook correctly?

local oldmenu = Game.main_menu

function Game.main_menu()
    G.SPLASH_BACK:define_draw_steps({
        {
            shader = "splash",
            send = {
                { name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
                { name = "vort_speed", val = 0.4 },
                { name = "colour_1", ref_table = Sagatro, ref_value = "badge_colour" },
                { name = "colour_2", ref_table = G.C.RARITY, ref_value = 4 },
            },
        },
    })
    return oldmenu()
end
lament agate
#
-- Draw your Joker into the Main Menu with hooking
local gmm = Game.main_menu
Game.main_menu = function(change_context)
    local ret = gmm(change_context)

    local selected_card = "j_modprefix_key"
    local newcard = Card(
        G.title_top.T.x,
        G.title_top.T.y,
        G.CARD_W*1.1*1.2,
        G.CARD_H*1.1*1.2,
        G.P_CARDS.empty,
        G.P_CENTERS[selected_card],
        { bypass_discovery_center = true }
    )
    if not Cryptid then
        G.title_top.T.w, = G.title_top_T.w * 1.7675
        G.title_top.T.x, = G.title_top_T.x * 0.8
    end
    G.title_top:emplace(newcard)

    newcard.no_ui = true
    newcard.states.visible = false
    newcard.sticker_run = "NONE" --fuck the stake
daring fern
gilded blaze
lament agate
#

Game.main_menu = function(change_context)

#

instead of

#

function game

near bay
lament agate
worthy stirrup
#

i think so

gilded blaze
#

@near bay yoo, survev tag, nice
I'm an OG survivr (not the current survev game, but rather the kongregate-copyrighted surviv.io)

#

I do return to survev once in a while to clear up the nostalgia

lament agate
#

wait

#

im dumb

worthy stirrup
#

what is a ref_table supposed to look like

#

like the data inside

near bay
#

how do i make a joker destroy itself?

gilded blaze
#

it's the color

daring fern
worthy stirrup
#

i understand but is there data inside of it?

gilded blaze
#

e.g. ref_table = G.C, ref_value = MULT

#

yea

worthy stirrup
#

ohh thats what that means

gilded blaze
#

a table of 4 real numbers ranging from 0 to 1 representing RGBA

worthy stirrup
#

how would i get a custom color in there then

#

or could i just put it in as a hex

#

or like... something

gilded blaze
#

Balatro's source code has HEX function

#

just plug in a hex value (just rgb, don't use rgba)

#

HEX('ff0000')

worthy stirrup
#

should the ref_table still be G.C?

#

or am i misunderstanding

gilded blaze
#

actually, ref_table and ref_value are used for when you're getting the values from a reference table

#

you might want to store your desire color inside a table

tawdry oriole
#

how could you make a consumable to add an edition to a selected card?

gilded blaze
#

something like G.C.YOUR_COLOUR = HEX('ff0000')

worthy stirrup
#

got it

minor magnet
#

tou should be able to move it like any other cardarea

gilded blaze
#
if not Cryptid then
    G.title_top.T.w, = G.title_top_T.w * 1.7675
    G.title_top.T.x, = G.title_top_T.x * 0.8
end
#

this is for when Cryptid is not installed

#

also wait

worthy stirrup
#

G.C.color1 = HEX('ff0000')
G.C.color2 = HEX('4dcc8e')

local oldmenu = Game.main_menu

function Game.main_menu(change_context)
    G.SPLASH_BACK:define_draw_steps({
        {
            shader = "splash",
            send = {
                { name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
                { name = "vort_speed", val = 0.4 },
                { name = "colour_1", ref_table = G.C, ref_value = "Color1" },
                { name = "colour_2", ref_table = G.C, ref_value = "color2" },
            },
        },
    })
    return oldmenu()
end
gilded blaze
#

why is there a comma

worthy stirrup
#

oops, didnt mean to flood the chat

gilded blaze
#

wtf

minor magnet
lament agate
#

ah fuck the numbers

worthy stirrup
#

i copied what you had

lament agate
#

its 71 i promise

split panther
#

how does one create a specific joker

gilded blaze
#
if not Cryptid then
    G.title_top.T.w = G.title_top_T.w * 1.7675
    G.title_top.T.x = G.title_top_T.x * 0.8
end
lament agate
gilded blaze
#

this should have no comma

#

like wtf, I did not put those there

worthy stirrup
#

oh you were talking to them, oops lol

red flower
lament agate
#

but it still crash the eof one

gilded blaze
#

that should also be inside the hook to Game.main_menu

lament agate
#

ah

gilded blaze
#

also install lua extension for VS Code

#

that should help you fix any syntax errors

turbid kite
# lament agate

why would you use a font in your text editor / IDE that isn't monospaced

split panther
gilded blaze
red flower
lament agate
red flower
#

what's the problem now

turbid kite
lament agate
#

my eyes my rules

worthy stirrup
#

1s, let me see if the other guys thing fixes it

tawdry oriole
#

i'm trying to make an "aura" type card but for a specific custom edition, it doesn't seem to work though

red flower
gilded blaze
#

you know what
I give up
downgrades to phone so I respond to errors much slower

pastel kernel
#

Where do I post the original concept art of my spinel joker

turbid kite
worthy stirrup
# gilded blaze ```lua local ret = oldmenu() -- your hook here return ret ```

sorry if i misunderstood, like this?

G.C.color1 = HEX('ff0000')
G.C.color2 = HEX('4dcc8e')
local oldmenu = Game.main_menu
local ret = oldmenu()
function Game.main_menu(change_context)
    G.SPLASH_BACK:define_draw_steps({
        {
            shader = "splash",
            send = {
                { name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
                { name = "vort_speed", val = 0.4 },
                { name = "colour_1", ref_table = G.C, ref_value = "color1" },
                { name = "colour_2", ref_table = G.C, ref_value = "color2" },
            },
        },
    })
    return ret
end
split panther
gilded blaze
#

don't forget the parameter

worthy stirrup
worthy stirrup
gilded blaze
#

no, it's done

primal robin
formal parrot
#

@tawdry oriole check for typo

worthy stirrup
gilded blaze
#

I've seen people using m6x11plus in IDE

lament agate
primal robin
#

Thats crazy

tawdry oriole
gilded blaze
#

I've tried that and honestly it sucked

gilded blaze
#

the font in IDE not being monospace sucks a lot

red flower
# worthy stirrup
G.C.color1 = HEX('ff0000')
G.C.color2 = HEX('4dcc8e')
local oldmenu = Game.main_menu
function Game:main_menu(change_context)
  local ret = oldmenu(self,change_context)  
  G.SPLASH_BACK:define_draw_steps({
        {
            shader = "splash",
            send = {
                { name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
                { name = "vort_speed", val = 0.4 },
                { name = "colour_1", ref_table = G.C, ref_value = "color1" },
                { name = "colour_2", ref_table = G.C, ref_value = "color2" },
            },
        },
    })
    return ret
end

worthy stirrup
#

thank you

formal parrot
#

Try

    key = "anto",
    set = "Tarot",
    loc_txt = {
        name = "Antoine",
        text = {
            "Add {V:1}Balatrirtic{ V:2}edition{ to",
            "{V:2}#1#{ selected card in hand."
        }
    },
    loc_vars = function(self, info_queue, card)
        return {
            vars = {
                card.ability.max_highlighted,
                colours = {
                    G.C.SECONDARY_SET.Spectral,
                    G.C.FILTER,
                }
            }
        }
    end,
    atlas = 'atlas_con',
    pos = {x = 2, y = 0},
    config = { max_highlighted = 1 },
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                local edition = 'e_mucho_balatrirtic'
                local aura_card = G.hand.highlighted[1]
                if aura_card then
                    aura_card:set_edition(edition, true)
                    aura_card:juice_up(0.3, 0.5)
                end
                return true
            end
        }))
        return true
    end
}```
worthy stirrup
#

it works now, thank you guys so much

gilded blaze
formal parrot
#

Freud

tawdry oriole
#

i'll try

formal parrot
#

LMFAO

tawdry oriole
#

😭

formal parrot
#

I just reali

#

Realized

#

Ahahahaha

tawdry oriole
#

shhhh

#

nobody has to know

worthy stirrup
#

now i gotta figure out how to change the card in the menu

chrome widget
#

Throwing my head against the wall trying to figure out NES Dragon's Lair

chrome widget
#

I will finish this joker

worthy stirrup
formal parrot
worthy stirrup
#

thank

tawdry oriole
formal parrot
#

Im gonna die

gilded blaze
worthy stirrup
gilded blaze
#

I'm doing more stuff on my own now

red flower
#

speaking of NES i was gonna mod but im tired so im just gonna play NES games instead

worthy stirrup
#

@lament agate did you get the custom joker on the menu working

red flower
#

eventually, im playing all of them alphabetically :3

worthy stirrup
#

oh

lament agate
#

we're both fucked

worthy stirrup
# lament agate we're both fucked
function Card:resize(mod, force_save)
    self:hard_set_T(self.T.x, self.T.y, self.T.w * mod, self.T.h * mod)
    remove_all(self.children)
    self.children = {}
    self.children.shadow = Moveable(0, 0, 0, 0)
    self:set_sprites(self.config.center, self.base.id and self.config.card)
end

local mainmenuref2 = Game.main_menu
Game.main_menu = function(change_context)

    local ret = mainmenuref2(change_context)

        --Replace j_unik_unik with 'j_perkeo' or any other card
    local newcard = SMODS.create_card({key='j_OAL_HatlessRalsei',area = G.title_top})
    G.title_top.T.w = G.title_top.T.w * 1.7675
    G.title_top.T.x = G.title_top.T.x - 0.8
    G.title_top:emplace(newcard)
    newcard:start_materialize()
    newcard:resize(1.1 * 1.2)
    newcard.no_ui = true
    return ret
end
#

here

#

thank you @stark geode for the code

lament agate
#

to game main menu?

#

oh wait

#

i see

#

thanks @worthy stirrup

red flower
#

pls add a reference to self there

#

idk what cryptid is doing but pls dont break other mods

near bay
#

how does the game detect if you have lost or not.

red flower
#

what do you need it for?

lament agate
red flower
near bay
tawdry oriole
red flower
near bay
#

actually wait i code check his code oops

worthy stirrup
astral sun
#

i can't figure out how to make a joker have an effect for when the hand is on fire, does someone here know ?

worthy stirrup
#

i just, use the two togetjer

red flower
manic rune
#

is there a built in function for when you right click on a button (or just ui in general)

turbid kite
red flower
tawdry oriole
#

oh my god

tawdry oriole
#

i am stupid

manic rune
#

gh

#

guess i have to code it in then

red flower
#

i hook the right click controller function for jokerdisplay

manic rune
#

do i use love function for this

#

oh

red flower
#

function Controller:queue_R_cursor_press(x, y)

manic rune
#

i see

lament agate
#

which res does modicon use again

manic rune
#

34x34, i think

worthy stirrup
#

34 if you want to use the tag base

lament agate
#

does someone have

#

blank tag

#

i can use

worthy stirrup
#

i can get one

lament agate
#

would be nice

worthy stirrup
lament agate
#

thanks

pastel kernel
#

so i just got rid of a specific code which limits my discards to give only 2 negative spectrals every discard, BUT it conflicts with retrigger jokers.

firstly, how do you make it so that you get 2 spectral cards every discard?
secondly, i might keep this as an unnerfed version.

lament agate
#

modicon also needs 1x?

red flower
#

afaik, yes

lament agate
red flower
#

crazy

lament agate
#

idk what caused that

#

im keeping it

worthy stirrup
#

just to be safe, am i grabbing the ID correctly?
if context.other_card:is_suit('Hearts') and context.other_card.id == 18 then

#

i just realized i put 18

#

instead of 8

red flower
#

:get_id()

worthy stirrup
#

oh

#

one last question, how can i get a card to retrigger 4 times

red flower
#

return repetitions = 4 in context.repetition

formal parrot
#

N coding

red flower
#

encoding

worthy stirrup
#

thank you

formal parrot
#

:P

#

4 times is a lot no?

worthy stirrup
#

i changed it to 3 just now

normal dune
formal parrot
#

Mhm understandable

worthy stirrup
#
    calculate = function(self, card, context)
        if context.repetition and context.cardarea == G.play then
            if context.other_card:is_suit('Hearts') and context.other_card:get_id() == 8 then
                return {
                    repetitions = 3
                }
            end
        end
    end,
formal parrot
#

Looks good

normal dune
#

the line 196 is the line 75

formal parrot
#

You been modding for a while flote

#

Take a rest

worthy stirrup
#

ive got one joker left to do

red flower
normal dune
#

i have to remove that?

red flower
#

yes

#

youre also missing an end,

normal dune
red flower
#

what editor are you using

normal dune
#

notepad++

hidden sable
native zinc
#

uh oh.

red flower
hidden sable
normal dune
hidden sable
normal dune
#

line 145 'if bonus > 0 then return bonus end,'

red flower
red flower
# normal dune

the end was fine there, but you also needed a end, below that

native zinc
north lodge
# hidden sable i use notepad++ it works just fine

it works fine yes, but you get A LOT less information that VSCode would give you and it would make solving basic syntax errors infinitely easier. Not to mention the incredible search features and flexibility that vscode gives.

worthy stirrup
#

how could i check how many hearts my full deck has?

summer creek
#

how do i make my jokers go past the vanilla cap? eg more than E401 mult

native zinc
red flower
worthy stirrup
summer creek
north lodge
red flower
native zinc
#

ughhh yeah

#

how do i do that again

red flower
#

card:remove()

native zinc
#

i should uhhh

#

hm

red flower
#

what's the name of the function again

native zinc
#

yeah i got no clue i probably need to change a value

red flower
#

you probably need to emplace it and add the shop ui

native zinc
#

it's create_card_for_shop in UI_definitions

#

oh i see what is wrong

#

i need to actually create the card,,

#

i'll do it tmrw

formal parrot
#

Hey

#

What’s the key for hologram shader

tired kestrel
#

testing that one website called: "book of shaders" and...

#

apperently they don't take this clearly

formal parrot
formal parrot
#

Much love

wintry swallow
#

is it possible to apply a different color to description text? (like gray or other colors)

formal parrot
#

Yes

wintry swallow
#

thankies

formal parrot
#
  colours = { HEX('FF00FF') }
}```
#

{V:1}your text{}

wintry swallow
formal parrot
#

♥️

steep pond
#

anyone here have a Mac and want to help me try out something on it? I am trying to see if I can get my version of the brainstorm mod "Brainstorm-Rerolled" working on a mac

coarse plank
#

how would I make a consumable that would give chips to next played hand?

tawdry oriole
#

is there a simplified tool to create custom shaders?

sonic cedar
#

can anyone explain how blueprint_effect works? like the details? cause i cant seem to get it working,,

gleaming yew
#

is it easy to make a tarot card that changes the rank AND suit of a card to a random available rank and suit (including modded ones)?

sonic cedar
sonic cedar
#

do note those go by the entire hand, so you'll have to do some tinkering

main minnow
#

trying to make a joker with the effect "glass kings never shatter" - seemingly the function that handles glass breaking is in state_events.lua but i have no idea how to access or manipulate that

faint yacht
#

...you should be able to hook G.P_CENTERS['m_glass'].calculate and do your thing there.

sonic cedar
#

"can should"

faint yacht
#

-# shan.

sonic cedar
#

-# chould

faint yacht
#

-# my cognitive functions are deterioating. :)

sonic cedar
#

-# twinning and it's like the afternoon 😭

north lodge
#

I once again am calling upon anyone who feels confident with UI stuff to try and assist me with the problem I am struggling with at the moment.

hard mica
#

so i got a joker that does different effects every ante , and i wanna add +2 hands but im not sure how, i tried it like that but it just keeps adding to the hands for some reason

worthy stirrup
#

might not be the right size

#

71 x 95 for a single joker

#

142 x 190 for the x2 version

late shadow
#

does anyone know how to add custom sound effects to scoring?,
what im trying to do is have a sound effect play on each retrigger that a certain joker does

idle plaza
hard mica
wind steppe
#

how do i get it to show x1 instead of xnil

late shadow
#

can you show the local var?

#

wait im stupid

#

i mean, show the local text, config, and local variables

#

depends if the way u code jokers differs to me tho

wind steppe
#

madness isnt my joker

#

its vanilla

late shadow
#

ohh

#

awesome fucking deck concept btw LOL

wind steppe
#

whats weird is x0.5 is still there

#

but x1 isnt

late shadow
#

0.5 is a flat value that doesnt change

wind steppe
#

fair enough

#

wait what if i just copy the vanillaremade code and take ownership of madness

late shadow
#

the x1 is subject to change, so thats why
tho im not sure what u could do about that, besides just making a duplicate of the joker to show that joker's bio/stats instead, and just replace the xnil into x0

#

the "fake" madness would jsut be serve as that visual thing

daring fern
late shadow
#

ah that makes more sense then

daring fern
#

{key = "j_madness", set = "Joker", config = {}}

wind steppe
#

its the hoverable text

#

it shows up like this cause i have galdur

late shadow
daring fern
# wind steppe

You would probably make your own localization entry then.

wind steppe
daring fern
# wind steppe how would i do that?
j_madness_fixed={
    name="Madness",
    text={
        "When {C:attention}Small Blind{} or {C:attention}Big Blind{}",
        "is selected, gain {X:mult,C:white} X0.5 {} Mult",
        "and {C:attention}destroy{} a random Joker",
        "{C:inactive}(Currently {X:mult,C:white} X1 {C:inactive} Mult)",
    },
},
hard mica
idle plaza
late shadow
daring fern
late shadow
#

should i show the code for the joker or is that not needed

daring fern
late shadow
#

yes

#

it retriggers played hearts twice

daring fern
late shadow
#

ooh ty

#

i will try

#

it works!!!

#

the other thing thats needed for the joker is that the texture changes every time it retriggers, would i just o something like "texture = _" ?

sturdy compass
#

That’s a lot more tricky lol

daring fern
late shadow
#

brb

nova eagle
#

although i think we have it simplified so that it only needs the 2x

#

but we are using 142x190 for each joker

sturdy compass
#

That’s not a big problem, I do that too lol

vast bough
#

does anybody have any examples of jokers that have two different outcomes with different probabilities attached to them? like 1/4 chance to give +20 mult 1/20 chance to give +500 chips, that kinda thing. basically lucky card but joker code

nova eagle
#

actually i think cryptid has battle bus, which has a chance at +50 mult, or -50 mult instead

vast bough
#

thank you both, i had a look at the vanilla remade for lucky but i was wondering how it would look for specifically jokers, i will check out the d6 joker and battle bus i appreciate it

daring fern
vast bough
# daring fern You would change `context.main_scoring and context.cardarea == G.play` to the co...

yeah, it has to be super generic code lol because its for jokerforge haha. currently the random chance modifier you can add to effects is a bit broken because it does not factor in more than one effect to the random chance. need to figure out a way to gather each effect, along with their associated random chance, and execute them basically one after another while also taking into consideration that effects with the same random chance should be grouped together

late shadow
daring fern
#

You can animate things though.

late shadow
#

oh ok thats fine then

#

i can do that

#

yup dude 😭

vast bough
#

wow im definitely clicking on that

late shadow
#

GUYS! FREE BALATRO!

#

ok so how would i go about doing the animated part

#

im not sure how itd exactly work, i can imagine how to do it for 1 frame but not for a full animation

late shadow
#

ahhhh tysm

modern kindle
#

<@&1133519078540185692> kill him

#

Shoot him dead

#

Thank you whichever of you shot him

#

My goat fr

karmic creek
#

u got it

stoic fulcrum
#

is there a variant of G.hand.cards[i].base.nominal that counts the base chips a card gives with bonuses included? (for example, hiker, foil, stone or bonus)
if so, how would i go about using it

#

trying to make a joker that adds the value of all chips of the cards held in hand

#

so for example if you have 5 king foils held in hand then you get +60 chips for each(foil 50 + base value 10)

daring fern
wheat jewel
#

I'm trying to make a joker create a random skip tag with a lovely path but i'm getting consistent crashes

#

how do I fix this?

daring fern
#

Why does the set_ability completely break Balatro and almost crash my computer?

stoic fulcrum
hidden sable
#

how can i turn

local card_to_destroy = pseudorandom_element(G.jokers.cards, 'random_destroy')
        SMODS.calculate_effect({message = "Cleansed"}, card_to_destroy)
        delay(.3)
        SMODS.destroy_cards(card_to_destroy)    
        delay(.7)
        G.GAME.blind:disable()

into a function that is like destroy_random_joker(1) and also checks for eternal stickers

stoic fulcrum
hidden sable
#

minus the effect

hidden sable
#

and disable blind

daring fern
#

On the code I gave you.

hidden sable
#
local card_to_destroy = pseudorandom_element(G.jokers.cards, 'random_destroy')
SMODS.destroy_cards(card_to_destroy)    

basically jsut this

hidden sable
#

but checks for eternal seal

#

not my question

hidden sable
stoic fulcrum
daring fern
wheat jewel
#

i assume it's trying to get a tag through some UI check but idk

stoic fulcrum
#

also bump to this
genuinely no idea why this doesn't work with blueprint

wheat jewel
#

what would be the best way to generate a random tag

#

cuz my joker crashes when trying generating a planet card upgrade tag cuz the game doesn't know what hand the tag is allocated to

#

atleast thats what someone playtesting my mod said

daring fern
hidden sable
#

how do i check if a joker has an eternal sticker

daring fern
wheat jewel
snow vale
#

how can i edit the sell value?

daring fern
snow vale
daring fern
royal ridge
#

card:set_cost() will override any changes

daring fern
snow vale
daring fern
royal ridge
#

that yeah

snow vale
#

ok ill try

hidden sable
#

my logic checks out right?

function destroy_random_joker(count) -- Helper for some cards
    local jokers_to_pwn = {}
    for 1, count do
        for _, joker in ipairs(G.jokers.cards) do
            if not joker.ability.eternal then
                jokers_to_pwn[#jokers_to_pwn+1] = joker
            end
        end
        local card_to_destroy = pseudorandom_element(G.jokers.cards, 'random_destroy')
        SMODS.destroy_cards(card_to_destroy) 
    end
end
daring fern
wheat jewel
daring fern
daring fern
hidden sable
#

everything else is fine right

daring fern
thorn basin
#

I wanted to display in the message the value of the chip_mod but for some reason it doesn't display it.
(it displays "#2#" instead)
how can I fix this?

daring fern
hidden sable
#

how can i modify this check

return G.jokers and #G.jokers.cards > 0 and #G.jokers.cards < G.jokers.config.card_limit and G.GAME.blind.boss

to count jokers with eternal as "invisible"

#

like there has to be at least 1 non eternal joker

hidden sable
wheat jewel
# daring fern Yes.

it works fine for other tages but orbital tags cause a crash due to not knowing what hand to upgrade

thorn basin
daring fern
hidden sable
thorn basin
#

ooooh

thorn basin
#

thx for the help!

faint yacht
snow vale
daring fern
snow vale
#

ok

wheat jewel
#

like set the orbital hand to a psuedoseed of random poker hands or smthn?

#

if thats the case how would that look code-wise?

faint yacht
#

...I think just calling :set_ability() on it could work, due to

function Tag:set_ability()
    local obj = SMODS.Tags[self.key]
    local res
    if obj and obj.set_ability and type(obj.set_ability) == 'function' then
        obj:set_ability(self)
    end
    if self.name == 'Orbital Tag' then
        if G.orbital_hand then 
            self.ability.orbital_hand = G.orbital_hand
        elseif self.ability.blind_type then
            if G.GAME.orbital_choices and G.GAME.orbital_choices[G.GAME.round_resets.ante][self.ability.blind_type] then
                self.ability.orbital_hand = G.GAME.orbital_choices[G.GAME.round_resets.ante][self.ability.blind_type]
            end
        end
    end
end
wheat jewel
faint yacht
#

You need to "add" the tag itself first... but also reference it for :set_ability()

coarse plank
#

is there a context for a lucky card not triggering?

daring fern
wind steppe
#

whats the key for space joker?

daring fern
faint yacht
# wheat jewel like this?

...you are not meant to just flatly copy what I posted-- instead, you could probably set a local variable to the randomly selected Tag, then add_tag it and call :set_ability() on the variable?

gleaming yew
#

How do I get the code for something in basegame?

wind steppe
#

why does space joker still work?

#

its meant to do nothing

red flower
#

try returning nil, true

gleaming yew
snow vale
#

ok this aint working :(

daring fern
#

It doesn't take parameters.

snow vale
#

oh

#

then ig this is wrong

daring fern
snow vale
#

yay

#

then uh

#

how can i make it work

daring fern
# snow vale how can i make it work
local oldsetcost = Card.set_cost
function Card:set_cost()
    local g = oldsetcost(self)
    if self.config.center.key == "j_modprefix_key" then self.sell_cost = number end
    return g
end
snow vale
#

wait a sec, so in the hook do i have i have to customise each joker that interacts with that hook?

snow vale
#

i mean for this

daring fern
snow vale
#

yeah that's what i mean

#

also, how can i make so the joker i create after selling has different sell values?

#

so it costs more to sell every time you sell it

daring fern
snow vale
#

ok

stoic fulcrum
#

is there a way to manipulate booster pack rng?
i'm trying to make a joker that makes buffoon packs free, but they can only pull common jokers

stoic fulcrum
#

how would i go about doing that, can't find a good mod to reference

tawdry oriole
#

sigma

modern schooner
#

Hello guys hope I am not bothering you but I have bug with my balatro mod here is the error file can someone help me ?

wheat jewel
#

Someone earlier told me to make a function that sets the orbital tag poker hand to prevent a crash but the tag still displays as "Upgrade [poker hand] by 3 levels" and crashes afterward

#

should i set the function to happen before adding the tag?

chrome widget
daring fern
wheat jewel
#

makes sense

#

i'll test it rn

daring fern
# wheat jewel

Remove the Tag:set_ability function you're overwriting.

wheat jewel
#

Why should I do that?

daring fern
wheat jewel
#

So what should I do to prevent orbital tag from crashing my game then when spawned by my joker?

tardy juniper
#

is there a way to detect if any joker at all has been triggered?

wheat jewel
#

Nope

#

still displays "Upgrade [poker hand] by 3 levels" then crashes when being used

#

idk what to do

tardy juniper
daring fern
snow vale
#

what could this crash mean?

daring fern
snow vale
#

i see

#

so, is there sth wrong here?

daring fern
snow vale
#

yeah

tardy juniper
daring fern
tardy juniper
#

huh...

thorn basin
#

Question: how can I make the sound's pitch be not modified?
Cuz for some reason if you add a preset or custom sound the game automatically lowers that sound.

daring fern
thorn basin
#

oh, now you edited the message

thorn basin
mild grove
#

does anyone know the if G.GAME.Big_Blind is real or no?

#

reason why the orbital tag isn't set to spawn after defeating the boss blind is because the game crash, so i'm trying to figure out how to set it to either big blinds or small blinds

wheat jewel
mild grove
mild grove
viral ember
#

so I have this in my challenge which loads but the 10s are blank?

            -- 10s
            { s = 'balalalatro_B', r = '10' }, { s = 'balalalatro_B', r = '10' }, { s = 'balalalatro_B', r = '10' }, { s = 'balalalatro_B', r = '10' },
            -- Jacks
            { s = 'balalalatro_B', r = 'J' }, { s = 'balalalatro_B', r = 'J' }, { s = 'balalalatro_B', r = 'J' }, { s = 'balalalatro_B', r = 'J' },
            -- Queens
            { s = 'balalalatro_B', r = 'Q' }, { s = 'balalalatro_B', r = 'Q' }, { s = 'balalalatro_B', r = 'Q' }, { s = 'balalalatro_B', r = 'Q' },
            -- Kings
            { s = 'balalalatro_B', r = 'K' }, { s = 'balalalatro_B', r = 'K' }, { s = 'balalalatro_B', r = 'K' }, { s = 'balalalatro_B', r = 'K' },

#

(wasn't able to send the full thing due to discord sucking)

lament agate
#

how do you detect how many jokers are in your slots?

viral ember
#

look at stencil joker

hasty mist
#

how would i apply a scored_card.ability attribute to a joker using a sticker

daring fern
viral ember
daring fern
viral ember
#

10 IS VALID, 0 IS VALID, HELL EVEN 1 WOULD'VE BEEN VAILD, BUT T????
anyways thanks!

mild grove
wheat jewel
#

Nevermind my bad

wheat jewel
# wheat jewel

Does anyone know how to prevent orbital tags from crashing?

#

Maybe i could make set_ability to a new name to not overwrite set_ability

#

i guess??

daring fern
#

Because that is literally what the function does.

#

Look at tag.lua in the lovely dump.

wheat jewel
#

I see

#

so how do i make sure the orbital tag doesn't mess up and crash

#

Do i just do this?

wooden nexus
#

Also try T, i may be wrong

viral ember
#

I

wild root
#

Does anyone know, how to change the enhancement of a card "after" it scored, 'couse in my code it changes visualy just after playing it (before it scores), but functionaly as it should (after scoring), is there any way to stop the visual change of a card or smth?

wild root
#

Change the enhancement visually still in hand, like golden mask, but my custom enhancement itself changes into other one

#

without jokers

errant fulcrum
#

Where's the documentation on take_ownership?

mild grove
#

Damn, it still crashes, even when making it spawn on a small blind, a big blind and a boss blind

daring fern
mild grove
#

the orbital tag, just doesn't like being spawned by a joker

daring fern
#

You have to set_ability it.

lucid owl
#

when a joker is added or removed from the deck, how could i loop through all cards... in general in order to call :set_cost() on them?

#

all sellable cards need to have their sell cost recalculated

mild grove
nova eagle
#

is there anywhere i can look through balatro's vanilla source code?

daring fern
mild grove
nova eagle
#

do i need 7zip? or will winrar work?

daring fern
nova eagle
#

ok cool, thanks

lucid owl
lament agate
#

how do you apply discount for shops

#

if you have a joker

#

that does that

lucid owl
#

what does it do specifically?

#

you'll probably need to patch Card:set_cost(), that's what all of my shop-related jokers do

lament agate
#

it just halves the shop prices, just like clearance or liquidation

daring fern
lucid owl
wheat jewel
thorn furnace
#

Chat I need yalls opinions as programmers
Which do u prefer, sorting everything into its own file or writing everything in one single file

#

I see the second one done a lot and I don't get it

lament agate
lucid owl
#

an entire huge file is awful

hasty mist
#

one single file imo is horrible practice

mild grove
#

Is this how i use set_ability ?

north swallow
#

scrolling all the time

mild grove
#

just want to stop the Orbitial tag from crashing the game

hasty mist
#

i just do this

north swallow
thorn furnace
hasty mist
#

this is probably the neatest part of my code

hasty mist
#

since this mod is my first ever coding practice theres some horrifying stuff in my code

hasty mist
#

like this

thorn furnace
#

tru

north swallow
#

my code is just a giant house of cards waiting to come crashing down if i dare to modify it

thorn furnace
#

Ive had to refactor my code like three times

#

just getting used to lua

north swallow
hasty mist
#

LOL

north swallow
#

if it aint broke dont fix it

thorn furnace
#

tbf that's how it's done when it's interpreted

north swallow
hasty mist
#

theres also this shit in my game.start_run hook

#

not proud of this one

#

but setting it to 0 just didnt work

#

😭

north swallow
thorn furnace
#

i need to test something

north swallow
#

peak code

thorn furnace
hasty mist
#

what is overloading

thorn furnace
urban wasp
#

i would like it to display "Exotic 2" then the joker it is a sidegrade of

daring fern
hasty mist
urban wasp
#

would this be too complicated

thorn furnace
daring fern
urban wasp
#

damn i'll think about doing that later then

north swallow
#

i have defined local xscale and yscale over like 300 times and i still havent bothered to add a global to do it

thorn furnace
# hasty mist 😭

it's basically just the ability to define what the different operators mean for different types
So like with bignum for example, you're not stuck doing a.add(b) instead of a + b

mild grove
#

I need some help stopping the Orbitial Tag from crashing the game after being spawned when defeated ANY BLIND, weather i set it to Boss, Big or Small.

i have no clue how to use set_ability

hasty mist
#

im currently working on this but its having some issues

thorn furnace
#

this seems like it'd need a patch to the scoring function

daring fern
hasty mist
#

firstly i dont know how to actually apply the sticker to a joker, secondly i actually have the hook i need for it, but i dont know how to actually trigger it using this code

hasty mist
thorn furnace
hasty mist
#

just a bit stuck on some stuff

daring fern
daring fern
mild grove
#

okay, it seems like some of the Tag jokers might crash the game

#

so i need to find who crashes and who is safe

daring fern
hasty mist
daring fern
hasty mist
#

as you can see, the hook is supposed to trigger if scored_card.ability.ast_semiconductor

daring fern
tawdry oriole
#

any clues why this happens? my atlas is defined normally as per literally any other atlas i've done

hasty mist
daring fern
wheat jewel
#

Trying to make sure orbital tag actually works when generating a random skip tag but I have no clue how to prevent it from crashing because it doesn't give orbital tag a specific hand to upgrade

daring fern
#

Also it still wouldn't trigger on playing cards?

north swallow
pure salmon
#

is this correct for talisman?

hasty mist
daring fern
daring fern
pure salmon
#

does that round it to an integer?

daring fern
pure salmon
#

oh i see

wheat jewel
idle plaza
errant fulcrum
#

How can I make it so that buffoon packs only spawn modded jokers? I'm using SMODS.Booster:take_ownership_by_kind but I'm not sure what arguments to use for in_pool

daring fern
hasty mist
#

having some trouble applying a sticker, what else do i need in addition to this?

daring fern
#

How does one fix a card from moving when selected when set_ability is being used on it often?

red flower
hasty mist
daring fern
hasty mist
#

no thats the key for the sticker

red flower
hasty mist
#

its to differentiate from the consumable of the same name

hasty mist
hasty mist
#

hm

errant fulcrum
#

Its not in the MoreFluff.lua

real night
#

basically i wanna make a joker that gives the base chips and mult of flush

hasty mist
north swallow
#

how would i make it so the description shows the next card to be drawn?

#

(as this just shows an ERROR in the description)

daring fern
daring fern
mild grove
#

well, I found the Tag Jokers that crashed the gane

real night
daring fern
north swallow
#

something like mult_mod = G.GAME.hands["Flush"].mult

real night
daring fern
#

mult = G.GAME.hands["Flush"].mult

north swallow
#

mult_mod and mult do the same though

#

personal preference

daring fern
#

mult does.

north swallow
#

oh wow

#

didnt know that

real night
#

isnt mult_mod for scaling stuff

daring fern
mild grove
#

No clue why the Orbitial tag and the Standerd Tag crashes the game. After being spawned when Boss blind is defeated.

pure salmon
#

how do i set the starting deck size for jokers like erosion?

daring fern
#

Is there a way to make using Card:set_ability multiple times every time something is calculated be less lag inducing?

unborn bay
#

why do you need to call set_ability anyway

daring fern
#

Is there a better way?

uncut cloud
#

alright hello people
im trying to make a card enhancement that copies the card played before it
does anyone know what im doing wrong here that im not noticing? its pretty late for me and i may be missing something

daring fern
red flower
#

also change_base takes rank keys not IDs

uncut cloud
#

ah

#

thanks a lot

wheat jewel
#

How can i make orbital tags work properly when making a random skip tag, cuz i'm getting crashes because the game doesn't know what hand to assign when the joker generates an orbital tag

red flower
#

i sent u a link : (

nova eagle
#

I'm planning on making a debug console... and i just have a couple of questions. is it possible to spawn jokers with their name, not their key? i want the console to be compatible with all mods, and have no clue if you'd need the key to know which joker to spawn

nova eagle
unkempt thicket
#

Anyone know how to rescale a soul sprite? It's not scaling with the rest of the card.

nova eagle
#

i was not... i'll check them out and see if they have everything i'm looking for

#

thank you

paper zealot
#

DebugPlus is especially well-made with a bunch of neat additional features, it's basically a must-have for mod development imo

hallow forge
#

WOAH

#

oh dang

#

that was fast

unkempt thicket
#

-# Quickdraw

gaunt phoenix
#

Does anyone have an idea of why it's crashing ?

#

(crashing on discard)

idle plaza
subtle merlin
#

How can i detec how many hands were played this round?

gaunt phoenix
gaunt phoenix
idle plaza
#

G.GAME.current_round.hands_played

subtle merlin
#

ty!

meager summit
#

Hello there! Might be a stupid question but is there any good documentation of Balatro modding somewhere?

subtle merlin
errant fulcrum
#

Could someone point out why this isn't stopping jokers from showing up in buffoon packs?

{
    in_pool = function(self,args)
        for i,v in ipairs(vanilla_jokers) do
        if v == self.key then
        return { false }
        end
    end
end
}
)```
daring fern
sweet pelican
#

Hi, I seem to have messed something up and it keeps crashing and telling me it expects a } at the "card.ability.extra.chips =..." line, is there some formatting error I made?

sweet pelican
daring fern
sweet pelican
#

😭

idle plaza
daring fern
#

Also you are ending the if before else

daring fern
sweet pelican
#

okay so it's definitely a lot closer now, but it doesnt seem to be triggering under any context (the 1 in 1 chance is for testing), nor showing the "drunk" or "sober" messages, any insight would be very appreciated! balatrojoker

red flower
#

you're returning in joker_main before it can reach that statement

sweet pelican
#

(I should clearify it does trigger the xmult, just not the scaling aspect)

#

yeah I tried combining the two context.joker_main but it gave me some error about it expecting an "end" after the chip _mod is returned

#

maybe I just didnt do it right

#

I'll try again

daring fern
sweet pelican
#

ohhhhh

#

that makes sense

#

so nest it all in the return?

daring fern
sweet pelican
#

gotchaaaa

#

tysm :)

formal parrot
modern kindle
#

factory in balatro when

formal parrot
#

So

#

If 5! Would it be

#

Your mult x5x4x3x2 or mult + 5x4x3x2

sweet pelican
#

factorio in balatro when

hallow forge
#

Mult!

formal parrot
modern kindle
#

hey math guy, quick
whats 3 plus 7

hallow forge
#

99

modern kindle
#

damn hes good

hidden sable
#

can_use = function(self, card)
return G.GAME.blind
end,

this would only work if you are in a blind right?

daring fern
hidden sable
#

k

#

how do i give hands and discards

#

like temporary hands and disards

daring fern
hidden sable
#

math.random?

daring fern
daring fern
hidden sable
daring fern
hidden sable
#

can i put the games current seed in there and it would work as i would think it would?

daring fern
#

Just put any string.

#

Except that.

gilded blaze
#

put an identifier string

#

something tied to the object

#

example: if joker's 4 mult is by chance, you use joker_mult

hidden sable
#

what if all my pseudorandoms use the same string?

#

would they all act the same chance wise?

#

like the randomness can be predicted

daring fern
#

Then it will change the next time any of them trigger.

hidden sable
#

i wouldnt do that but i was jsut curious

#

is hand size calculated the same way hands and discards are

#

like temp

daring fern
#

Hand size changes are permanent.

hidden sable
#

ah

#

is there a way to force like say 3 cards to draw even if it goes over your hand size

nova eagle
#

so me and someone teamed up and started merging our mods.... and im having trouble figuring things out

#

his copy seems to work, but mine doesnt

#

wtf is Breaker.mod.path and why is it breaking things?

thorn bough
#

Somebody please tell me if I can detect playing card destructions the same way I can track consumable destructions

#

(relevant line at --hook)

errant fulcrum
#
{
    weight = 0
}, true
)```
Tell me why this shouldn't work
daring fern
modern kindle
#

what is that solution

daring fern
modern kindle
#

how significant of lag were you seeing perf wise?

like from 200 to 30 frames or what we talkin

daring fern
hidden sable
modern kindle
daring fern
hidden sable
#

how can i detect when a playing card hand is displayed on screen, like either being in a blind or in a booster pack

hidden sable
errant fulcrum
#

I'm going to tweak out why is it so difficult to change buffoon packs

hidden sable
#

if not its fine