#💻・modding-dev

1 messages · Page 669 of 1

slim ferry
#

You should just return xchips without the message fyi

#

That does the message automatically

fallen timber
slim ferry
#

Also you shouldnt return the xchips in context.destroy_card since thats after scoring

fallen timber
slim ferry
#

SMODS.destroy_cards(context.other_card) in context.individual

timid zinc
#

is there a way to "force" a card being held (e.g. by the cursor) to be unheld

fallen timber
red flower
fallen timber
red flower
#

then full_hand should work fine

fallen timber
#

it sometimes give me an error, and sometimes burns cards in main hand

red flower
#

do you have any other mods

fallen timber
red flower
#

i would try without yahimod and cryptid to see if it does the same

fallen timber
#

k sure

red flower
#

it should always exist

#

also btw a couple of things in that code could be written with newer methods

#

for the return you can just return xchips
card_eval_status_text can be SMODS.calculate_effect({message = "message"}, card)
the pseudorandom check should use SMODS.pseudorandom_probability instead

fallen timber
red flower
#

ah wait

#

i see why

fallen timber
red flower
red flower
fallen timber
red flower
#

then add context.cardarea == G.play to the context check, this will solve the full hand issue too

fallen timber
#

mhm, noted

hidden aspen
# timid zinc is there a way to "force" a card being held (e.g. by the cursor) to be unheld

https://github.com/nh6574/VanillaRemade/blob/f1cc39c18475a3aa866817d579caefb6a53dca40/src/blinds.lua#L749

im guessing it would be like the cerulian bell blind?

i wasn't able to test it, but i bet that
forced_card.ability.forced_selection = true disables highlighting, so it can force deselection if its not highlighted through code (not sure though)
and use G.hand:remove_from_highlighted(card, true) to force unhighlight. may be enough to do it once like in the Cerulian Bell blind, may call it in some calculate

GitHub

Contribute to nh6574/VanillaRemade development by creating an account on GitHub.

timid zinc
#

Ah

fallen timber
# red flower https://github.com/Steamodded/smods/wiki/Calculate-Functions#using-probability

Uhh, is this supposed to happen?
main.lua:2438: [SMODS _ "src/utils.lua"]:2722: attempt to perform arithmetic on local 'denominator' (a nil value)
i use it in only 2 lines, in loc_vars: local num, denom = SMODS.get_probability_vars(card, card.ability.extra.numerator, card.ability.extra.denominator)
and calculate: if ... and SMODS.pseudorandom_probability(card, '1ue999', card.ability.extra.numerator, card.ability.extra.denominator) then

red flower
fallen timber
red flower
#

you dont

fallen timber
#

ohh i typod it

#

i feel stupid

timid zinc
red flower
#

idk if it works

#

idk how to detect the card dragged either

red flower
timid zinc
#

Incredible

#

Never would've known

hidden aspen
#

in the first video i apply a blue deck but dont get an extra hand

#

and in the second video i apply nebula deck, only get the voucher and dont reduce my consumable slot amount

red flower
#

some decks change the starting_params and most of them are only applied at the start of run

#

like blue deck hands

hidden aspen
#

oh.

#

here in vremade both voucher and consumable slots are in config, for me its wierd that its doing one half but not the other? or is it because vremade isnt replicating original code 1 to 1 here

red flower
#

vremade doesnt always recreate code 1 to 1 but in this case it is exactly how its done in vanilla

#

but i dont see why both being in the config means anything, they might be applied in different ways

hidden aspen
#

i guess

#

i can try to replicate apply of discards and whatnots

red flower
fallen timber
# slim ferry You should just return `xchips` without the `message` fyi

apparently it doesnt?
return { Xchip_mod = card.ability.extra.xchip } and return { Xchip_mod = card.ability.extra.xchip, colour = G.C.CHIPS } doesnt do anything (no message nor chips)
but return { Xchip_mod = card.ability.extra.xchip, colour = G.C.CHIPS, message="a" } displays "a" and applies chips

red flower
#

xchips

#

not Xchip_mod

hidden aspen
red flower
#

Game:start_run

fallen timber
red flower
fallen timber
red flower
#

Xmult_mod will also not have a message
xmult (literal) will

fallen timber
#

k thank

red flower
#

also xchips accepts less variations so just Xchips doesnt work i think

#

xchips lowercase does

fallen timber
#

btw is SMODS.calculate_effect just return {} without ending the code?

red flower
#

yes

fallen timber
#

so i can add xchips to it, noted

red flower
#

yeah, although its not recommended for compatibility with other effects

#

like, post_trigger wont detect the xchips that way

fallen timber
#

i just shorten one of my joker's code like 3 times as much lol

fallen timber
red flower
#

if next(SMODS.find_card("key")) then
i wouldnt say more optimixed because it basically just does that but its nicer

fallen timber
#

goofy autocorrect

fallen timber
#

it appears it returns true or smth

red flower
#

SMODS.find_card returns a table of all the jokers

#

so SMODS.find_card("key")[1]

fallen timber
#

the main.lua:2438: functions/common_events.lua:919: attempt to index local 'card' (a number value)

red flower
#

pls post the full log

fallen timber
wintry solar
hidden aspen
# red flower

my game.lua file was somehow deleted so i couldnt find this ICANT

fallen timber
#

Is there any way to "simulate" using a tarot/planet card (without it actually doing anything)? For example right before poker hand is played on my new blind?

slim ferry
#

wdym by simulate using a card

#

like calculating joker effects for using a consumable and stuff?

#

whats the point of manually changing G.GAME.round_resets.blind_ante alongside using ease_ante

red flower
#

iirc blinds dont update score correctly if you dont

#

in the select menu

slim ferry
#

i see

fallen timber
slim ferry
#

copy all the animation stuff from G.FUNCS.use_card probably

#

well all of it thats relevant for using a consumable

#

which is just this because everything after is for other button functionality

acoustic drum
#

dumb question, how do I change my mod's icon?

fading rivet
acoustic drum
fading rivet
#

same dimensions as a tag

fickle gust
#

hey, small question here, what's the sandbox?
i've been digging through balatro's code and found a sandbox stage, is it just something from the game that has been renamed since then or is it cut content?
-# (i've just started learning lua, but from my understanding there seems to be a whole UI coded for it as well as a maybe button to spawn and remove jokers with various editions)

slim ferry
#

It definitely seems like a whole unused sandbox

#

Considering the spawn joker button and edition option cycle

fickle gust
#

damn that's really interesting

slim ferry
#

Ive never seen this before though

#

Pretty cool

fickle gust
#

is there anyway i could force the game to switch to stage 3 with a mod?

fickle gust
slim ferry
#

I wonder how possible it would be to restore it tbh

fallen timber
#

Is there any way to add something to event queue? i want to make a consumable that gives chips for next played hand (not right away but as soon as hand is played)

fickle gust
#

I think G.STAGE = G.STAGES.SANDBOX should try to load the sandbox imma try

slim ferry
#

i mean the game normally does a big loading cut when changing between the existing stages

#

But maybe

slim ferry
fickle gust
#

or wait, is it possible to run lua instructions through the DebugPlus console?

slim ferry
#

It is

#

eval command

fickle gust
#

ty!

slim ferry
#

yeah thats just the returned value

#

Setting a value doesnt return anything so thats why it says nil

fickle gust
#

ah alr

#

doesn't seem to have done anything tho

#

ah nvm

#

pressing play crashed the game

slim ferry
#

But since it doesnt appear to do anything you might need to patch into the existing new run button to make it work somewhat properly

fickle gust
#

crash log^^

slim ferry
#

Because idk what thatll do

slim ferry
#

Which makes sense

#

Or

dreamy thunder
#

there is a Game:sandbox() function it seems

slim ferry
#

Idk actually

dreamy thunder
#

but it doesnt work

