#💻・modding-dev

1 messages · Page 403 of 1

solid mesa
#

mmmmm i see, i understand less than before

normal crest
#

that will add 4 mult to the score, exactly as the basic +4 mult joker does

solid mesa
#

thx guys, i will read more

wind steppe
untold vigil
#

How did you get it to appear?

wind steppe
solid mesa
untold vigil
solid mesa
#

like, the hiker?

normal crest
#

of what's inside it

daring fern
untold vigil
wind steppe
#

also main.json should be changed to FolderName.json

untold vigil
solid mesa
sonic cedar
#

And what’s the achievement code rn

wind steppe
untold vigil
untold vigil
wind steppe
next pivot
#

this is the achievement code rn

SMODS.Achievement{
    key="touch_grass",
    atlas="achieve",
    -- hidden_text = true,
    pos={x=1,y=0},
    hidden_pos={x=0,y=0},
    unlock_condition = function(self,args)
        if args.type=="touch_grass" then
            print("Came without the prefix")
        end
        if args.type == "touch_grass" or args.type == "SPL_touch_grass" then
            print("unlocked with the prefix")
            return true
        end
    end
}
wind steppe
#

all my other jokers show up idk why this one decided to dip

daring fern
untold vigil
wind steppe
untold vigil
#

At this point I have no idea

wind steppe
#

metadata file is the .json

untold vigil
daring fern
wind steppe
untold vigil
daring fern
untold vigil
#

Nope

wind steppe
#

show us whats inside the metadata file

normal crest
wind steppe
solid mesa
wind steppe
#

eh good practice regardless

normal crest
#

yeah smods just looks for any file with json extension

#

I'd name it metadata.json

daring fern
untold vigil
normal crest
#

but it's whatever

solid mesa
normal crest
solid mesa
scarlet imp
daring fern
normal crest
#

@solid mesa what kind of joker do you want to make

normal crest
#

Yeah save that and try again

#

Also your prefix should really be longer

untold vigil
normal crest
#

that's different

#

each mod has its unique prefix

scarlet imp
#

Probably like "sab" for "Space Ace Blade", but you just want to be absolutely sure its unique

untold vigil
#

Yay made some progress

wind steppe
#

my joker doesn't show up for some reason (its not cause of the files i have other jokers in the same file that show up)

untold vigil
scarlet imp
#

or is it the whole thing since its also missing art

untold vigil
#

Now I'll check if I can make it so it shows the "art" and text

wind steppe
solid mesa
scarlet imp
wind steppe
normal crest
#

the way a joker is made depends entirely on its intended effect

scarlet imp
solid mesa
solid mesa
scarlet imp
#

I actually wanted to make a video about my journey making Deckception (my mod) that's sort of a modding guide for beginners

scarlet imp
scarlet imp
normal crest
#

i feel like you're just confusing them more and more

solid mesa
untold vigil
#

The atlas and text/loc_txt has to be inside SMODS.jokers or Smods.atlas

#

?

next pivot
scarlet imp
solid mesa
sonic cedar
daring fern
normal crest
solid mesa
normal crest
#

they don't even know lua apparently

#

so saying all of this isn't really helping them

scarlet imp
#
-- Context to use when retriggering jokers
if context.retrigger_joker_check and
      -- Makes sure it doesn't retrigger copies of itself
     context.other_card.config.center_key ~= self.key then

      --- Code

  end
wind steppe
#

does anyone know why my joker does nothing

     calculate = function(self, card, context)
        if context.before and context.cardarea == G.play and not context.blueprint then
            print("a")
            if context.full_hand[1]:get_edition() == "e_base" then
                print("b")
                context.full_hand[1]:set_edition('e_negative')
                card.ability.extra.hands = card.ability.extra.hands - 1
                  return {
                      message = localize('para_k_transformed'),
                      colour = G.C.ATTENTION
                  }
            end
        elseif context.after and card.ability.extra.hands <= 0 and not context.blueprint then
            para_consumefood(card)
            print("c")
            return {
                message = localize('k_eaten_ex'),
                colour = G.C.ATTENTION
            }
        end
    end
#

none of the print statements trigger

solid mesa
daring fern
next pivot
daring fern
scarlet imp
wind steppe
normal crest
#

jokers can do anything you want and they're limited by your knowledge of lua and creativity

daring fern
wind steppe
daring fern
#

Jokers can retrigger jokers that retrigger playing cards.

solid mesa
wind steppe
daring fern
daring fern
solid mesa
untold vigil
daring fern
untold vigil
#

I feel like i'm getting closer

faint yacht
scarlet imp
sonic cedar
normal crest
#

in the pos = blah blah line

next pivot
wind steppe
#

how do i get the edition of a playing card

#

and whats the key for base edition

faint yacht
#

if context.other_card.edition to check if an edition exists.

untold vigil
sonic cedar
normal crest
#

if you want to check if it doesn't have an edition do if not other_card.edition

daring fern
sonic cedar
next pivot
# sonic cedar after you changed it
-- Achievement
SMODS.Achievement{
    key="touch_grass",
    atlas="achieve",
    -- hidden_text = true,
    pos={x=1,y=0},
    hidden_pos={x=0,y=0},
    unlock_condition = function(self,args)
        if args.type == "SPL_touch_grass" then
            print("unlocked with the prefix")
            return true
        end
    end
}
-- Joker
SMODS.Joker{
    key="grass_joker",
    rarity=1,
    cost=3,
    atlas="grass",
    pos={x=0,y=0},
    loc_vars = function(self,info_queue,card)
        SparkLatro.touched_grass = true -- actually not really used but
        check_for_unlock({type="SPL_touch_grass"})
    end,
}
untold vigil
#

The more I try to analise and think of smt the more my brain breaks
I'm cooked chat 🥀

normal crest
#

you just have syntax errors in your code

sonic cedar
untold vigil
#

Like unnecesary {}

untold vigil
normal crest
#

get the lua extension

#

it will help a lot

normal crest
next pivot
untold vigil
sonic cedar
normal crest
next pivot
# sonic cedar ....send the code
SMODS.Joker{
    key="grass_joker",
    rarity=1,
    cost=3,
    atlas="grass",
    pos={x=0,y=0},
    generate_ui = function(self,info_queue,card,desc_nodes,specific_vars,full_UI_table)
        -- yes the variables are not going to be used its fine
        SparkLatro.touched_grass = true
        check_for_unlock({type="SPL_touch_grass"})
    end,
    calculate = function(self,info_queue,card)
    end
}
wind steppe
#