slim ferry
#

Ah

slim ferry
#

I think

dreamy thunder
#

interesting to see thoguh

fallen timber
#

or where i should call SMODS.current_mod.calculate?

slim ferry
#

SMODS.current_mod.calculate gets called automatically

#

With other calculation events

#

It cant use context.joker_main though so youll probably have to use context.final_scoring_step or context.initial_scoring_step depending on what timing you want

fallen timber
#

i want it to add chips after the hand was submitted but before first card is scored

slim ferry
#

use intial_scoring_step then

#

That happens before all other scoring

fallen timber
#

Store the chips to add in some G.GAME value
about that, that can be any value? like G.GAME.nextchips?

slim ferry
#

yeah it can have any name

#

probably include your mod prefix somewhere though to avoid conflicts

fallen timber
#

ok where i place current_mod.calculate? after if context.intial_scoring_step then? then where should i place the context itself?

#

or other way around?

slim ferry
#

SMODS.current_mod.calculate is a global function so it should be defined outside of any other object

#

the context check should be inside the function

#

For reference its SMODS.current_mod.calculate = function(self, context)

#

And it acts like a calculate function on any other object

fallen timber
#

OHH current_mod is my mod id

#

right?

slim ferry
#

no

#

SMODS.current_mod is a table that updates to whatever mod is currently being loaded

#

Which will always be your own mod when its loading

fallen timber
#

so i just set this in my mod's main lua file?

slim ferry
#

Yea

fallen timber
#

ok thanks!

#

Can consumables generate descriptions like jokers do?

faint yacht
#

Consumables can act like Jokers with calculate too.

fallen timber
#

so they are compatible with loc_vars?

slim ferry
fallen timber
#

noted

slim ferry
#

And all the same return values work

#

Pretty much any object with localization has full loc_vars functionality

mighty sky
#

quick someone give me an image of a redneck hillbilly

#

no questions

mighty sky
fallen timber
#

SMODS.calculate_effect({chips=50}, card)
can this run without card? or is there any way to do it?

red flower
#

why

fallen timber
#

i want to run this right after player submits poker hand, but before first card scoring, i already have context but idk how to run calculate_effect without card

red flower
#

where is this? mod calculate?

#

why not return?

fallen timber
fallen timber
red flower
#

yes

fallen timber
#

ok thank

red flower
#

by default the "card" is the top of the deck for mods

#

so if you want to recreate that with calc effect for some reason you can use that as the card

slim ferry
#

Or since youre doing this for a consumable effect, you could use G.consumeables as the "card" im pretty sure

#

which makes the message appear under the consumables area

#

And the consumables are box will jiggle

fallen timber
#

noted

mighty sky
#

yall is there a thing in joker forge that could make the card show text on the bottom of it

#

like fros michells extinct

#

but it can trigger when ever

red flower
#

i dont use this so idk if that works

mighty sky
#

oh

#

can i do multiple and it cycle through them randomly?

red flower
#

dunno

fickle gust
#

it's a bit of a convoluted method but it works

twilit hearth
#

chat did i cook with this artwork or is it ahh

fickle gust
#

i like the watch/timer but the dynamite(?) sticks behind are a bit wonky imo

#

probably because of the two pixel wide outlines and the shading

fallen timber
fickle gust
#

make the clock functional and synced to real time

twilit hearth
#

:o

fallen timber
fickle gust
#

also, random suggestion, but you could make it like an actual bomb you have in your joker's tray instead of a card representing a bomb you know?

#

would be cool imo

twilit hearth
#

my friend keeps telling me they look like sausages

twilit hearth
fickle gust
#

hmmm lemme think how to explain better..

twilit hearth
#

are you saying don't make it a joker and instead a different mechanic?

fickle gust
twilit hearth
#

I think I get what you're saying

#

I like that idea

fallen timber
fickle gust
fallen timber
#

can i rotate sprites?

#

and make layered joker (multiple sprites w transparency)?

fickle gust
#

@slim ferry can we pwease gwet sowme helwp on twhis pwease

#

-# i'm too bad at modding to help himm

slim ferry
#

And for extra sprite layers you can use a drawstep

fickle gust
fallen timber
#

k thank

hidden aspen
#

i have a question about Back:trigger_effect and calculate

#

here return just returns one dictionary

slim ferry
#

trigger_effect is just wierd vanilla stuff

hidden aspen
slim ferry
#

Im assuming it returns things differently

hidden aspen
#

but here it unpacks an array??

slim ferry
#

well no

#

it puts the returned table into another table

#

then unpacks that table

#

if it isnt empty (so if anything was returned)

hidden aspen
#

like this is (o) before unpacking

slim ferry
#

Yeah

#

So thats { { balance = true } }

hidden aspen
#

oh wait it does put it into a table

#

why would they do that

slim ferry
#

🤷

umbral zodiac
#

probably so that if you rreturn something like
return {balance = true}, 1
it gets turned into {{balance = true}, 1}
the reasoning behind that is beyond me but that's how unpacking tables works so

fallen timber
#

can anyone remind me of context after cards scored but before jokers scoring?

slim ferry
#

that does not exist

fallen timber
#

hm? after last card scored perhaps?

fickle gust
#

chat what do you think about a "squish and stretch" joker
-# i have no idea what it'll do tho

twilit hearth
#

i love him

fallen timber
slim ferry
#

isnt that

#

the same thing

fallen timber
#

¯_(ツ)_/¯

slim ferry
#

nothing is calculated between playing card and joker scoring

fallen timber
#

sad

fallen timber
slim ferry
#

idk when mod calculate runs tbh

#

but it doesnt ever get calculated with joker_main anyway

fickle gust
#

ok so i haven't followed any of the conversation about the issue, but can't you like idk, put it as a joker effect that triggers first if what you want is to trigger between played cards and jokers?

-# nvm i used my braincell and read

fallen timber
slim ferry
#