is there a way to check if you're playing balatro in windowed mode vs. fullscreen

untold vigil
normal crest
#

define your atlas before your joker

untold vigil
normal crest
#

no

#

first SMODS.Atlas

#

Then after all that

#

SMODS.Joker

hybrid shadow
#

bump (currently center, not card, but still having the error)

untold vigil
#

So I'm currently missing key... It's that meant to be the file name or something?

normal crest
#

key is just a string

#

can be anything you want to name it

#

and when you use the atlas in a joker or in any other object you use the key that you put

umbral zodiac
#

does anyone know the vanilla chances for each rarity in the shop

hybrid shadow
umbral zodiac
#

oh thank god its in percentages and not weights

#

ty ty

hybrid shadow
#

nobody knows what the weights are from what i can tell

umbral zodiac
#

oh, well then thank you for giving it to me in percentages

hybrid shadow
#

but those are the chances

upper onyx
#

is there any way to get loc_vars from an arbitrary joker?

normal crest
#

only if you have an instance of that joker

upper onyx
sonic cedar
hybrid shadow
normal crest
normal crest
normal crest
#

and then you should be able to call it with joker.config.center:loc_vars({}, joker)

#

I'm not 100% sure if this will work btw

#

just an educated guess

solid mesa
#

like the "em" for pixels?

upper onyx
normal crest
#

vanilla jokers don't have the loc_vars function

next pivot
# sonic cedar send a log message to see if it's running
    generate_ui = function(self,info_queue,card,desc_nodes,specific_vars,full_UI_table)
        print("hi yes we are generating the uI")
        -- yes the variables are not going to be used its fine
        SparkLatro.touched_grass = true
        check_for_unlock({type="SPL_touch_grass"})
    end,
upper onyx
hybrid shadow
normal crest
#

they're all inside a generate_ui function that is common to all cards

#

hard coded basically

upper onyx
#

ah, fair enough

solid mesa
hybrid shadow
sonic cedar
keen totem
#

weights are actually 9000 times better than percents

#

and i will stand by this

normal crest
#

agreed

keen totem
#

do you not know how weights work?

#

cause if you do youd agree with me

paper zealot
next pivot
# sonic cedar ok cool it runs fine! in that case can you send the achievement code setup?

i dont think ive changed it but here it is

SMODS.Achievement{
    key="touch_grass",
    atlas="achieve",
    -- hidden_text = true,
    -- reset_on_startup = true, -- TODO: remove once you've actually finished the mod lol
    pos={x=1,y=0},
    hidden_pos={x=0,y=0},
    unlock_condition = function(self,args)
        if args.type == "SPL_touch_grass" then
            print("unlocked with the prefix")
            return true
        end
    end
}
solid mesa
solid mesa
keen totem
#

for a common, what value of n is fair in
1 in n chance to give Xn Mult
?

hybrid shadow
#

im wishing i could make a custom rarity but since i have no clue what the vanilla weights are i can't really do that

keen totem
hybrid shadow
keen totem
#

probably

paper zealot
outer basalt
umbral zodiac
#

i did not
interesting

solid mesa
normal crest
hybrid shadow
outer basalt
#

speaking of, if I wanted to create a card a la The Fool how would I do that?

wind steppe
#

how would i detect if a blind ended and i didn't lose?

hybrid shadow
solid mesa
normal crest
#

i'm not sure what you're asking

solid mesa
#

weights are the only system or smods have another?

sonic cedar
hybrid shadow
next pivot
wind steppe
#

how would i detect if i was saved by a joker? (ex: mr bones)

gentle python
#

Uhh

solid mesa
#

no

gentle python
#

?

solid mesa
#

rule 4 dude

#

only pc mod

keen totem
#

obv theres a reason but idk what sticks out there

solid mesa
#

wh@t

daring fern
solid mesa
#

what

keen totem
#

oh they deleted smth

solid mesa
keen totem
#

im just curious

#

or is it smth they posted and deleted

solid mesa
solid mesa
daring fern
keen totem
sonic cedar
hybrid shadow
wind steppe
next pivot
solid mesa
keen totem
#

is there a rule against modding non-PC balatro cause you have to do some weird stuff that youre not supposed to do in order to make it moddable

red flower
hybrid shadow
red flower
hybrid shadow
#

i havent modded mobile balatro before but there's a reason it isnt possible

keen totem
hybrid shadow
#

anyways

outer basalt
red flower
hybrid shadow
#

bump again

normal crest
wind steppe
normal crest
#

not that I know what exactly

outer basalt
wind steppe
hybrid shadow
normal crest
#

you guys can't see it?

red flower
#

looks like neptune to me

outer basalt
#

emplaced a neptune

solid mesa
wind steppe
outer basalt
#

anyways i want my neptune to be usable 😭

solid mesa
outer basalt
#

tis what i was doing.

daring fern
outer basalt
normal crest
#

returning nil is not unexpected, but did it use it

red flower
#

yeah it returns nil because it doesnt have a return thats normal

outer basalt
#

still 1/2

normal crest
#

maybe just kill it and try again

red flower
normal crest
#

what did you do to emplace it

outer basalt
#

consumable saves the last used card

normal crest
#

uhhh

#

don't save card objects in your ability tables

#

you will break your save file

outer basalt
#

oop

#

what should i do then?

#

. save it as a variable outside the card..

#

somehow, forgot that was an option

hybrid shadow
#

lol

normal crest
#

are you trying to replicate the fool behaviour

sonic cedar
#

if only there was a mod that replicates every tarot in an smods friendly way

red flower
#

!!

#

it doesnt help with the fool because it uses the vanilla variable

sonic cedar
#

damnit!!

keen totem
#

vanilla remado my beloved

sonic cedar
#

i fumbles

midnight coyote
#

how can i make an enhancement replicate the card played next to it, regardless if it's being scored or not?

midnight coyote
#

but

sonic cedar
#

conte- you guys are just demons i swear

keen totem
#

then this should be easy

midnight coyote
#

but how do i

normal crest
#

you want to get the effects the card next to it would have had if it was scored?

midnight coyote
#

it replicates it thrice

outer basalt
red flower
normal crest
# midnight coyote yes

honestly that sounds very complicated and probably requires a lot of lovely patching in my mind

outer basalt
#

how would I acess that? I tried card.key

red flower
#

card.config.center.key

outer basalt
#

ohhh

#

mfw im just missing the config

daring fern
midnight coyote
daring fern
solid mesa
midnight coyote
next pivot
daring fern
keen totem
#

is 1 in 2 chance for X4 Mult too OP?

wind steppe
keen totem
#

idk

keen totem
#

what rarity should it be

#

feels uncommon

midnight coyote
#

chances for XMult at all feel pretty weak because of how unreliable they are

normal crest
keen totem
#

the thing im basing this off of literally has to be chances

#

or else its loyalty card

wind steppe
#

why doesn't this prevent me from being saved by mr bones

        elseif context.end_of_round and not context.game_over and ((to_big(G.GAME.chips) - to_big(G.GAME.blind_chips)) < to_big(0)) then
            G.STATE = G.STATES.GAME_OVER
            G.STATE_COMPLETE = false
        end
hasty ravine
#

I've been trying to do a card that makes specific played cards retrigger, but that's not happening for some reason. Does it not work when the id its being compared to is a variable?

normal crest
#

not just marcVal

wind steppe
hasty ravine
hybrid shadow
wind steppe
#

because jonklers dont trigger as much

sonic cedar
# wind steppe wdym

and context.main_eval
(also you should probably move the number comparison to a separate conditional)

hybrid shadow
keen totem
#

without retriggers, this is better than bloodstone

hybrid shadow
keen totem
#

wdym after hand is played

hybrid shadow
keen totem
#

context.joker_main

#

but, it is technically better than bloodstone unless you have retriggers

hybrid shadow
#

if it triggers off of cards then yes bump, if not keep it same rarity as bloodstone

normal crest
#

yeah it's not really better than bloodstone in that aspect

wind steppe
keen totem
#

once you get retriggers its worse

#

just like in the game its from, first few antes joker (i mean, early game thing in that game but same premise)

hybrid shadow
#

the only buff a joker that has 1 in 2 chance of scoring x4 mult in context.joker_main can have is from oa6s

sonic cedar
keen totem
#

its based on the Eoka Pistol from Rust

wind steppe
keen totem
#

i think this joker makes a LOT more sense with that info

wind steppe
#

but doesn't kill you if you beat the blind normally

sonic cedar
wind steppe
hybrid shadow
sonic cedar
#

iirc

keen totem
#

its meant to be early game so i kinda want it to be common

sonic cedar
#

cause mr bones operates in game_over (who wouldve guessed)

wind steppe
hybrid shadow
keen totem
hybrid shadow
keen totem
#

im not balancing a joker based on one of the worst in the game

sonic cedar
#

like E_MANAGER event

wind steppe
#

idk

hybrid shadow
#

does nobody know how to fix this

untold vigil
#

Soo finally made it load without crashing the game
-# Darn I need it so it triggers with spades, make it load the art cuz even with the atlas stuff it dosen't load and make the spade part be dark blue

#

First I'll lock in and check if it works

hybrid shadow
untold vigil
hybrid shadow
outer basalt
#

my neptune is real now ^^,

hybrid shadow
wind steppe
untold vigil
hybrid shadow
#

also

#

what does your joker call for as the atlas

outer basalt
untold vigil
hybrid shadow
#

it has atlas = somewhere in there right?

untold vigil
hybrid shadow
untold vigil
#

I'll figure a way to do something myself, it's a personal nitpick

hybrid shadow
#

alr

wind steppe
#
        elseif context.end_of_round and context.game_over and context.main_eval then
            if ((to_big(G.GAME.chips) - to_big(G.GAME.blind_chips)) < to_big(0)) then
                   G.STATE = G.STATES.GAME_OVER
                G.STATE_COMPLETE = false
            end
        end

why doesn't this prevent mr bones from saving me

solid mesa
solid mesa
outer basalt
#

what happened to the atlas ??? lmao???

trail roost
#

Yo, I need help with something, anyone able to?

wind steppe
#

don't ask if you can ask something

solid mesa
trail roost
#

This keeps happening

wind steppe
solid mesa
trail roost
#

I have, 3 times

wind steppe
#

reinstall steamodded and lovely

trail roost
#

Still didn’t work

wind steppe
#

what mods do you have

trail roost
#

Cryptid and Pokermon

outer basalt
#

okay her backsprite is a bit fucked up (I guess its too dark?) buuuut thats my second joker almost finished up.
Anyways enjoy literally just my username lol

wind steppe
trail roost
#

Yeah

wind steppe
#

reinstall everything

solid mesa
#

its the 3's dude in two days with the same problem

#

something recent is causing that

paper zealot
# trail roost I have, 3 times

Where did you install it to? It should go in the Balatro installation folder (usually at C:\Program Files (x86)\Steam\steamapps\common\Balatro), not in the Mods folder with the other mods

trail roost
paper zealot
#

Also make sure your Balatro is updated to version 1.0.1o

trail roost
#

Yeah it’s updated

#

its still crashing every time

paper zealot
sleek cliff
#

ok, so someone was playing my mod and got this error when they played a Royal Flush

daring fern
#

What does that line look like on their side?

trail roost
#

It’s loading

sleek cliff
daring fern
daring fern
wind steppe
sleek cliff
daring fern
daring fern
sleek cliff
#

like this?

untold vigil
#

LETSGOOOOO

#

Thank yall for your help

daring fern
sleek cliff
#

awesome

wild escarp
#

Is this not correct for displaying a negative tooltip?
"{C:dark_edition,T:e_negative}negative"

glad osprey
#

tooltips are only for decks btw

#

if your not using it for a deck then you need to use loc_vars "info queue" system

wild escarp
#

I've done them on jokers too, but I guess vouchers are not that easy?

glad osprey
#

I didn't expect it to work for jokers

#

but yea I would still reccomend doing the info queue stuff

wild escarp
#

Yeah, that worked, thanks!

scarlet imp
#

trying to make a new consumable type, but I need to make a pool for it it seems

SMODS.ConsumableType {
    key = "tboi_reversed",
    default = "c_tboi_r_fool",
    primary_colour = HEX("89093a"),
    secondary_colour = HEX("89093a"),
    collection_rows = { 5, 6 },
    shop_rate = 2.5
}

I pretty much copied this code from the VanillaRemade consumable for regular Tarots, so is this where I put the pool for my consumables?