context.other_card == context.scoring_hand[#context.scoring_hand]

fallen timber
#

thanks!

slim ferry
#

though

slim ferry
fallen timber
#

last card is enough for me

#

i can just make local ret and in addition to per_card add xmult and xchips

#

and return this

slim ferry
#

if im understanding correctly yeah you can

fallen timber
slim ferry
#

+= is not a thing in lua

#

fyi

fallen timber
#

oh right

#

i forgor

slim ferry
#

also any values not in G.GAME arent saved with the run

wintry solar
#

What is this effect supposed to do?

urban wasp
#

is there a list of every color in G.C.?

fallen timber
#

dont need it afterwards

slim ferry
slim ferry
#

search for self.C in the source code

#

or that

fallen timber
#

also, can anyone point on what am i missing here?
[SMODS _ "src/utils.lua"]:228: Attempted to insert object "c_liroxfunstuff_weapon_stick" into an empty pool.


SMODS.Consumable({
    object_type = "Consumable",
    atlas = 'weapon_stick',
    key = 'weapon_stick',
    name = 'Stick',
    text = {
        "Next played hand gives {C.chips}+#1#{} Chips"
    },
    config = {extra = {chips = 100}},
    
    loc_vars = function(self, info_queue, card)
        return {
            card.ability.extra.chips
        }
    end,

    pos = { x = 0, y = 0 },
    cost = 2,
    unlocked = true,
    discovered = true,

    use = function(self, card, area)
        apply_weapon(card.ability.extra)
        return {message = "Used"}
    end,

    can_use = function(self, card, area)
        return G.GAME.blind.in_blind
    end
})
slim ferry
#

missing set parameter for the consumable type

fallen timber
#

what should i set it to?

slim ferry
#

well the key of whatever consumable type it should be

fallen timber
#

should it contain mod prefix?

slim ferry
#

no

fallen timber
#

k

fallen timber
slim ferry
#

no

fallen timber
#

so it does it automatically

slim ferry
#

you do set = "weapons" in the consumable

fallen timber
#

alr got it

slim ferry
#

also it should be a SMODS.ConsumableType

fallen timber
#

k thanks

slim ferry
#

oh wait also a consumable type needs a primary_colour (does nothing but is required) and a secondary_colour (the actual colour it uses)

fallen timber
slim ferry
#

secondary_colour = HEX("e62314") in the definition

#

and the colour for use in text is added automatically

fallen timber
#

alr k

#

the description is empty, i wonder why

slim ferry
#

do you have a localization file entry or a loc_txt for it

hybrid shadow
fallen timber
#

it seems i should

slim ferry
fallen timber
#

also it seems chips are applying but after any change they are gone

function apply_weapon(extra)
    for k, v in pairs(extra) do
        Lirox.weapons[k] = Lirox.weapons[k] and Lirox.weapons[k] + v
    end
end

function reset_weapons()
    Lirox.weapons = {
        chips = 0, mult = 0, xchips = 1, xmult = 1, dollars = 0,
        percard_chips = 0, percard_mult = 0, percard_xchips = 0, percard_xmult = 0, percard_dollars = 0
    }
end

SMODS.current_mod.calculate = function(self, context)
    if context.intial_scoring_step then
        return {
            chips = Lirox.weapons.chips,
            mult = Lirox.weapons.mult,
            dollars = Lirox.weapons.dollars,
        }
    end
    if context.individual and context.cardarea == G.play then
        local ret = {
            chips = Lirox.weapons.percard_chips,
            mult = Lirox.weapons.percard_mult,
            xchips = Lirox.weapons.percard_xchips,
            xmult = Lirox.weapons.percard_xmult,
            dollars = Lirox.weapons.percard_dollars,
        }
        if context.other_card == context.scoring_hand[#context.scoring_hand] then
            ret.xchips = ret.xchips + Lirox.weapons.xchips
            ret.xmult = ret.xmult + Lirox.weapons.xmult
        end
        reset_weapons()
        return ret
    end
end
#

same for mult

#

also i placed reset weapons in the wrong place lol

#

yea, even per_card mult/chips are reseting on any change

slim ferry
#

yeah youre resetting it when any playing card scores currently

fallen timber
#

i can send a vid

twilit hearth
#

im running into this issue where I cannot get my joker animated for the life of me

#

I have my sprite sheet with all the frames but something is just not working

slim ferry
#

is the atlas set as an animation atlas

twilit hearth
#

it is just set as SMODS.Atlas

slim ferry
#

it should have atlas_table = "ANIMATION_ATLAS" for animated sprites

twilit hearth
#

no way it was that easy of a fix

#

stand by

#

wow

#

thank you i cant believe it was that easy

upbeat oracle
#

I've beeninterested in making balatro mods for a bit now, does anyone know of any way I can do it.

fallen timber
slim ferry
#

oh

#

yeah

twilit hearth
#

Yess that one is the one ive been following. its helping a lot

upbeat oracle
#

Thanks a lot

fallen timber
#

its dangerous to go alone
take this

versed swan
upbeat oracle
#

ok I will thanks

fickle gust
#

question here, how do other mods achieve the effect of only spawning certain jokers?

twilit hearth
#

I cannot figure out how to get this joker to stop dancing around like this. It has a very specific trigger and shouldn't be dancing whenever a card is scored (especially because it's not triggering when a card is being scored)

fallen timber
twilit hearth
#

ok maybe dont download that

#

idk why it sent like that

fickle gust
urban wasp
#

how could i add a color to G.C? would i just do like

G.C.bof_appetizers = HEX("123456")
fallen timber
#

replace .color with your desired id

slim ferry
#

do not do that

#

without calling loc_colour() first at least

fallen timber
slim ferry
#

also it only needs to be in G.ARGS.LOC_COLOURS if youre going to use it in descriptions

slim ferry
#

usually its best to have it in both G.C and there too

urban wasp
#

i'm using it for the background of a checkbox

fallen timber
urban wasp
#

elaborate?

fallen timber
#

or idk, not an expert

urban wasp
#

okay

fallen timber
fickle gust
urban wasp
#

wing gaster

fallen timber
urban wasp
#

also G.C.GREY exists

fallen timber
urban wasp
#

remember, while everything in-game is supposed to be the american version of stuff (hence, en-us), pretty much everything internally is canadian since localthunk is such

tidal hemlock
#

canadian english is the same as british english btw

#

i think at least

#

it might be american english words with british english spellings

urban wasp
#

yeah i know

sturdy monolith
#

getting somewhere with this content manager revamp

urban wasp
#

though some things are just flat-out misspelled internally like caino and selzer

slim ferry
#

heirophant

#

consumeable

urban wasp
#

consumeable is such a big one lol

slim ferry
#

uhh showman is ring_master but thats probably just an old name

tidal hemlock
frosty dock
#

gluttenous joker

slim ferry
#

also true

urban wasp
frosty dock
tidal hemlock
#

which is one word btw

urban wasp
#

modded ring master joker that's just a direct copy of showman when

tidal hemlock
#

ringmaster

frosty dock
#

oh right, it was

urban wasp
#

i know it's one word, but it'd be funnier if it was still two

tidal hemlock
#

Ring Master, Lord Master of the Rings

urban wasp
frosty dock
#

Mrs Bones when

urban wasp
#

mrs. bones in balatro plus

tidal hemlock
#

when lady luck makes it ig

slim ferry
#

when using the proper function

#

it seems more like for testing title screen stuff though i think?

urban wasp
#

interesting

fickle gust
#

oh wow

slim ferry
#

it does create a ui but

#

the vortex goes wierd

#

and stops spinning

#

its just a static background

#

i didnt actually test any of the buttons tbh

fickle gust
#

i saw some code that created jokers with specific editions and stuff

#

try to put a joker key in to see

#

(probably crashes cuz there's no joker tray)

slim ferry
#

it did work

#

it just created a floating card that could be dragged anywhere

urban wasp
#

it's just not emplaced then

#

or at least failed to

slim ferry
#

also the size slider did work but when i made a very big jimbo it couldnt be dragged and i couldnt press any buttons anymore

urban wasp
#

lol

fickle gust
#

lol

dapper sun
twilit hearth
#

messing around with a joker that removes cards. Looks like the game thinks the card is still there

#

Any ideas?

slim ferry
#

how are you destroying the card

twilit hearth
#

start_dissolve() i believe

#

like the hanged man cards

#

except its not actually destroying the card. only making it invisible?

fading rivet
#

you should only be able to select 4 cards, right?

red flower
fickle gust
#

isn't start_dissolve() just for the animation?
like the card is still there just the burn animation as played and ended

#

but the card still exists

urban wasp
#

i believe so

twilit hearth
#

thats what I was thinking too. I need to actually destroy the card

slim ferry
#

it does also remove the card

urban wasp
slim ferry
#

but everything that should happen when a playing card is removed isnt done automatically with start_dissolve

red flower
past spade
#

cards I create with
SMODS.add_card { set = "Base", rank = ranks[i], enhancement = "m_wild", area = G.deck }
don't seem to have a texture until I save, quit and reopen the run. Is there some additional function that needs to be run?

red flower
#

smods bug

wintry solar
#

just a (already fixed on dev) bug, you can do ```lua
local c = SMODS.add_card({set = 'Base', rank = ranks[i], area = G.deck})
c:set_ability('m_wild')

to circumvent for now iirc
twilit hearth
mighty sky
#

yall in joker forge how do i give a joker obelisk like properties?

slim ferry
#

ask the joker forge discord

fickle gust
mighty sky
#

ahh

fickle gust
#

question again, how do mods add a card to the title screen? (like entropy)

dapper sun
#

if you're using the latest smods release you can uhhh

dapper sun
fickle gust
#

ty you both!

dapper sun
#

yw

urban wasp
#

the second if doesn't trigger (and frankly idk if i'm doing the "remove all modifications" right anyway); why?

calculate = function(self, card, context)
    if context.individual and context.cardarea == G.hand then
        return {
            mult = card.ability.extra.mult
        }
    end
    if context.initial_scoring_step then
        for k, v in ipairs(G.hand.cards) do
            if v ~= context.card then
                v:set_ability(G.P_CENTERS[v.base.suit .. "_" .. v.base.rank])
                v:juice_up()
            end
        end
        return {
            message = "Erased!"
        }
    end
end
sturdy monolith
#

could someone help me with the buggy ass UI i made for my mods content manager?
every time i change the category or page the entire manager UI does whatever the fuck is happening in the screenshot

frosty dock
sturdy monolith
#

nvm i got it

urban wasp
#

ok cool i basically just copied from cryptid's vacuum is all so

urban wasp
#

oh btw nil_check just returns v and v.base and v.base.rank

frosty dock
#

how would it do that, it doesn't have access to v

#

and v.base.rank will never exist

urban wasp
#

no?

frosty dock
#

it's v.base.value

urban wasp
#

okay then

urban wasp
wintry solar
#

you don't need that check at all

urban wasp
#

ok i just like making sure i don't crash to nil values

frosty dock
#

still how would it do that

#

you're passing the string "v.base.rank"

fickle gust
#

yet another question, how can i copy the ability of a random joker?
-# i've looked at the code for cryptid's speculo, but i really don't understand it

#

here's the code i don't understand btw

tidal hemlock
#

that's how i would do it anyway

hybrid shadow
#

are the game settings stored in a way i can modify mid-run?

tidal hemlock
#

i think only game speed can do that but idk

fickle gust
#

ok tell me if i'm correct:

this scans for blueprint compatible jokers:

                if G.jokers.cards[i].ability.name ~= card.ability.name and G.jokers.cards[i].ability.set == "Joker" then
                    eligibleJokers[#eligibleJokers + 1] = G.jokers.cards[i]
                end```

And this picks a random one and duplicates it(?):
```G.E_MANAGER:add_event(Event({
                    func = function()
                        local card = copy_card(pseudorandom_element(eligibleJokers, pseudoseed("cry_speculo")), nil)
                        card:set_edition({ negative = true }, true)
                        card:add_to_deck()
                        G.jokers:emplace(card)
                        return true
                    end,
                }))
                card_eval_status_text(
                    context.blueprint_card or card,
                    "extra",
                    nil,
                    nil,
                    nil,
                    { message = localize("k_duplicated_ex") }
                )```
red flower
#

because that seems to be doing the latter

fickle gust
#

the ability, i took example on speculo because that's the only "random joker effect" joker i know

tidal hemlock
#

i think speculo creates a copy of the joker, not copies its effects

frosty dock
fickle gust
red flower
#

that doesn't do a random joker however but i think picking a joker is the easy part, copying a joker not-in-play is the hardest

hybrid shadow
fickle gust
frosty dock
red flower
hybrid shadow
urban wasp
# urban wasp well, it displays the message, but no cards are actually "erased" ```lua if cont...

erm one more question:
i put the remove modification stuff in an event so that it and the message trigger at the same time, but now if, say, a red seal is held in hand, it'll still be retriggered by the other effect

calculate = function(self, card, context)
    if context.individual and context.cardarea == G.hand and not context.end_of_round then
        return {
            mult = card.ability.extra.mult
        }
    end
    if context.before then
        G.E_MANAGER:add_event(Event({
            func = function()
                for k, v in ipairs(G.hand.cards) do
                    if v.base.value then
                        v:set_ability(G.P_CENTERS.c_base)
                        v:set_edition(nil)
                        v:set_seal(nil)
                        v:juice_up()
                    end
                end
                return true
            end
        }))
        return {
            message = "Erased!"
        }
    end
end
frosty dock
hybrid shadow
fickle gust
frosty dock
#

create a list of all viable jokers (check if they're compatible), then run that through pseudorandom_element

red flower
fickle gust
#
loc_vars = function(self, info_queue, card)
        if card.area and card.area == G.jokers then
            local compatible = G.jokers.cards[1] and G.jokers.cards[1] ~= card and
                G.jokers.cards[1].config.center.blueprint_compat
            local main_end = {
                {
                    n = G.UIT.C,
                    config = { align = "bm", minh = 0.4 },
                    nodes = {
                        {
                            n = G.UIT.C,
                            config = { ref_table = card, align = "m", colour = compatible and mix_colours(G.C.GREEN, G.C.JOKER_GREY, 0.8) or mix_colours(G.C.RED, G.C.JOKER_GREY, 0.8), r = 0.05, padding = 0.06 },
                            nodes = {
                                { n = G.UIT.T, config = { text = ' ' .. localize('k_' .. (compatible and 'compatible' or 'incompatible')) .. ' ', colour = G.C.UI.TEXT_LIGHT, scale = 0.32 * 0.8 } },
                            }
                        }
                    }
                }
            }
            return { main_end = main_end }
        end
    end
#

so that's a blueprint compat check?

red flower
#

the local compatible line is

daring fern
urban wasp
frosty dock
#

set_ability has a second param to let you delay the sprite change

#

the others do too, iirc

#

so use that and not an event

fickle gust
#

(to test)

frosty dock
#

it wouldn't crash

#

SMODS.blueprint_effect just does nothing when the card isn't compatible

fickle gust
#

ah okay, perfect then, i just need to figure out randomness now
-# *cries in 1 day old lua programmer*

frosty dock
#

that part is easy

#

you just do pseudorandom_element(tbl, "whatever") where tbl is the table of compatible cards and whatever is some unique randomness seed

fickle gust
#

alr i'll try that tomorrow

#

ty!

tidal hemlock
#

thoughts?

versed swan
#

<@&1133519078540185692> spam bot invite link

rapid stag
#

sanity check, context.full_hand exists in current_mod.calculate, right?

slim ferry
#

yes

#

Not everything gets calculated in every context but objects dont just randomly get less of a context than others

frosty dock
#

context.full_hand only exists in the contexts where it does

urban wasp
#

true…

slim ferry
#

i guess bro

frosty dock
#

The missile knows where it is at all times. It knows this because it knows where it isn't.....

pale rampart
#

i still don't know how to make my custom consumable's rate bigger i suck at coding please help me lads A_tt_thinking

red flower
long sun
#

what does this part of Invisible Joker's loc_vars do?

loc_vars = function(self, info_queue, card)
        local main_end = {}
        if G.jokers and G.jokers.cards then
            for _, joker in ipairs(G.jokers.cards) do
                if joker.edition and joker.edition.negative then
                    localize { type = 'other', key = 'remove_negative', nodes = main_end, vars = {} }
                    break
                end
            end
        end
        return { vars = { card.ability.extra.total_rounds, card.ability.extra.invis_rounds }, main_end = main_end[1] }
    end,```
red flower
pale rampart
slim ferry
#

use get_weight

red flower
slim ferry
#

return some number if the deck is selected

long sun
#

ohhhhhh i see

slim ferry
#

Instead of 0

long sun
#

clever!

red flower
past spade
#

having some weird behaviours with negative playing cards, in the deck screen, the negative shader doesnt render for the first negative card of each suit. And every time I open the deck screen each negative card animates and plays a wooshing sound. Is this bugged or just unsupported?

pale rampart
past spade
#

wait a second the deck function uses copy_card, I see how I caused this now

hidden aspen
#

I want to randomize card's suit and rank. how i get poll them?

SMODS.change_base(v, random suit??, random rank?)
#

I know there are SMODS.Ranks and SMODS.Suits but i forgot how to select a random element of a dictionary thats not a center

mystic river
#

i think you can just pseudorandom element (smods ranks, seed)

#

that will return a random rank object, which you can get the key from in the normal way i think

hidden aspen
#

right i forgot about pseudorandom element thank you

#

what the heck

#

i've never seen assert in any balatro related codebase yet

red flower
hidden aspen
#

its able to apply a deck during the run, because back:apply_to_run() sometimes only changes the starting parameters

slim ferry
#

Have you ever looked at deck redeeming functionality from hit library mod Spectrallib

hidden aspen
#

you've gotta be kidding me

red flower
#

i would have told u if i knew lmao

hidden aspen
#

i couldnt find it just by searching it up

red flower
hidden aspen
#

actually i looked at it and i dont see exact implementation of what i need

#

also they have a list of vanilla decks as far as i see? and mine should work with modded decks as well

red flower
#

are you looking at the correct file?

#

because it looks pretty generic to me

hidden aspen
#

i looked "back" through the codebase

#

maybe i havent found it

red flower
past spade
#

ankh doesnt properly remove negative from jokers it copies, I assume this is a smods thing because the only mod I have enabled is debugplus. Is this a known issue?

red flower
#

not an issue ive heard about

#

i would report it

past spade
#

it removes negative but they still have +1 card limit as ability

red flower
#

yeah i think some things broke with abilities

#

maybe it is fixed in dev but reporting it doesn't hurt

hidden aspen
red flower
#

looking at the code it seems to support custom calculates?

hidden aspen
#

am i blind ICANT

#

is this it

red flower
#

yes

#

kinda janky that it's not sending a deck object but yes

hidden aspen
#

okay i see it

#

i was tooting my horn a little too much

twilit hearth
#

how we feeling about this artwork? thoughts?

pale rampart
twilit hearth
#

what part? the whole thing?

pale rampart
#

dark colors

twilit hearth
#

the shadows under the crane? i adjusted them like this as a test

pale rampart
dapper sun
#

how do i canvassprite on joker cards

twilit hearth
dapper sun
#

no???

#

i said canvassprite

#

as in the new thing added in the latest smods release

#

that i don't think has any documentation

#

nvmd i found it

twilit hearth
#

Oh my fault I have no idea what that is

dapper sun
#

it is a new feature

#

okay i still dunno how to use this outside of text

shy cobalt
#

how do i create a mod

#

im tryna make a custom jokr that acts as the default joker for now

#

but it ckeeps crashing

frosty rampart
#

you should update smods to the latest release version (1503a), and then post your code file here

shy cobalt
#

Oops! The game crashed:
Syntax error: card.lua:5124: 'end' expected (to close 'function' at line 238) near '<eof>'

A mod you have installed has caused a syntax error through patching. Please share this crash with the mod developer.

Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-1507e-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows

Stack Traceback

(3) C function 'function: 0x02852d88'
(4) global C function 'require'
(5) main chunk of file 'main.lua' at line 914
(6) global C function 'require'
(7) LÖVE function at file 'boot.lua:323' (best guess)
Local variables:
c = table: 0x0286caf0 {identity:false, version:11.5, accelerometerjoystick:true, modules:table: 0x0286cb40, gammacorrect:false, title:Balatro, externalstorage:false (more...)}
openedconsole = boolean: false
confok = boolean: true
conferr = nil
(8) global C function 'xpcall'
(9) LÖVE function at file 'boot.lua:362' (best guess)
Local variables:
result = boolean: true
(10) global C function 'xpcall'
(11) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])

wanton jolt
#

you forgot stuff

#

in your code

#

notably an end to your function

frosty rampart
#

that's still not the latest release version (click on the releases in the sidebar on github, don't download the green code button)

#

and then pleeeease actually post the code file so i can read it and properly help you

shy cobalt
#

the main.lua?

rapid stag
#

remind me what the check was to see if an enhancement removes a card's rank and suit? like stone

red flower
#

SMODS.has_no_rank/suit

wanton jolt
shy cobalt
#

also the rror says moded version ???

twilit hearth
#

I had Steamodded and smods both downloaded and that was causing me to crash upon launch. I deleted smods and now I only have steamodded downloaded and that has not given me any issues

#

@shy cobalt

frosty rampart
#

that is not helpful for pikaquin's case, the crash is unrelated to that

twilit hearth
#

ah I see

#

it looks like the config function is missing entirely for the joker to work in the first place

frosty rampart
#

also not relevant

#

config is optional

twilit hearth
#

actually??

#

man I should probably just stay out of this then lmao

pale rampart
#

guys help me i genuinely don't know what's happening, from what i know it's just my deck's code glup

red flower
#

or you can also delete the (

shy cobalt
#

where

red flower
#

delete that
also the path should be just the filename

frosty rampart
#

I'm crashing out my discord is crashing constantly
anyway yes that

red flower
#

crowdfunding meta a new computer

frosty rampart
#

for the second crash you posted, it's probably related to installing smods incorrectly

frosty rampart
shy cobalt
#

says this now

red flower
#

youre missing an assets/2x/Joker.png

#

its mandatory

shy cobalt
#

i see

#

it works now

pale rampart
dapper sun
#

love.graphics.newImage("assets/extra_images/wordle_back.png")

red flower
#

im pretty sure that doesnt look for your mod's folder

#

any reason youre not using an atlas?

dapper sun
#

canvassprite

red flower
#

it doesnt let you use an image from an atlas?

dapper sun
#

it's actual love2d drawing

#

like,, regular ass love2d

red flower
#

well that doesnt really answer my question, its not like balatro objects are in some other engine

dapper sun
#

idk how to draw atlas sprites

red flower
#

G.ASSET_ATLAS["modprefix_key"].image seems to be a love.graphics.newImage

dapper sun
#

then there's all that extra stuff

#

i only need the image

red flower
#

??

dapper sun
#

wdym "??"

red flower
#

what do you mean extra stuff

dapper sun
#

an asset atlas contains more than just the image

red flower
#

like a key and 2 numbers?

dapper sun
#

still

#

i don't need it in the atlas table

red flower
#

ok

dapper sun
urban wasp
daring fern
urban wasp
#

hmm it still activates afterward

return {
    message = "Erased!",
    extra = {
        func = function()
            for k, v in ipairs(G.hand.cards) do
                if v.base.value then
                    v:set_ability(G.P_CENTERS.c_base, true)
                    v:set_edition(nil, true)
                    v:set_seal(nil, true)
                    v:juice_up()
                end
            end
            return true
        end
    }
}
#

here i'll record a clip

urban wasp
#

oh ok

daring fern
daring fern
#

Also the juice_up should be in an event.

urban wasp
urban wasp
rapid stag
#

is G.GAME initialised in Game:start_run()?

urban wasp
rapid stag
# daring fern Yes.

i'm finally tackling the cardarea implementation i want to do, but i only want specific decks to have the new cardarea; i already know i need to check G.GAME.selected_back_key.key for my custom deck key, which means, i need to do that check which determines whether that cardarea is initialised or not - but i don't know where in my hook i should be making this check. i'm assuming immediately following when i call the original start_run func

urban wasp
# daring fern Code?
return {
    message = "Erased!",
    func = function()
        for k, v in ipairs(G.hand.cards) do
            if v.base.value then
                v:set_ability("c_base", nil, true)
                v:set_edition(nil, nil, true)
                v:set_seal(nil)
                v:juice_up()
            end
        end
        return true
    end
}

putting the juice in an event made everything go left-to-right, and, while i like it, i'd want the removal to happen on every juice instead of all of them getting removed and then the juice happening afterwards since that seems to be what happened

red flower
#

theres a new function that has the correct timing for areas

#

SMODS.current_mod.custom_card_areas = function(game)

rapid stag
#

oh right

red flower
#

iirc the deck should exist by then

daring fern
rapid stag
#

so i can just do the check in that function?

red flower
#

i think so

urban wasp
#

oh uh current code btw

return {
    message = "Erased!",
    func = function()
        for k, v in ipairs(G.hand.cards) do
            if v.base.value then
                v:set_ability("c_base", nil, true)
                v:set_edition(nil, nil, nil, true)
                v:set_seal(nil)
                G.E_MANAGER:add_event(Event({
                    func = function()
                        v:juice_up()
                        return true
                    end
                }))
            end
        end
        return true
    end
}
daring fern
urban wasp
#

what about eraser's message triggering before all the other things?

#

i assume that's an easy fix somehow

daring fern
rapid stag
red flower
#

it will not

rapid stag
#

does declaring an SMODS.ObjectType prefix the modprefix to the specified key?

red flower
#

no

rapid stag
#

it's SMODS.Back for adding custom decks, yes?

oblique lotus
#

How can I re-enable the Jimbo tutorial?

daring fern
oblique lotus
#

Thank you

rapid stag
red flower
#

that was copied from my mod

oblique lotus
# daring fern `G.SETTINGS.tutorial_complete = false`

Okay, I did eval G.SETTINGS.tutorial_complete = false into the console and got < nil as a result. For what I can tell, it isn't enabled? I got a couple of additional mods on (as well as debug plus to type it) if it is of concern.

rapid stag
#

you can check it by just doing eval G.SETTINGS.tutorial_complete

oblique lotus
#

Checked it, it is still true for some reason. Hopefully it isn't one of my mods

rapid stag
#

i forget if there's something specific you need to do to change a G.SETTINGS var

daring fern
vital wren
#

im interested in doing two things:

  1. having the visual of a joker change based on some game information (to do list showing the current hand, castle showing the current suit, loyalty card showing how many more uses, etc)

  2. having specific instances of cards have unique localized text based on game states (jokers, planets, or tarots having different text if they have an edition for example)

any good examples of things like this i should check out to learn how to do it?

fallen topaz
#

can someone playtest my mod?

daring fern
fickle gust
#

why is there a SpectralPack library for everything 😭

frosty dock
#

for your other question, loc_vars is usually good enough as you can return a key to completely change the text to a different localization key

fickle gust
#

-# i'm not the person who asked the question btw

#

-# but good to know ty!

frosty dock
#

good catch, I replied wrong

vital wren
#

i dont follow how i would do that

frosty dock
#

what part's unclear?

fickle gust
# frosty dock you just do `pseudorandom_element(tbl, "whatever")` where tbl is the table of co...
calculate = function(self, card, context)
        local compatible = G.jokers.cards[1] and G.jokers.cards[1] ~= card and
                G.jokers.cards[1].config.center.blueprint_compat
        
        local ret = SMODS.blueprint_effect(card, G.jokers.cards[pseudorandom_element(compatible, "seed")], context)
        if ret then
            ret.colour = G.C.RED
        end
        return ret
    end

am i doing this wrong? (probably yes)
this crashes when another joker is added

wanton jolt
#

because you could just return a variable and change the sprite

frosty dock
#

no need to index that on G.jokers.cards

vital wren
#

i think my first question will have plenty of resources thanks to aura

wanton jolt
#

i suppose so

vital wren
#

thanks though

frosty dock
#

Also you need to actually create a list of the joker's that are compatible

#

not just copy the check if the leftmost card is

wanton jolt
#

blueprint?

fickle gust
frosty dock
#

Also you should consider not randomly selecting the joker every time something gets calculated, that produces wonky results

wanton jolt
#

dont forget to check for other_joker.config.center.blueprint_compat

#

Blueprint (VanillaR)

-- Blueprint
SMODS.Joker {
    key = "blueprint",
    unlocked = false,
    blueprint_compat = true,
    rarity = 3,
    cost = 10,
    pos = { x = 0, y = 3 },
    loc_vars = function(self, info_queue, card)
        if card.area and card.area == G.jokers then
            local other_joker
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i + 1] end
            end
            local compatible = other_joker and other_joker ~= card and other_joker.config.center.blueprint_compat
            local main_end = {
                {
                    n = G.UIT.C,
                    config = { align = "bm", minh = 0.4 },
                    nodes = {
                        {
                            n = G.UIT.C,
                            config = { ref_table = card, align = "m", colour = compatible and mix_colours(G.C.GREEN, G.C.JOKER_GREY, 0.8) or mix_colours(G.C.RED, G.C.JOKER_GREY, 0.8), r = 0.05, padding = 0.06 },
                            nodes = {
                                { n = G.UIT.T, config = { text = ' ' .. localize('k_' .. (compatible and 'compatible' or 'incompatible')) .. ' ', colour = G.C.UI.TEXT_LIGHT, scale = 0.32 * 0.8 } },
                            }
                        }
                    }
                }
            }
            return { main_end = main_end }
        end
    end,
    calculate = function(self, card, context)
        local other_joker = nil
        for i = 1, #G.jokers.cards do
            if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i + 1] end
        end
        local ret = SMODS.blueprint_effect(card, other_joker, context)
        if ret then
            ret.colour = G.C.BLUE
        end
        return ret
    end,
    check_for_unlock = function(self, args)
        return args.type == 'win_custom'
    end
}
frosty dock
frosty dock
wanton jolt
#

oh

#

actually

#
-- Copy Tool(Common)
SMODS.Joker {
    atlas = 'rbxJokers',
    pos = { x = 0, y = 2 },
    pools = {
        ["FelisJokeria"] = true, 
        ["Roblox"] = true, 
        ["Building Tools"] = true, 
    },
    key = "felijo_rbx_copy",
    rarity = 1,
    cost = 5,
    unlocked = true,
    discovered = true,
    blueprint_compat = false,
    
    config = { extra = { chips = 150, chips_mod = 10} },
    
    
    calculate = function(self, card, context)
        if context.setting_blind and not context.blueprint then
            local jokers = {}
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] ~= card and G.jokers.cards[i].config.center.key ~= "j_felijo_rbx_copy" then
                    jokers[#jokers + 1] = G.jokers.cards[i]
                end
            end
            if #jokers > 0 then
                if #G.jokers.cards < G.jokers.config.card_limit then
                    local chosen_joker = pseudorandom_element(jokers, 'j_felijo_rbx_copy')
                    local copied_joker = copy_card(chosen_joker, nil, nil, nil,
                        chosen_joker.edition and chosen_joker.edition.negative)
                    if copied_joker.ability.invis_rounds then copied_joker.ability.invis_rounds = 0 end
                    if type(copied_joker.ability.extra) == "table" and copied_joker.ability.extra.invis_rounds then copied_joker.ability.extra.invis_rounds = 0 end
                    play_sound('felijo_rbx_copy', 1)    
                    copied_joker:add_to_deck()
                    G.jokers:emplace(copied_joker)
                    return { message = localize('k_duplicated_ex') }
                else
                    return { message = localize('k_no_room_ex') }
                end
            else
                return { message = localize('k_no_other_jokers') }
            end
        end
    end,
}
fickle gust
#

G.jokers:emplace(copied_joker)
return { message = localize('k_duplicated_ex') }
else
return { message = localize('k_no_room_ex') }
end
else
return { message = localize('k_no_other_jokers') }
end

ain't that to copy a joker card?

#

wait what's the effect of this joker?

#

-# would help in understanding the code

frosty dock
#

what's happening here is copying the effect of a joker, blueprint-style

fickle gust
#

oh wait can't i copy invis joker's random joker select?

frosty dock
#

two caveats, the selected joker needs to be blueprint-compatible, and you want to copy the same joker for a full hand/round

fickle gust
#

-# not for a full round, just for a hand

frosty dock
#

yeah but those are quite similar in effect

daring fern
hidden aspen
#

bello zeflorp

daring fern
frosty dock
wanton jolt
# fickle gust -# not for a full round, just for a hand
SMODS.Joker {

    calculate = function(self, card, context)
        if context.hand_drawn and not context.blueprint then
            local jokers = {}
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] ~= card and G.jokers.cards[i].config.center.blueprint_compat then
                    jokers[#jokers + 1] = G.jokers.cards[i]
                end
            end
            local other_joker = pseudorandom_element(jokers, 'j_modname_joker')
            local ret = SMODS.blueprint_effect(card, other_joker, context)
            if ret then
              ret.colour = G.C.BLUE
            end
              return ret
            end
        end,
frosty dock
#

they did say specific instances of cards

fickle gust
#
calculate = function(self, card, context)
        if context.hand_drawn and not context.blueprint then
            local jokers = {}
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] ~= card and G.jokers.cards[i].config.center.blueprint_compat then
                    jokers[#jokers + 1] = G.jokers.cards[i]
                end
            end

        local other_joker = pseudorandom_element(jokers, 'j_cash_out_j0k3r')
        local ret = SMODS.blueprint_effect(card, other_joker, context)
        if ret then
            ret.colour = G.C.BLUE
        end
            return ret
        end
    end

imma jump off a bridge why doesn't this workkkk

#

no crash, just does nothing

daring fern
wanton jolt
#

whoops yeah

#

oversight

fickle gust
# wanton jolt oversight

sorry to bother ya but i got a quesion again so i've switched context.hand_drawn to context.joker_main, and it works great for jokers that trigger in joker_main like Joker but it can't copy the effects of Gluttonous Joker that triggers when a card is played, how could i fix this?

current code:

calculate = function(self, card, context)
        if context.joker_main and not context.blueprint then
            local jokers = {}
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] ~= card and G.jokers.cards[i].config.center.blueprint_compat then
                    jokers[#jokers + 1] = G.jokers.cards[i]
                end
            end

        local other_joker = pseudorandom_element(jokers, 'j_cash_out_complex_joker')
        local ret = SMODS.blueprint_effect(card, other_joker, context)
        if ret then
            ret.colour = G.C.BLUE
        end
            return ret
        end
    end
frosty dock
#

either in an ability value or an upvalue

#

actually no, upvalue doesnt work

wintry solar
#
calculate = function(self, card, context)
  if context.press_play then
    local indexes = {}
    for i = 1, #G.jokers.cards do
      if G.jokers.cards[i] ~= card and G.jokers.cards[i].config.center.blueprint_compat then
        indexes[#indexes + 1] = i
      end
    end
    card.ability.extra.joker_index = pseudorandom_element(indexes, 'j_cash_out_complex_joker')
  end
  return SMODS.blueprint_effect(card, G.jokers.cards[card.ability.extra.joker_index], context)
end

something like this

hidden aspen
#

is NFS a shortcut to love.filesystem? and is there a proper way to load everything recusively?

#

nvm i found it in love2d docks

wintry solar
#

use SMODS.NFS

twilit hearth
#

@shy quest uhhh

frosty bone
twilit hearth
#

how can I get my icon to show up on the mod? the "logo" if you will.

slim ferry
#

create an atlas with the key modicon

twilit hearth
#

@slim ferry what would I do without you

fading rivet
#

I have a card that kinda does this

#

take this card I made

#

then you get another card and now it looks like this

hidden aspen
#

i just wrote continue and lua suggested me this... is this real???

#

we're using gotos now?

fading rivet
#

lua doesn't have a continue

hidden aspen
#

insane

fading rivet
#

genuinely

warm otter
#

Hello, guys, I have a question for you! So, I'm trying to make set of jokers that have three abilities each. How would I do that?

frosty dock
frosty dock
warm otter
#

Yes, exactly what I'm trying to state

fading rivet
#

in your localization file

#

do

#
j_modkey_cardkey = {
  name = "name",
  text = {
    {
      "box 1"
    },
    {
      "box 2"
    }
  }
}
fading rivet
warm otter
#

Why thank you for the explanation!

past spade
#

This pseudorandom_element() in a deck apply function always returns the element C, is there some issue with using pseudorandom here?

apply = function(self) G.GAME.starting_params.removed_suit = pseudorandom_element({"H", "D", "C", "S"}, 'cod_triangle')

red flower
fading rivet
#

I said nothing

past spade
slim ferry
#

deck apply is run before the run seed is set properly no?

#

so this will always have the same outcome

red flower
#

i never really tried it so i thought it was something like that yeah

red flower
#

or is this some base config I am not aware of

past spade
#

patch in game.lua start_run()

#

if self.GAME.starting_params.removed_suit and self.GAME.starting_params.removed_suit == _s then keep = false end

#

I could probably just move the random call into that function

red flower
#

yeah that works

#

or maybe not if it's also too early lol

#

if it doesn't just remove the cards in apply

past spade
#

erratic funtionality in there uses pseudorandom so should work

red flower
#

makes sense

hidden aspen
#

how can i insert description of a different object into loc_vars?
description type crashes the game:

({type = "descriptions", key = event.ability.extra.deck_key, set = "Back", vars = {}})

raw_descriptions returns a multi line table

localize({type = "raw_descriptions", key = event.ability.extra.deck_key, set = "Back", vars = {}})****

but since its a table i have to unpack it, but then i dont know its length so i would have to put #1#, #2#, #3#, etc

red flower
#

you would have to do something with either main_end/start or generate_ui

fickle gust
#

alright very specific demand here, is there a way to completely remove a joker's tooltip/part of it (like remove the white rectangle in which the description is located, or the rarity/mod handle, etc)?

essentially i want a joker that as no description, but still as a tooltip that has a name and a mod handle when hovered, if that's not possible or too complicated, removing the entire tooltip is fine if necessary.

#

i've tried removing loc_txt but it leaves an empty white rectangle

rapid stag
#

you may have to engage in generate_ui shenanigans

past spade
#

I've removed the mod and rarity tag before, but not the description box

rapid stag
#

actually, wait

#

what happens if you just write an empty generate_ui function in your joker

fickle gust
#

no ui?

#

i guess

rapid stag
#

hmmmmmmmmmmmmmm

past spade
#

generate_card_ui has a hide_desc parameter, maybe that could be used

rapid stag
#

try

#

oh that could work

#

i was gonna suggest doing something like

generate_ui = function(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
  SMODS.Center.generate_ui(self, info_queue, card, nil, specific_vars, full_UI_table)
end```
past spade
#

oh wait that seems to make it look undiscovered

rapid stag
#

another thing i thought of is that you could make your loc_txt.text be an empty multi box

and then you could try this

generate_ui = function(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
  SMODS.Center.generate_ui(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)

  if full_UI_table and full_UI_table.multi_box then
    full_UI_table.multi_box = nil
  end
end```
and if that causes a crash,
```lua
generate_ui = function(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
  SMODS.Center.generate_ui(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)

  if full_UI_table and full_UI_table.multi_box then
    full_UI_table.multi_box = {}
  end
end```
#

i feel like somewhere around here is the trick to getting what you're after

at least my intuition is confident that your answer is in some kind of generate_ui fuckery

tranquil cypress
#

-# talbe

rapid stag
#

i'm still waking up okay cirBlech

tranquil cypress
#

lol

past spade
#

is there a way to detect jokers being re-ordered?

fickle gust
# rapid stag another thing i thought of is that you could make your loc_txt.text be an empty ...

do i just drop generate_ui into loc_vars like so?

loc_vars = function(self, info_queue, card)
        generate_ui = function(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
            SMODS.Center.generate_ui(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)

            if full_UI_table and full_UI_table.multi_box then
                full_UI_table.multi_box = {}
            end
        end
    end

i have no idea what i'm doing btw

rapid stag
fickle gust
#

aaaah

red flower
#

multi_box will only delete the multi boxes after the main one btw

fickle gust
hidden aspen
#

how can i render a tag like this (not give it out, just show)

fickle gust
wanton jolt
#

then flip the steps column by column

#

revealing the 2 more steps once flipped

hidden aspen
#

no i mean

wanton jolt
#

a tooltip right

hidden aspen
#

i mean render a tag that can be hovered over to see a description

#

oh wait

wanton jolt
#

ohhhhhhhhhhhhhhhh

hidden aspen
#

did i find it?

#

now i need to figure out how to put this in my event

#

thank you

#

RUBBER DUCK JOCKEY 🗣️

wanton jolt
#

rubber duck jockey

#

@hidden aspen check my consumables

hidden aspen
#

i wanna check out later how to do mod combos

#

like not dependancy because they can exist without each other

#

but if they're both enabled it adds stuff

wanton jolt
#

i can give u a function

#
FELIJO.is_mod_loaded = function(var) -- credit aiko
    if not var then return false end
    return (SMODS.Mods[var] and SMODS.Mods[var].can_load) and true or false
end
wanton jolt
#

so for example
FELIJO.is_mod_loaded("felijo")
would return true

frosty dock
#

you do know SMODS.find_mod exists, right?

wanton jolt
#

woops

#

no

frosty dock
#

well now you do

wanton jolt
#

lol

frosty dock
#

if next(SMODS.find_mod("felijo")) then

wanton jolt
#

next

#

😱

frosty dock
#

Also there's an important feature yours doesn't support

#

a mod can provide for a different mod, e.g. amulet counting as talisman being installed

hidden aspen
frosty dock
#

that's why it returns a table

#

Also it's based on find_joker

hidden aspen
#

i dont get it, arent keys unique in nature?

frosty dock
#

every mod has a unique ID

wanton jolt
frosty dock
#

but any mod can provide another mod ID and count that as being present too

#

but different mods can provide the same mod ID without it being an issue

#

in which case find_mod will give you both

hidden aspen
#

ohhhhhhh

#

okay

#

what about find_joker?

frosty dock
#

don't use it, use SMODS.find_card

#

but it works the same way

wanton jolt
frosty dock
#

you can have multiple of a joker

frosty dock
#

it's not an issue naturally

wanton jolt
#

yo i got an idea for a consumable

#

basically using it will put you to a screen where you choose between 3 random tribes among a selection(canine, insect, vermin, avian, human....) you choose one tribe and you get the joker corresponding to that tribe

#

is there a mod that did that? open a screen that shows three cards and you select one? preferably not a dependency

shell timber
#

you could open a pack (?)

#

and just turn off the skip button

wanton jolt
#

oooooh yeah

#

yeahhh

#

since the boosters are use cards

#

you are right

red flower
#

i do that in joyousspring but i still haven't made a selection screen that you can't back out of

#

i need to

hidden aspen
#

tag generate_UI generaties UIElement

#

but here i have balatro.Node?

#

isnt that the same?

frosty rampart
#

nodes are a very generic object that basically every other game object extends from. ui elements are an extension of Moveables, which are an extension of Nodes

rigid solar
#

So if you add a seal during scoring, you can't hover over your cards to see their description until the seal has been added. Is there a way to fix that?

hidden aspen
#

and i actually have a UIElement.Definition not UIElement

rigid solar
#

no, i want the seal to be added after scoring 20 cards, so that the 21st gets the seal

wanton jolt
#

oh right

#

you should probably add context.other_card too

rigid solar
#

in the og if? yeah i guess so

wanton jolt
#

yeah

wintry solar
#

Why would you need to do that?

hidden aspen
#

why is it hiding there ICANT

twilit hearth
#

LMAO

rigid solar
#

add context.other_card to the first if? doesn't really hurt to add it, and it's a failsafe in case there's no card for some reason

slim ferry
#

that literally physically cannot happen

wintry solar
#

there will always be a card in context.individual

slim ferry
#

unless some mod is calling context.individual without a card but they shouldnt be doing that

#

that would be stupid

wintry solar
#

unless someone does something catastrophically silly

slim ferry
#

and you shouldnt account for that

hidden aspen
#

UI is a PAIN

twilit hearth
#

someone critque my artwork

#

i've looked at it for so long it started to look bad

vague ravine
#

GUYS I NEED HELP

#

I fedded up

#

i installed balatro mods and now the saves from before are gone

#

are they still there?

twilit hearth
#

On the base game, they should be

vague ravine
#

i use a launcher that starts the modded version

#

but idk why it starts when i wanna play normal

twilit hearth
#

like with 0 mods installed, it should all be there

#

I assume you would have to uninstall the mods if you wanted to play vanilla?

#

take that with a grain of salt though

vague ravine
#

i uninstalled the mods

#

its still there

#

thank god

#

ye it sucks

#

i will find a way to do both tho

#

i just panicked

red flower
#

it has its own profile slots

slim ferry
#

or entropy

red flower
slim ferry
#

actually idk if entropy does it on its own but cryptid definitely does this

red flower
#

does pwx do it?

slim ferry
#

pwx also does it yes

ivory socket
#

I am once again asking for help with this joker since it still doesn't work, I'm probably missing something simple since I have 0 coding practice but I'm still asking for help since I've been workshopping and its still not retriggering. SMODS.Joker {
key = "Universe",
loc_txt = {
name = "Universe",
text = {
"retrigger all played cards {C:attention}2{} times ",
"if all played cards have",
"the {C:attention}same{} Enhancement"
},
},
config = {
repetitions = 2
},
--unlocked = true
rarity = 3,
blueprint_compat = true,
eternal_compat = true,
Atlas = "jokerimage",
pos = { x = 0, y = 0 },
cost = 7,
loc_vars = function(self, info_queue, card)
return { vars = {context.repetitons} }
end,
message = localize('k_again_ex'),
repetitions = 2,
calculate = function(self, card, context)
if context.repetitions and context.cardarea == G.play then
local enhancement = context.full_hand[1].config.center_key
for i = 2, #context.full_hand do
if context.full_hand[i].config.center_key ~= enhancement then
return nil
end
end
return {
repetitions = card.ability.extra.repetitions,
}
end
end
}

slim ferry
#

its context.repetition, not context.repetitions

ivory socket
#

okay thanks, OF COURSE IT WAS AS SIMPLE AS MAKING IT PLURAL

twilit hearth
#

Welcome to programming

rigid solar
#

it's also config = {extra = {repetitions = 2}}

dapper sun
#

what's wrong with my hook,,?

local text_input_hook = love.textinput
function love.textinput(text)
    if G.jokers then
        for _, v in ipairs(G.jokers) do
            if v.config.center.key == "j_elle_wordle" then
                submit_letter(v, text)
            end
        end
    end


    text_input_hook(text)
end```
frosty rampart
#

you should loop through G.jokers.cards

#

not G.jokers

#

@dapper sun

dapper sun
#

oh ty

#

but that's not the main problem

#

it says there's a problem with me calling text_input_hook

frosty rampart
#

hm
what's the actual crash?

dapper sun
dapper sun
frosty rampart
#

odd

#

sorry i'm kinda clueless lol
i do see orig_textinput in the crash dump somewhere, are you sure the code you posted here is the same as the code in your file and that you saved it?

dapper sun
#

yes

#

i've just tried

local text_input_hook = love.textinput
function love.textinput(...)
    text_input_hook(...)
end```and it did the same thing
frosty rampart
#

ok i'm actually running into the same issue, i tried saving love.textinput as a variable in my own mod and it's coming up nil

#

even tho love.textinput is a function when i check it in debugplus midgame

dapper sun
#

weird

frosty rampart
#

oh orig_textinput comes from debugplus

#

debugplus might actually be doing some shenanigans

dapper sun
#

damn

#

gonna try disabling it

frosty rampart
#

ok so it's not debugplus then

#

maybe try saving text_input_hook in an event or something?