wild escarp
#

Is there some good documentation for taking ownership?

topaz monolith
#

How would I check if the player has a specific tag?

daring fern
stiff quiver
#

how can i make a joker add a card to your hand?

daring fern
vale glen
stiff quiver
#

i'll try that thanks

strange wasp
#

Hi, I think I may have gotten a grasp on how to get things started with SMODS documentation. I also am about to start making my first joker, but I am running into a problem. Whenever I type in SMODS , there's a red line under it. Is there anyway I can fix those? I'm using VSC

vale glen
#

Include the Steamodded folder in your workspace, if you're using VS Code or some IDE like that

paper zealot
scenic elm
manic rune
#

huh

#

balatro star rail's code is fucked up now that i look back at it

#

sob

stiff quiver
#

hi, i asked before how to make a joker add cards to your hand and i was told to look at certificate so i copied the part of its code that creates the card but for some reason its creating like 20 cards and i dont know why ```lua calculate = function(self,card,context)
if context.discard then
if #context.full_hand == 4 and context.full_hand[1]:get_id() == 6 and context.full_hand[2]:get_id() == 6 and context.full_hand[3]:get_id() == 6 and context.full_hand[4]:get_id() == 6 then
for _,playing_card in ipairs(context.full_hand) do
SMODS.destroy_cards(context.other_card)
card.ability.extra.happen = true
end
end
end
if card.ability.extra.happen then
card.ability.extra.happen = false
G.E_MANAGER:add_event(Event({
func = function()
local _card = create_playing_card({
front = pseudorandom_element(G.P_CARDS, pseudoseed('seed')),
center = G.P_CENTERS.c_base}, G.hand, nil, nil, {G.C.SECONDARY_SET.Enhanced})
local seal_type = pseudorandom('seed')
if seal_type > 0.75 then _card:set_seal('Red', true)
elseif seal_type > 0.5 then _card:set_seal('Blue', true)
elseif seal_type > 0.25 then _card:set_seal('Gold', true)
else _card:set_seal('Purple', true)
end
G.GAME.blind:debuff_card(_card)
G.hand:sort()

                      return true
                  end}))
          
    
  end

end,

manic rune
#

context.discard runs everytime a card is discarded, afaik

hasty mist
#

i think context.pre_discard is for every discard

stiff quiver
#

i'll try that

hasty mist
#

what broke here?

#

is it not other_card?

daring fern
vale glen
#

Dun think other_card exists in every context

thorn furnace
#

What are the keys for the different editions?

daring fern
stiff quiver
#

ok that worked, thanks everyone

hasty mist
thorn furnace
daring fern
vale glen
#

if context.individual and ...

scarlet imp
#

trying to add my own consumable type, got this error

thorn furnace
hybrid shadow
#

bump

hasty mist
#

also, is this incorrect? it seems to not be applying echips or emult

hybrid shadow
hasty mist
#

yeah

daring fern
manic rune
#

do you really need to use emult_mod instead of emult?

stiff quiver
#

btw how do i set an enhancement/edition to the created card? does it work the same way as adding the seal?

hasty mist
daring fern
hasty mist
#

huh why not

daring fern
daring fern
manic rune
#

im surprised your vsc didnt underline that actually

daring fern
manic rune
#

sob

hasty mist
#

i do have it i just keep it off most of the time, bad habit i know

manic rune
#

whats with people coding without Lua extension

unborn bay
#

maybe to save on ram?

#

like yeah lsps do take up some ram

vale glen
#

Axy codes in Notepad++, with only a low contrast color theme. misha

unborn bay
#

but then again you're already running vsc

hasty mist
#

nah i have plenty i just have a habit of turning it off

unborn bay
#

which is already electron

#

so you're not saving anything

solid mesa
vale glen
#

Axy just doesn't like the telemetry from VS Code, and VS Codium starts up a bit slower than Notepad++, soooo.

daring fern
hasty mist
#

i actually fixed that one

#

but yeah by default the lua extension makes like almost all the text green

scarlet imp
hasty mist
#

makes it kinda hard to read

vale glen
unborn bay
#

n++ does not have code completion though its fine if you don't need that

vale glen
#

Axy never got used to code completion, so that works out

unborn bay
#

lsps like the sumneko lua extension provides provide that

vale glen
#

VS Code probably has VIM keybinds, come to think of it

#

Or maybe Emacs

solid mesa
#

even it is in formatt

vale glen
#

You might want to specify the language then

hasty mist
#

awesome, works great now, ty for the help yall

vale glen
#

Futhark font

#

Amaze

hasty mist
#

yess

vale glen
#

Imagine if you replaced all letters with that

hasty mist
#

was an absolute pain to implement

vale glen
#

Yeah, sounds like it

#

You'd prolly have to mess with generate_ui directly or something

scarlet imp
hasty mist
thorn furnace
#

how do I check if a played card is a certain rank

hasty mist
#

the font system is a recent smods addition

hasty mist
daring fern
vale glen
hasty mist
#

yep!

unborn bay
#

yeye

thorn furnace
vale glen
#

hypeeee

daring fern
thorn furnace
thorn furnace
scarlet imp
# hasty mist wdym?

blinds cap out at like 1e308, going over it is what gives you naneinf in game. If you raise the cap, you could play with a Joker like that for alot longer yknow

hasty mist
#

theoretically infinite, if your pc can handle it

scarlet imp
#

epic 👍

hasty mist
#

you can get scores like this lmao

vale glen
#

Use the massively parallel power of VHDL/Verilog

hasty mist
#

lmao yeah

vale glen
#

To run... high frequency financials Balatro

hybrid shadow
#

im not using talisman for my mod bc i could never get used to having to wrap everything in to_bigs

scenic elm
#

for some reason i can't fast reload the game with alt + f5, only the holding m fast reload works. y'all got any ideas as to why? i'm on the latest version of smods

solid mesa
hasty mist
solid mesa
hybrid shadow
#

bump

solid mesa
#

the first time i reach that score (actually was ## ) i have cosmos and his puppet

hasty mist
solid mesa
# hasty mist

oh sorry i dont see you name, i play your mod a few days ago

thorn furnace
#

How do you tell if a Wheel of Fortune has failed

sturdy compass
#

I made checks for that and you need to patch/take ownership to make that work

thorn furnace
#

i feel bad patching these things because it makes my compatibility with other mods worse

#

but I guess I have 4 different Jokers based around modifying/using Wheel of Fortune so I guess it balances out

sturdy compass
#

Taking ownership is a lot less destuctive if compatibility is a concern

#

Also it is very possible to make non-destructive patches

thorn furnace
#

o

stiff quiver
#

how do i change a cards rank to a selected number? is it with this? lua card:set_base(G.P_CARDS[suit_prefix..rank_suffix])

thorn furnace
# thorn furnace o

I might as well just patch the entire thing since I'm changing it anyway
How do I patch the use function of it

daring fern
vagrant cedar
vale glen
stiff quiver
sturdy compass
vagrant cedar
stiff quiver
sturdy compass
vale glen
#

Read that wrong qpOw

sturdy compass
#

all good lmaooo

vale glen
#

Non destructive taking ownership would be nice though, then it could be like hooking a function

sturdy compass
#

ownership taking in general is pretty non-destructive honestly

thorn furnace
sturdy compass
#

It's just when multiple mods start to try taking ownership at the same time where it starts getting hairl

vagrant cedar
daring fern
sturdy compass
vagrant cedar
#

But the game is telling me different

sturdy compass
#

It can just be the file name and it works just fine

vale glen
vagrant cedar
#

MAES

daring fern
sturdy compass
vagrant cedar
sturdy compass
#

Thought you were talking about the path attribute

hybrid shadow
#

bump

vale glen
#

Use play_sound('MAES_1',1,1) to get your original sound

vale glen
vagrant cedar
#

I was confused as to why it keeps saying resources in Balatro itself

#

because nowhere in my code did I say resources

sturdy compass
#

Technically I use this for more than just the Wheel, but that's moot for your purposes

vale glen
thorn furnace
vagrant cedar
#

MAES

#

I was asking if the corrected line was what I sent

sturdy compass
vale glen
sturdy compass
#

Finding out calculate_context exists was a game changer for me so I hope you find use out of it too

vale glen
vagrant cedar
thorn furnace
#

Im probably gonna ask for help again because i also wanted to rewrite the functionality of the card itself CoroboLaugh
I had a Joker that allowed Wheel of Fortune to make jokers negative

vale glen
#

Awh

#

Some contexts use it, but Axy's never, like, actually read those contexts to see how they're used, or what they contain

sturdy compass
#

I honestly have never seen another mod use that arg so I never looked into it lmao

vale glen
#

Mmh, just copying existing mods isn't great software engineering practice, bweh... Axy's never worked with code this large before though, so just reading all these fields is slow going

#

All of Balatro is a giant table, but it's also a giant table

sturdy compass
#

Ain't that the truth lol

#

How new are you to modding the game?

thorn furnace
vale glen
#

Basically started around April 7 of last month, with some chatter among friends about making Jokers based on us

#

Made a few jokers and have 'em on a Github, if you wanted to have a look

sturdy compass
sturdy compass
vale glen
sturdy compass
#

No this is a patch, this is ok

#

My guess is you forgot a set of ''' at the beginning of the pattern argument

vale glen
#

That seems to be the only place they're unpaired, so

thorn furnace
sturdy compass
#

Trust me, you will very likely do more patches lol

thorn furnace
vale glen
sturdy compass
thorn furnace
#

o

sturdy compass
hybrid shadow
#

last gamba of today to see if this is gonna get buried again or if someone is actually gonna help

thorn furnace
#

vsc's ui is so confusing to me ;-;
Why can't it be more like vs

vale glen
#

Like, this was a joker Axy coded in recently, and added dynamic descriptions so it's not a wall of text.

sturdy compass
#

goodness me

sturdy compass
#

It's honestly a lot more sleek

#

Better keyboard shortcuts too

vale glen
thorn furnace
sturdy compass
#

Sometimes

thorn furnace
#

not by default but it's in settings

sturdy compass
#

oh huh

#

the more you know

thorn furnace
#

I've only really used vsc when I haven't had any other IDEs that support a certain language

hybrid shadow
thorn furnace
#

which has been slowly decreasing

hybrid shadow
#

yup card returned nil again

vale glen
#

Hm

#

Are you available for a screenshare to figure it out?

#

Axy has some time, if you don't mind that

sturdy compass
#

Did you by any chance put hand_type in an extra table in your config?

hybrid shadow
sturdy compass
#

It is not

#

That's why I was asking lol

#

Could you send the full code of the card?

thorn furnace
sturdy compass
#

yeah that should work

thorn furnace
#

hm

sturdy compass
#

Show the full patch if you could

vale glen
#

Is that line in the right spot? Hrm

thorn furnace
#

while we're at it the joker too

sturdy compass
#

Ah that's why. Your check in the joker is wrong

hybrid shadow
sturdy compass
#

Literally the only context check you need is context.failed_wheel

vale glen
thorn furnace
#

well then

#

this is like the second smallest Joker I've made so far CoroboLaugh

#

actually it might be the smallest

hybrid shadow
sturdy compass
#

The colours table needs to be in your vars table

vale glen
sturdy compass
#

Like this

vale glen
#

Yeah, colours are a variable

sturdy compass
#

That's 100% the crux of the problem. Don't try anything with self, that will BREAK!

vale glen
#

Eh? They... don't break though?

#

They're the prototype of a card, shared between instances of a card

#

While stuff accessed with card refer to the copy of the card

thorn furnace
hybrid shadow
sturdy compass
#

cuz the values could potentially be different

vale glen
#

Ehhhh... Depends on what you're doing with it. Can't imagine hand_type changing unless other cards take ownership of that Joker, to change that specifically

sturdy compass
vale glen
hybrid shadow
thorn furnace
sturdy compass
#

change all of your card.config.whatevers to card.ability.hand_type

hybrid shadow
# hybrid shadow

card is still nil, but even just center.config was returning overall nil for the line

sturdy compass
hybrid shadow
sturdy compass
#

because your loc_vars argument is still center

#

lol

hybrid shadow
#

wdym

sturdy compass
vale glen
#

pft

#

Axy's so used to just using self, info_queue, card that they never saw that

hybrid shadow
sturdy compass
#

I've gotten pretty good at sniffing out small things like that over the months I've bummed around here lol

vale glen
#

Why was it changed at all xD

sturdy compass
#

They changed it to center as a last ditch effort I assume

hybrid shadow
#

i do not remember why it's center (prob from the mod i copied to try and get the colours right)

thorn furnace
sturdy compass
thorn furnace
#

just a few qol ones

#

ill try disabling them

sturdy compass
#

You might just have a tiny typo in your pattern somewhere then ngl

daring fern
hybrid shadow
vale glen
#

yayyyy

sturdy compass
hybrid shadow
thorn furnace
hybrid shadow
sturdy compass
thorn furnace
#

okiii

vale glen
sturdy compass
# thorn furnace okiii
pattern = '''
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.06*G.SETTINGS.GAMESPEED, blockable = false, blocking = false, func = function()
    play_sound('tarot2', 0.76, 0.4);return true end}))
play_sound('tarot2', 1, 0.4)
used_tarot:juice_up(0.3, 0.5)
'''
thorn furnace
#

that seems a lot smaller

sturdy compass
#

it is lol

#

Sometimes my adhd brain wants to make extra sure I don't patch something I don't wanna 😭

thorn furnace
#

I'll test it out then
Got my jokers all ready dance

#

all 21 of them

sturdy compass
sturdy compass
#

Woohoo!!

thorn furnace
sturdy compass
#

Happy to help

thorn furnace
#

am i going to have to go through this for every single joker

sturdy compass
vale glen
#

Well, it worksssss qpMmm

#

Just wondering if using a different field would be better

thorn furnace
vale glen
stiff quiver
#

im getting this crash when looking at the joker outside of a run, how can i fix it? lua loc_vars = function(self,info_queue,center) return {vars = {center.ability.extra.chip_bonus * G.GAME.consumeable_usage_total.planet}} end, calculate = function(self,card,context) if context.joker_main then return { chips = card.ability.extra.chip_bonus * G.GAME.consumeable_usage_total.planet} end end,

sturdy compass
thorn furnace
daring fern
stiff quiver
#

ok thanks!

vale glen
thorn furnace
vale glen
daring fern
#

How does one allow for retriggers on a joker that doesn't return?

strange wasp
#

So, little bit of quick context, I am following along to the outdated YT video on how to make a joker and I'm at 4:52. So I finally got myself to the point to which I want to test to see if my Joker would be detected by smods and it seems to not show up.

thorn furnace
sturdy compass
#

But I wish you luck

strange wasp
#

Like I said, the video is outdated. Is there anything else I need to do for the Joker to appear in the game.

vale glen
daring fern
daring fern
stiff quiver
# daring fern `G.GAME and G.GAME.consumeable_usage_total.planet or 0`

got this crash with that lua loc_vars = function(self,info_queue,center) return {vars = {center.ability.extra.chip_bonus * G.GAME and G.GAME.consumeable_usage_total.planet or 0}} end, calculate = function(self,card,context) if context.joker_main then return { chips = card.ability.extra.chip_bonus * G.GAME.consumeable_usage_total.planet} end end, in_pool = function(self,wawa,wawa2) return true end

daring fern
sturdy compass
hybrid shadow
#

the funny part abt having a really good enhancement that's all suits means it gets debuffed by boss blinds that target suits 4x as often

manic rune
#

just have it unable to be debuffed, so shrimple

sturdy compass
#

What does your joker code look like then?

manic rune
#

sunny.json.json

sturdy compass
#

.jsom

umbral zodiac
#

jsom

manic rune
#

oh

#

sunny.jsom.json

#

sob

umbral zodiac
#

erm what the scallops

vale glen
#

main.lua.txt

manic rune
#

me when the arrow hops between messages

vale glen
stiff quiver
vale glen
#

main_fille

sturdy compass
#

main_fille

vale glen
#

badge_tect_color too

manic rune
#

G.GAME and G.GAME.consumeable_usage_total and G.GAME.consumeable_usage_total.planet or 0

vale glen
#

xD

#

There's so much happening here

strange wasp
sturdy compass
#

Lotsa typos in your metadata. Might wanna look it over. Likely the cause of your missing joker

#

main.lua.txt is DIABOLICAL

unkempt kestrel
#

how would one go about removing the main menu button

manic rune
#

badge tect colour

daring fern
sturdy compass
#

I'm so tired 😭

strange wasp
hybrid shadow
#

eternal... has no functionality of its own...?

sturdy compass
#

Correct lol

manic rune
#

lalala

sturdy compass
#

Eternal’s “functionality” is just other methods checking if a card has it lol

hybrid shadow
#

how do i make a sticker thats like eternal but for playing cards (the tarot card meant to apply it to playing cards already exists)

strange wasp
sturdy compass
#

How did it get messed up so bad????

daring fern
strange wasp
sturdy compass
hybrid shadow
strange wasp
#

I am so new to making mods. This is my first ever mod project.

hybrid shadow
thorn furnace
#

is there a version of G.playing_cards that works outside of game
My card keeps crashing because the preview keeps trying to access it

strange wasp
sturdy compass
thorn furnace
# sturdy compass Can you show the code you have have that’s accessing it?
set_ability = function(self, card, initial, delay_sprites)
        local valid_cards = {}
        for _, card in ipairs(G.playing_cards) do
            if not SMODS.has_no_suit(card) and not SMODS.has_no_rank(card) then
                valid_cards[#valid_cards + 1] = card
            end
        end
            
        local lucky_card = pseudorandom_element(valid_cards, pseudoseed('dragonsDreamLucky' .. G.GAME.round_resets.ante))
        if lucky_card then
            card.ability.extra.luckyHand = lucky_card.base.value
        end
        valid_cards[lucky_card] = nil
        local unlucky_card = pseudorandom_element(valid_cards, pseudoseed('dragonsDreamUnlucky' .. G.GAME.round_resets.ante))
        if unlucky_card then
            card.ability.extra.unluckyHand = unlucky_card.base.value
        end
    end
strange wasp
#

This is inside the mod folder.

hybrid shadow
sturdy compass
strange wasp
sturdy compass
#

And make sure you have fallbacks set

strange wasp
thorn furnace
#

i figured if there was some generic deck table I could pull from I would just use that instead

plain apex
#

can you check if other jokers do not trigger like how you can check if cards dont score?

sturdy compass
hybrid shadow
plain apex
#

how?

daring fern
thorn furnace
sturdy compass
#

Fair nuff

thorn furnace
#

nested ifs just kinda get under my skin sometimes

sturdy compass
#

Also fair lol

thorn furnace
sturdy compass
#

Oop yep

strange wasp
daring fern
#

Also the line was yellow.

strange wasp
#

Does it matter if it stays like that?

daring fern
cyan lagoon
#

anyone knows how to make partners for the partner mod?

daring fern
cyan lagoon
#

all mods i can find with partner compat are either not updated or not even out. or i'm just blind

daring fern
cyan lagoon
#

tried, it either didn't do anything or crashed

#

like i'll give it another shot but still

plain gazelle
#

I rewrote the code for that Joker I mentioned yesterday and XMult scaling works now for some reason.
I don't know how to change the card (like Idol) at the end of the round. I looked in the example Castle 2 code and I do not understand when reset_game_globals is called

daring fern
plain gazelle
#

Thanks, got it

subtle hawk
#

Does anyone know why the infoqueue is empty?

#

The description of the cards themselves is fine btw

plain gazelle
hybrid shadow
#

regardless, its a bit odd that it isnt crashing and instead leaving it blank

subtle hawk
#

If you're talking about here, then no, that definitely isn't the problem

#

Since descriptions on cards themselves work just fine. Commas on last lines aren't needed or smth like that

hybrid shadow
daring fern
subtle hawk
hybrid shadow
subtle hawk
#

Nope

hybrid shadow
#

hmm

subtle hawk
daring fern
plain gazelle
#

ok, now I know what reset game globals does but why doesn't it trigger at the end of round, there is no debug message in the console

I don't understand how the Castle 2 is coded. In VanillaRemade, there is a reset game globals function that triggers several other change suit/rank functions, but here it just triggers 1 block of code? But when I try to do the same thing Castle 2 did but with my Joker it doesn't work?

livid nimbus
cyan lagoon
#

both of our mods had -10 priority

livid nimbus
#

OK☺️

stiff quiver
#

how do i check if the card pack being opened is a standard pack (the one that gives playing cards)?

hushed field
#

What was the proper way to pass values from a calculate's return function back to the return from a SMODS.calculate_context call?

tall wharf
#

is it possible to use malverk to replace the whole sheet

cyan lagoon
#

that from the game source

stiff quiver
#

whenever base game used self it had to be changed to card right?

cyan lagoon
#

yeah

#

just replace self with card

cyan lagoon
thorn furnace
#

How would I have a Joker retrigger itself a certain amount of times?

cyan lagoon
#

you have the retrigger joker optional feature?

thorn furnace
#

retrigger joker optional?

cyan lagoon
#

yeah, it's not enabled by default

#

that's how you enable it

#

just put it into your main file

hushed field
thorn furnace
cyan lagoon
thorn furnace
#

it is enabled now

cyan lagoon
#

next i think you wanna check 'context.retrigger_joker_check and context.other_card == card'

thorn furnace
#

ok

cyan lagoon
#

oh and dont forget 'not context.retrigger_joker'

#

or it's just gonna retrigger itself over and over

thorn furnace
#

yea

#

what do i put inside the check to retrigger it

cyan lagoon
#

you return 'repetitions'

#

like context.repetition

thorn furnace
#

o

cyan lagoon
thorn furnace
#

like return { repetitions = 1 } repeats it once?

cyan lagoon
#

yeah

thorn furnace
#

neat

#

thank u :3

cyan lagoon
#

np

wintry solar
cyan lagoon
#

wot?

#

you mean you dont need to enable the retrigger_joker optional feature?

wintry solar
#

No the unscored area

cyan lagoon
#

i said that

#

(you dont need the latter)

wintry solar
#

No, you don’t need it

#

It doesn’t do anything

cyan lagoon
#

a

wintry solar
#

Unscored isn’t an optional feature

stiff quiver
#

was Ace id 1 or 14?

cyan lagoon
#

14

stiff quiver
#

ok thanks

cyan lagoon
wintry solar
#

Yes

cyan lagoon
#

aight

long ruin
faint yacht
#

context.cardarea.cards ends up as nil if I play these 4 cards... because of the unscoring cards?

(3) Lua global 'ReverseTable' at file 'togastuff.lua:513' (from mod with id TOGAPack)
    Local variables:
     t = nil
     rt = table: 0x1e87daf8  {}
     (*temporary) = number: 7.17034e-164
     (*temporary) = table: 0x1e122f18  {click_offset:table: 0x1e1232e8, ignore_base_shader:table: 0x1de20530, children:table: 0x1e3cea38, ambient_tilt:0.2, parent:table: 0x1e6fb330 (more...)}
     (*temporary) = table: 0x1dcb70a8  {poker_hands:table: 0x1e0fc6a0, cardarea:unscored, scoring_name:Pair, scoring_hand:table: 0x1e0f69d8, full_hand:table: 0x1e5ba9d8, main_scoring:true (more...)}
     (*temporary) = table: 0x1e0c5f60  {1:1}
     (*temporary) = number: 2
     (*temporary) = number: 1
     (*temporary) = string: "attempt to get length of local 't' (a nil value)"
(4) Lua field 'preprocess' at file 'togastuff.lua:526' (from mod with id TOGAPack)
    Local variables:
     cards = nil
     context = table: 0x1dcb70a8  {poker_hands:table: 0x1e0fc6a0, cardarea:unscored, scoring_name:Pair, scoring_hand:table: 0x1e0f69d8, full_hand:table: 0x1e5ba9d8, main_scoring:true (more...)}
     output = nil
(5) Lua upvalue 'calcmainscoreref' at Steamodded file 'src/utils.lua:1807' 
    Local variables:
     context = table: 0x1dcb70a8  {poker_hands:table: 0x1e0fc6a0, cardarea:unscored, scoring_name:Pair, scoring_hand:table: 0x1e0f69d8, full_hand:table: 0x1e5ba9d8, main_scoring:true (more...)}
     scoring_hand = table: 0x1e0f69d8  {1:table: 0x1e7b3d90, 2:table: 0x1dd74188}
(6) Lua field 'calculate_main_scoring' at file 'togastuff.lua:539' (from mod with id TOGAPack)
    Local variables:
     context = table: 0x1dcb70a8  {poker_hands:table: 0x1e0fc6a0, cardarea:unscored, scoring_name:Pair, scoring_hand:table: 0x1e0f69d8, full_hand:table: 0x1e5ba9d8, main_scoring:true (more...)}
     scoring_hand = table: 0x1e0f69d8  {1:table: 0x1e7b3d90, 2:table: 0x1dd74188}
long ruin
maiden phoenix
faint yacht
#

Well, the original function doesn't seem to be checking explicitly for it, no?

wintry solar
#

you can't blanket use context.cardarea.cards in any context

faint yacht
#

Well, as I am patching such anyway...

function SMODS.calculate_main_scoring(context, scoring_hand)
    local curcards = togabalatro.preprocess(context.cardarea.cards, context)
    for _, card in ipairs(curcards) do

...do I toss a check in here then?

long ruin
#

i think i have a problem with my consumable key, anyone can help me ?

wintry solar
#

I mean I have no idea what your functions do, but I'd just pass the context to your preprocess function and do any checks necessary in there

#

it'd keep this hook cleaner

faint yacht
wintry solar
#

yeah so do all your checks in there

thorn furnace
#

what does collection_rows mean here?

faint yacht
#

Which exact ones? For specific context.cardareas?

maiden phoenix
thorn furnace
#

o

clever rose
#

is there a way to determine the winning hand? i was going to make a joker that applied a purple seal to each card in the winning hand

thorn furnace
#

So I want a consumable that's usable on a select few different Jokers
How would I go about making sure it can't be used unless the selected joker is one of those jokers

faint yacht
#

In can_use, iirc, return true if cards in G.jokers.highlighted ('tis a table) match the keys.

wintry solar
faint yacht
#

Which doesn't really let the "backwards" scoring occur after the initial "forwards" one.

#

If I do this, however, it works.

togabalatro.preprocess = function(context)
    local output = context.cardarea and context.cardarea.cards or nil
    if not output then
        if context.cardarea == G.play then output = context.full_hand
        elseif context.cardarea == G.hand then output = G.hand.cards
        elseif context.cardarea == 'unscored' then output = context.full_hand end
    end
    
    if not output then return end
wintry solar
#

there should never be a context.cardarea == 'unscored' anyway

faint yacht
#

...so that's saying that my checks are fine? 'cause this basically more or less (I hope--) fixed why I was on the goose chase yesterday for a good while through the entire day.

cyan lagoon
#

how to do i create a bunch of playing cards from a table?

wintry solar
#

well unless you're doing other stuff or are on a very old smods build, this cardarea should never be unscored in this function

faint yacht
#

cards variable is no longer existent, anyway.

stiff quiver
#

how could i make a joker apply a boss blind effect on the start of the round?

cyan lagoon
#

how do i return something multiple times?

faint yacht
#

{ extra = { xmult = ..., extra = { xmult = ... } } }

cyan lagoon
#

card.ability.extra.shots can scale infinitely. would that still work here?

faint yacht
#

You'd probably want to do a recursive table prep, which you then return.

manic rune
#

whats the difference between a recursive table and a loop with multiple SMODS.calculate_effect? 🤔

thorn furnace
#

I'm so confused

unborn bay
#

what is your smods version

thorn furnace
#

uhh lemme check

#

1.0.0~BETA-0511b-STEAMODDED

keen loom
#

should i even bother adding joker display support?

long ruin
#
    key = 'Jokers', --joker key
    atlas = 'Jokers', --atlas' key
    rarity = 4, --rarity: 1 = Common, 2 = Uncommon, 3 = Rare, 4 = Legendary
    soul_pos = { x = 1, y = 0 },
    cost = 5, --cost
    unlocked = true, --where it is unlocked or not: if true, 
    discovered = true, --whether or not it starts discovered
    blueprint_compat = true, --can it be blueprinted/brainstormed/other
    eternal_compat = false, --can it be eternal
    perishable_compat = false, --can it be perishable
    pos = {x = 0, y = 0}, --position in atlas, starts at 0, scales by the atlas' card size (px and py): {x = 1, y = 0} would mean the sprite is 71 pixels to the right
    config = { extra = { mult = 4 }, },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                mult = card.ability.extra.mult
            }
        end
    end
}

SMODS.Joker{
    key = 'Jokers', --joker key
    loc_txt = { -- local text
        name = 'Sequel the Sequel',
        text = {
          'When Blind is selected,',
          'create a {C:attention}Joker{}',
          '{X:mult,C:white}X#1#{} Mult',
          'Gain {C:money}123${} at end of round'
        },
        --[[unlock = {
            'Be {C:legendary}cool{}',
        }]]
    },
    atlas = 'Jokers', --atlas' key
    rarity = 4, --rarity: 1 = Common, 2 = Uncommon, 3 = Rare, 4 = Legendary
    cost = 5, --cost
    unlocked = true, --where it is unlocked or not: if true, 
    discovered = true, --whether or not it starts discovered
    blueprint_compat = true, --can it be blueprinted/brainstormed/other
    eternal_compat = false, --can it be eternal
    perishable_compat = false, --can it be perishable
    pos = {x = 0, y = 1}, --position in atlas, starts at 0, scales by the atlas' card size (px and py): {x = 1, y = 0} would mean the sprite is 71 pixels to the right
    config = { 
      extra = {
        Xmult = 4 --configurable value
      }
    },
    loc_vars = function(self,info_queue,center)
        info_queue[#info_queue+1] = G.P_CENTERS.j_joker --adds "Joker"'s description next to this card's description
        return {vars = {center.ability.extra.Xmult}} --#1# is replaced with card.ability.extra.Xmult
    end,
    check_for_unlock = function(self, args)
        if args.type == 'derek_loves_you' then --not a real type, just a joke
            unlock_card(self)
        end
        unlock_card(self) --unlocks the card if it isnt unlocked
    end,
    calculate = function(self,card,context)
        if context.joker_main then
            return {
                card = card,
                Xmult_mod = card.ability.extra.Xmult,
                message = 'X' .. card.ability.extra.Xmult,
                colour = G.C.MULT
            }
        end

        if context.setting_blind then
            local new_card = create_card('Joker', G.jokers, nil,nil,nil,nil,'j_joker')
            new_card:add_to_deck()
            G.jokers:emplace(new_card)
        end
    end,
    in_pool = function(self,wawa,wawa2)
        --whether or not this card is in the pool, return true if it is, return false if its not
        return true
    end,
    calc_dollar_bonus = function(self,card)
        return 123
    end,
}
#

Hi guys ! got a problem, my second joker wont spawn...

unborn bay
thorn furnace
#

oki

long ruin
#

between the legendary and the m, it should be an exodia joker