#💻・modding-dev

1 messages · Page 377 of 1

manic rune
#

so yeah, G.GAME.dollars becomes a table

cursive sentinel
#

i put it anywhere in the code above, not necessarily the smods.koker?

#

(what's talisman?)

manic rune
#

yes, to_big = to_big or function(x) return x end is to ensure that when talisman is not installed, you wont crash

#

uhhh

#

how do you not know of it

#

😭

daring fern
cursive sentinel
#

idk im kinda new, started coding just last month :c

manic rune
#

yeah but its like the most popular lib mod rn

cursive sentinel
#

ahh i dont play mods a lot

manic rune
#

anyways, all it does is basically uncapping numbers

#

by turning them into tables

#

-# and making modders suffer from adding talisman compat

#

somethingcom adding talisman compat is ass and you aint telling me otherwise

#

🥀

cursive sentinel
#

and do i have to add to_big on every of my variables?

manic rune
#

i mean, depends on the mod i guess??

#

bsr was absolute ass to work with

cursive sentinel
#

could i watch a code that has it so i can check how it's done in practice?

manic rune
daring fern
# daring fern

Defining it if it doesn't exist, planet and taking ownership of mr. bones, respectively.

manic rune
#

its only some variables that actually need to_big, but if you dont really know what you are doing then id suggest just using to_big on everything

cursive sentinel
manic rune
#

we should probably make a full list of vars that need to_big 🤔

manic rune
daring fern
#
G.GAME.dollars
G.GAME.hands["hand"].level
G.GAME.chips
G.GAME.blind.chips
hand_chips
mult
``` is all I can remember.
manic rune
#

i think mult, hand_chips (the global vars) too?

cursive sentinel
manic rune
#

🤔 not sure

cursive sentinel
#

i do this first then?

manic rune
#

yes

cursive sentinel
daring fern
cursive sentinel
#

alrightyyy doing that

#

and just in the if condition, it doesnt need to contain the to_big within the if too?

manic rune
#

wuh

cursive sentinel
#

like

if to_big(blabla) <= to_big(G.GAME.dollars) then
  to_big(blabla) ?
end
cursive sentinel
#

i can just call it blabla

daring fern
#

You only need to to_big it when comparing it with a table.

cursive sentinel
#

alright thanks!

#

do i need for fors?

#

like here?

#

ah it's not hands.level

#

mb

daring fern
cursive sentinel
strange tiger
#

hey, how would i go about making custom card skins?

daring fern
hard flume
#

Hmm... I really wanted to get the Pikmin Suit Storage working tonight...

fading geyser
#

Hi, I'm hoping to make an alternate version of blueprint, but unsure where to start. Does anyone have any ideas on what to do?

daring fern
strange tiger
fading geyser
#

no, something a bit more unique. If it's relevant I'm planning to copy the ability of joker to the right and give it to joker to the left, which I can figure out how to do like baseball card, it's just the blueprint part I'm stuck on

daring fern
fading geyser
#

yes

#

I found this in the code, would it be useful?

daring fern
fading geyser
#

SMODS.buleprint_effect? It's built in?

daring fern
fading geyser
#

well, couln't copier be set to G.jokers.cards[i-1]?

daring fern
#

It doesn't activate the effect for you though.

fading geyser
#

wdym?

daring fern
# fading geyser wdym?

It calculates the joker you give it based on if it is blueprint compatibility then it gives you the result.

fading geyser
#

ah that makes sense

#

what would I put in context

daring fern
fading geyser
#

oh yeah, obviously. I can be a bit shortsighted at times 😅

#

Thanks!

indigo mesa
#

how would i go about making a pokerhand with a modded rank? like how would i check for that rank?

#

'(mod prefix)_(rank key)'?

strange tiger
fading geyser
#

that was my first thought

indigo mesa
fading geyser
#

welp

indigo mesa
#

also tried with only the key and doesnt work

#

:(

fading geyser
#

i'm out of ideas

daring fern
indigo mesa
indigo mesa
daring fern
indigo mesa
# daring fern Yes, but where did you check for that.

evaluate = function(parts, hand)
if hand == nil then
return {}
end
if #hand ~= 3 then
return {}
end
local _tick = 0
if hand[1]:get_id()=='idk_G' then
_tick = _tick + 1
end
if hand[2]:get_id()==13 then
_tick = _tick + 1
end
if hand[3]:get_id()=='idk_Y' then
_tick = _tick + 1
end
if _tick == 3 then
return {hand}
end
end
}

daring fern
indigo mesa
pure salmon
#

is there an easy way to make a consumable do that thing that WoF and vouchers do where they get pulled into the center of the screen and send a message

fading geyser
daring fern
# fading geyser Code didn't work 😦 any ideas?

I meant something like this ```lua
--- my_pos = get joker position
local effect = SMODS.blueprint_effect(G.jokers.cards[my_pos-1], G.jokers.cards[my_pos+1], context)
SMODS.calculate_effect(effect, G.jokers.cards[my_pos-1]

#

Also use card not self

fading geyser
#

alr thx

cursive sentinel
#

question, in here, is there a way to show the list of c.a.e.hands[context.scoring_name]'s true values in like a toolbox (like the info_queue)?

if context.before and context.main_eval then
  card.ability.extra.hands[context.scoring_name] = true
end
blissful atlas
#

anyone know how i can figure out which cards are currently in the shop

daring fern
blissful atlas
daring fern
blissful atlas
#

yeah specifically joker

#

i wanna make amod that rerolls until specific jokers show up

daring fern
blissful atlas
#

also is there a way to hot reload mods

#

or do i need to rs game each time

daring fern
blissful atlas
#

sadge

daring fern
#

How does one make a joker move itself?

#

I looked at handy and it seems I have to move it manually.

flat sorrel
#

"move itself" meaning?

strange tiger
#

Hi again, how would I go about making a mod that adds new playing card skins?

daring fern
daring fern
dark roost
#

man this is the second time in a row where I reference basegame to copy a function call and I forget to replace the "self" with "card" and it just does nothing.

#

I love how mods are structured completely differently from the normal game

midnight coyote
#

how would i modify the '6 of spades' text?

shell timber
#

that'd probably need a lovely patch

midnight coyote
flat sorrel
midnight coyote
#

or if its suitless it just says '6'

#

stonecards have

shell timber
#

you should add a mask to the draw so it only shows the suit symbol

midnight coyote
#

i know what draw is but ive never touched it really

#

oh i see

#

add a mask to the sprite draw that hides the number value

shell timber
#

actually that'd probably be more effort than it's worth

midnight coyote
#

okay so i need to modify the game's code to make this text accessible

#

woo

#

okay

#

isnt a lovely patch just search and replace

shell timber
#

uh basically

#

or "search and put before" or "search and put after"

midnight coyote
#

so if i can find this text i could patch in an accessible way to get to it

#

tbh this sounds like something i could push into smods if i do it good enough

strange tiger
shell timber
#

that's not a bad idea, yeah

midnight coyote
#

i could modify whatever function generates the ui to also accept a string that is displayed

#

so you could in theory just add in whatever string you wanted to

#

but id also need to maintain compatibility with the base game

#

so maybe i make it a hook then? check for the presence of the arg and if its there change the text

#

im not quite sure how the base game does it though, so i should probably look at that

#

im gonna guess its either in card.lua or ui_definitions.lua

#

ill worry abt it later

cyan lagoon
#

how do i change the card order in the deck?

#

hibana does it in aiko mod, but i dont understand how it works

shell timber
#

you could probably meddle with G.deck.cards but idk

plain apex
#

can you get the value of how many cards have been destroyed this run? do they store that anywhere?

cyan lagoon
#

think you have to hook for that if you want "this run" specifically

plain apex
#

damn idk how to hook

cyan lagoon
#

basically you put a function into a local then you overwrite that function and call local

#

sorta like this

#

basically you add your code to the function is what you're doing

smoky isle
blissful atlas
#

how can i extract joker info from the cards in the shop?

#

i understand its in shop_jokers.cards but i cant figure out what

#

how can i run code after shop reroll??
the actual joker calculation occurs in the event inside G.FUNCS.reroll_shop so i cant do this:

local _reroll_shop = G.FUNCS.reroll_shop

function G.FUNCS.reroll_shop(e)
    _reroll_shop(e)

    for k, v in ipairs(G.shop_jokers.cards) do
        print(v.edition)
    end
end
pastel remnant
#

I'm trying to make a joker (first time doing balatro modding or using lua) that scores based of off the number of cards you play, how would I do that?

#

I mainly need a way to get the value of the number of cards played

brazen tusk
pastel remnant
#

all

#

like physic

brazen tusk
#

#context.hand maybe? Gimme a sec

#

Getting on my pc so I can check

pastel remnant
#

thank you

red flower
#

#context.full_hand

pastel remnant
#

ok thank you

#

now to work out how to do this rest of this

brazen tusk
#

What’s it giving based on that

pastel remnant
#
  • mult
#

it takes the factorial of that number and adds that to the mult

#

so if u play 5 cards +120 mult

#

24 if u play 4 cards etc

lusty bear
#

hello , I'm a develloper and I'm interessted into the balatro mod community, is there a documention or something ?

pastel remnant
lusty bear
pastel remnant
#

idk

primal robin
#

It is

pastel remnant
#

I only just started too

lusty bear
#

a okok

brazen tusk
lusty bear
primal robin
#

Be ready for a tons of spaghetti code

pastel remnant
#

I doubt it

lusty bear
pastel remnant
#

that seems to simple if I've learned anything from other modding I've done

brazen tusk
#

no js mult =

pastel remnant
#

ah

#

yay

#

simple

#

mult = mult +?

wintry solar
#

I might make an actual "make your first joker" guide after I've finished calc docs

brazen tusk
primal robin
#

And yandere-dev mode

reef flower
#

anyone knows how to make custom type?
wanna make something similiar to vouchers but in packs

brazen tusk
#

I'd just make them vouchers but get them to not show up in the shop maybe?

reef flower
#

is it even possible?
especially when wanting more levels of em

#

(Lv 1 to Lv 5)

brazen tusk
#

simplest way i can think of is to just make it a consumable that changes some stuff globally?

scarlet storm
#

hiii
I'm making my first balatro mod and I've designed some custom jokers , opinions? :3 also pls lmk if these are super similar to any existing cards or seem unbalanced

pastel remnant
#

those are actually super unique rebuffed especially is very cool

primal robin
#
  1. looks good, weak even for common
  2. meh
  3. ok look, but weak?
  4. idk
  5. good one, actully
scarlet storm
#

it requires some set up

primal robin
#

Full lucky-based

pastel remnant
#

if u add dice in it could very good

scarlet storm
#

yeah

pastel remnant
#

maybe make it 1/4 idk

brazen tusk
#

i think thats too strong then for every card to have a 25% chance to retrigger 4 times

primal robin
#

photograph is common, gives 2x for any face card

your is uncommon, require jacks, and only 1.1x

pastel remnant
#

yeah 1/6 feels reasonable

scarlet storm
pastel remnant
scarlet storm
#

I'll change it to 1.5x, would that be better?

primal robin
brazen tusk
#

i'd at least do 1.25

pastel remnant
#

indeed

pastel remnant
primal robin
#

1.25 is closer to truth

scarlet storm
#

I also made this but it was more a joke card and I'll probably remove it in the final mod unless others think it's good

brazen tusk
pastel remnant
#

that's good

brazen tusk
#

and no retriggers

primal robin
#

Is easy to get 5 jacks?

pastel remnant
brazen tusk
#

definitely needs building towards though

primal robin
#

Then why Hit the Road weak?

brazen tusk
#

bc it demands a lot of resources just to reset

#

i've never found it an optimal use of time during a run but it can be good

lusty bear
#

you have to do spritesheet for jokers ?

brazen tusk
#

dont have to, can do it individually

#

most go for a sheet though

lusty bear
#

yeah that's what I saw

primal robin
#

I preffer individuals

lusty bear
#

i think I'll go individual for the test

#

do you have something for update the script without open and close balatro ?

brazen tusk
#

nope

#

not that im aware of

#

debugplus is useful though i've heard if you dont have it

#

haven't used it yet myself

pastel remnant
#

hm

lusty bear
#

you forgot to clos your function ?

pastel remnant
#

I tried that

#

and it didn't work either

brazen tusk
pastel remnant
#

I found it

#

let me see if it works

#

like this?

brazen tusk
#

squiggly bracket to close the calculate function

lusty bear
#

why you didnt do local tempval ?

pastel remnant
lusty bear
#

nvm lmao

pastel remnant
#

have now put it back lol

lusty bear
#

so it's was the end ?

cobalt iron
#

Is there a command that closes the game?

pastel remnant
lusty bear
#

why it make the game crash lmao ?

pastel remnant
#

idk

#

it wont open

lusty bear
#

well go back in global ig, but I found that kinda messy

pastel remnant
#

look so long as any tempval is set to 0 in the game its fine

brazen tusk
cobalt iron
pastel remnant
#

I am so annoyed

brazen tusk
#

will be a little behind

lusty bear
#

no nvm it's doesn't make sens what I'll say

#

mb

brazen tusk
#

full hand is a table yeah

#

has the info for all the cards you play in there

pastel remnant
#

I was told it was the # of cards played

brazen tusk
#

yeah

#

bc you put # in there

pastel remnant
#

ah okkk

lusty bear
#

cuz I remmebered table in lua start by one and not zero

brazen tusk
#

so its the number of cards the full hand has in it

pastel remnant
#

I've only ever coded in python lol

pastel remnant
lusty bear
#

try idk

brazen tusk
#

shouldnt need to

lusty bear
#

but I remember in lua the default index is one

brazen tusk
#

ill try it out myself

lusty bear
#

so idk it cause problem

pastel remnant
#

either way that's not the problem

lusty bear
#

yeah

daring fern
pastel remnant
#

I have a sneaky suspicious that may need some messy code but I know there's the pinned tag so it should be possible

brazen tusk
#

yeah taking a look at pinned tag would be my suggestion

pastel remnant
#

I am getting increasingly annoyed at this

#

its saying line 56

#

but

#

that's not line 56

lusty bear
#

what the console sayed ?

brazen tusk
#

whats on line 56?

pastel remnant
#

the return

brazen tusk
#

the start of it?

pastel remnant
#

its still saying this

pastel remnant
brazen tusk
#

oh you dont need an end on the return

pastel remnant
pastel remnant
primal robin
#

You better learn lua first, then back to modding. Seriously

brazen tusk
#

nahhh

pastel remnant
brazen tusk
#

maybe watch a short video on it but i've learned what i know from just throwing myself in the deep end, i'd say its fairly effective

lusty bear
#

lua is really easy , you can learn it with this honnestly I think

brazen tusk
#

agree

lusty bear
#

the only think that will be tricky would be organising yourself after

pastel remnant
#

it does seem fairly similar to what I know

lusty bear
#

what language u use ?

pastel remnant
#

I've learned python before

lusty bear
#

fair enough honnestly

pastel remnant
#

which may explain why the indentation stuff is what I've got wrong

#

also yes its still broken

primal robin
#

Me as JS dev when there's basically nothing in Lua: ehehe

lusty bear
#

I doesn't know much about python, but I know lua, C,C++ and C#

lusty bear
brazen tusk
pastel remnant
brazen tusk
#

tis not ugly!

primal robin
#
  • looks inside
  • no functions for anything
  • bummer
lusty bear
brazen tusk
#

make em yourself!

#

the beauty of it

primal robin
#

An on top of that, indexes started from 1

brazen tusk
#

i dont see that as an issue personally

lusty bear
#

one of my first project was a connect 4 , I doesn't knew how to use table, so I coded every winning condition possible

#

that was beautiful

#

I have a screenshot of the code if you want to check it lmao

pastel remnant
#

oml

primal robin
#

That's how balatro works basically

pastel remnant
#

like you coded every place you could get 4 in row?

#

like a manual check?

#

for each

pastel remnant
primal robin
#

Only 10 of 10?

next timber
#

what is the difference between an event with trigger 'after' and trigger 'immediate'? does immediate trigger at the same time as the previous event?

brazen tusk
#

classmate of mine does that in ue5, just a bunch of branch nodes stacked

pastel remnant
pastel remnant
#

like maybe a double for loop I think

brazen tusk
pastel remnant
#

so instead of like 5 lines it was 50

#

I should probably try and work out this rather than continue to talk abt stupid code choices

primal robin
#

Maybe one day he notice that he's doing code inside table definition

pastel remnant
#

add mult based on number of cards played

daring fern
primal robin
#

Isn't IDE tells you that you have invalid syntax?

lusty bear
daring fern
primal robin
manic rune
#

is it a good practice to use #(context.scoring_hand or {}) instead of just #context.scoring_hand

brazen tusk
#

oh lord

manic rune
#

since im scared it might be nil

lusty bear
#

500 lines

pastel remnant
#

this one should I believe but it doesn't say anything

pastel remnant
red flower
pastel remnant
#

also should it be mult = rather than mult = mult +

pastel remnant
brazen tusk
#

depends

runic pecan
#

When I take_ownership a vanilla object, can I make it not appearing in modpage/addition, or make it not show mod badge?

brazen tusk
pastel remnant
#

it should be mult = ?

brazen tusk
pastel remnant
#

thanks

manic rune
#

so it can only be {} if context.scoring_hand got all the cards in it removed?

primal robin
# lusty bear 500 lines

Since you need this anyway, unzip game executble and just take a look at what is happening inside game

red flower
pastel remnant
#

ok its still unsurprisingly broken the same way

brazen tusk
pastel remnant
primal robin
#

Yes you

pastel remnant
#

Don’t use… whatever

primal robin
#

At least lua syntax

pastel remnant
#

I do not have any clue what that means I got the mod file from a tutorial and am adapting it

primal robin
#

So you're trying to do smth without understaning what you're doing and how to do it in a first place

pastel remnant
#

Vaguely yeah but that’s how I generally go with this kind of thing and work it out how it works once I get it working

#

I find it works well for me

primal robin
#

That's not how programming works

brazen tusk
#

how it worked for me

#

i picked up a tutorial and asked questions

pastel remnant
#

Yeah I have some basic knowledge of how it works I mean I can kind of understand this already

primal robin
#

I can explain what's wrong with your code and why but it will be TL:DR and be better to figure out yourself

brazen tusk
#

bro js tell them the problem 💀

pastel remnant
#

Can you tell me simply how to fix it then I will fix it and work out what I was doing wrong maybe by asking the a question or two

primal robin
#

Fine.

#
calculate = function(self, card, context)
    if context.joker_main then
        return {
            card = card,
            mult = 1 + #context.full_hand
        }
    end
end
brazen tusk
#

oh it was in the return i see

primal robin
#

depends on what effect you want code is different

pure salmon
brazen tusk
#

^^

pastel remnant
#

I’m not at my laptop rn

#

In a moment I’ll see if u changed anything else and that’s what it needs

#

Or do I need to define a function elsewhere and call that on #context.full_hand

brazen tusk
#

ive got it working decently well on my end just needs some tweaks

primal robin
#

1 + #context.full_hand in my book is adding

pastel remnant
#

#

If u play five cards it should add 120

#

4, 24

#

3, 6

#

2, 2

#

1, 1

primal robin
#

aka factorial

pastel remnant
#

Yes

#

!

brazen tusk
#

what im doing is just multiplying in a for loop and increasing the value

pastel remnant
#

That’s what I did

#

I can’t tell what the problem is

primal robin
#

In this case

calculate = function(self, card, context)
    if context.joker_main then
        local tempval = 1
        for i = 1, #context.full_hand do
            tempval = tempval * i
        end
        return {
            card = card,
            mult = tempval
        }
    end
end
pastel remnant
#

Ahhh

#

I seee

dapper sun
#

what does playing_card_joker_effects do?

faint yacht
#

Could probably have a local function that automatically does the factorial calculation for you.

pastel remnant
#

It’s probably simpler this way it’s not too complex

#

Unless I end up reusing it I’ll keep it like this

brazen tusk
#

i did it this way forgetting the index already does what tally does 💀

    calculate = function(self, card, context)
        local tally = 1
        local val = 1
        if context.joker_main then
            for i = 1, #context.full_hand do
                val = val * tally
                tally = tally + 1
            end
            return {
                card = card,
                mult = val
            }
        end
    end
red flower
#

or however it's called

dapper sun
#

ah

#

so it tells the game that cards are being added?

red flower
#

yes

dapper sun
#

cool

pastel remnant
#

I need a mod to spawn in a joker don't I

red flower
#

debugplus

brazen tusk
#

no you can just launch the game in dev mode

#

i cannot remember how to do that though you'd have to look it up

pastel remnant
brazen tusk
#

hold tab?

#

if its the same as the dev tools

#

just go into the collection and press 3 on it

red flower
brazen tusk
#

true was js noting you don't need it

pastel remnant
#

holding tab then press 3 does nothing

brazen tusk
#

on the joker in the collection

#

dont need tab

pastel remnant
#

ah thank you

brazen tusk
#

but does pressing tab bring up the menu?

pastel remnant
#

yes

#

ok I didn't get the name or the sprite right but I'll work that out

#

but it works

brazen tusk
#

nice!

#

you'll prob want a localisation file rather than local text

#

depending on how big you are planning the mod to be

pastel remnant
#

there is no plan its whatever random math joker I come up with

brazen tusk
#

fair enough

#

currently trying to get this working but i think context.destroy_card is creating conflicts, not sure how to solve it

wintry solar
#

What do you mean?

brazen tusk
#

the effect was working before adding in context.destroy_card and now it isn't

wintry solar
#

Oh

#

Remove context individual

brazen tusk
#

i need that for each card to give their chips, would i do them seperately in that case?

brisk rose
brazen tusk
#

oh ok

#

ty

manic rune
brisk rose
brazen tusk
#

that first glittery one is awesome

#

i mean they all are but that particularly

pastel remnant
#

the tentacles is very different to what I've seen

thorn flame
#

how does the tentacle one look on another joker

brisk rose
#

it's a project elbe started and me and atrmnn are continuing

pastel remnant
#

ah

brazen tusk
#

ahhh

#

i see

#

arguably cooler now that i know what it is

brisk rose
#

I've only been working on this one shader-related file

scarlet storm
#

ive been struggling to make this joker for like an hour im going insane can someone help with the code hh

native zinc
#

this wording pains me

scarlet storm
#

I just fixed the description don't worry

native zinc
#

this feels like a consumable's job

#

uhhh you can probably make

#

well things after sell are hard to do inside the joker i feel

scarlet storm
#

weh,

#

should I make it do something different or keep the idea

brazen tusk
#

the first way im thinking of doing it is having a function outside of the joker that gives x5 mult as long as a value is true but turns itself false

#

then setting that value true when selling the joker

scarlet storm
#

uuh ok I think I understand

native zinc
#

has to do it next hand though

#

so check context

#

then set back to false after context triggers

pastel remnant
native zinc
#

ye

pastel remnant
#

oh

native zinc
#

it's a bit scuffed but it works

scarlet storm
#

I have No Idea how to translate this to code

brazen tusk
#

do the joker part first, easy win

scarlet storm
#

I already have the joker code written i think

#

lemme change smth rq

brazen tusk
#
if context.selling_self then
    globalvariablenamehere = true
end
#

shortest calc function ever

scarlet storm
#

ok yeah

#

so I did that right

pastel remnant
#

uh so I'm trying to change the atlas names from jokers and joker but now its broken again and I can't tell why

#

anyone know?

scarlet storm
#

and making sure the mult applies to the next hand

pastel remnant
brazen tusk
pastel remnant
#

ok...

brazen tusk
#

idk if its needed but its good practice for sorting imo

normal crest
#

I mean, it's not gonna stop working if they're the same, but it's not needed

pastel remnant
#

kkkk

cursive sentinel
#

is it possible to update a G.localization.descriptions.Other dynamically? does someone knows of a mod that does it?

thorn flame
#

atlas is whatever you set it to in the main lua files

manic rune
#

hi srockw

normal crest
#

Hi bepis, balatro star rail creator

manic rune
#

i made another mod because i was burnt out from drawing art

#

:3

normal crest
#

yggdrasil

manic rune
#

i added crafting, inventory and a leveling system that save for the entire profile

pastel remnant
#

damn

normal crest
#

I haven't touched Balatro in months, Paperback even did the whole looking for programmers thing cus I stopped working on it

bleak crane
normal crest
#

more like I lost interest in the game itself

manic rune
#

oh

#

fair, im only interested in balatro because of the stuff i can make in it primarily honestly :p

pastel remnant
manic rune
#

-# and people i can talk to in here

pastel remnant
#

yes

manic rune
pastel remnant
#

the code will be able to tell their different

#

it still doesn't work

brazen tusk
#

i dont see why it wouldnt

normal crest
#

What's the name of your png file

pastel remnant
#

if I had a nickle for every time I was making a mod and it was some issue so tiny not even the people capable of helping me would notice I would be rich

brazen tusk
#

as would the rest of us lol

pastel remnant
#

that's the name

normal crest
#

Is it a PNG

pastel remnant
#

I am

#

objectivly an idiot btw

brazen tusk
#

do you have it in both 1x and 2x?

pastel remnant
#

yes

brazen tusk
#

hm

pastel remnant
#

it was a jpg

#

I am fixing it

brazen tusk
#

ahh

normal crest
#

glad to help

thorn flame
#

dont worry

brazen tusk
#

we all have dumb oversights like that xD

thorn flame
#

We all fuck up stupid style anyway

brazen tusk
#

best way to put it

pastel remnant
#

its because the image editor I used does jpg by default

brazen tusk
#

i somehow got the localisation files of my two mods switched around yesterday and was confused as to why my jokers were only getting descriptions when both mods were active

bleak crane
#

moving on from my other joker cuz im stumped

im trying to make a card that retriggers all 4s and Aces, any idea why this wont work?

pastel remnant
#

that needs some improving

cursive sentinel
#

i have a joker that retriggers lucky cards, it is

if context.repetition and context.cardarea == G.play
        and context.other_card.ability.name == 'Lucky Card' then
  return {
    message = localize('k_again_ex'),
    repetitions = reps,
    card = context.blueprint_card or card
  }
end
pastel remnant
#

and it seems to be lagging the game ton now

brazen tusk
pastel remnant
#

I think I just got the border wrong lol

#

mainly

cursive sentinel
#

this should work if im not idiot

bleak crane
#

i got it working using the sock n buskin code,,, i shouldve done this before >~<

cursive sentinel
#

idk what context.repetition_only is for though 🧐

bleak crane
#

idk either !!

cursive sentinel
#

also i think the "again" message procs on jokers and not cards, but i may be wrong

#

(and using localize is better for localization)

#

(cuz here it'll show "Again!" in the portuguese version too)

faint yacht
#

context.repetition_only are repetitions produced by the card itself, not by a given Joker.

cursive sentinel
#

is there a point of excluding it of contexts?

#

i hadnt put it on my owns, so i may have forgotten something

faint yacht
cursive sentinel
#

but i havent noticed weird interactions so..

pastel remnant
cursive sentinel
#

is there a downside not putting it in?

cursive sentinel
faint yacht
#

repetition_only in Vanilla is used by the Red Seal for retriggering.

bleak crane
#

also while im getting help, any idea how i would begin to make this

pastel remnant
#

on my image editor I'm using

pure salmon
#

if you're on pc you can build aseprite from source

cursive sentinel
pastel remnant
#

its fine lol its not that important

cursive sentinel
pure salmon
#

it might be a night of headaches but aseprite is SO much better than anything else for pixel art

faint yacht
cursive sentinel
bleak crane
pure salmon
cursive sentinel
brazen tusk
pastel remnant
#

pixlr its called

#

I'm used to it tho

#

so i'll keep using it

brazen tusk
cursive sentinel
#

i mean, first placeholders

cursive sentinel
bleak crane
#

weeh,

cursive sentinel
#

the concept's fun though

#

the sacrificial lamb joker

scarlet storm
#

im rly proud of all my jokers

cursive sentinel
#

also i guess the x5 would proc at the very end right?

scarlet storm
#

ummm im not really sure

cursive sentinel
#

sry typed in the wrong words

#

i type like i pronounce, and im french

scarlet storm
#

I guess very end would make sense

brazen tusk
#

end of the next hand yeah

cursive sentinel
#

poor solution would be to create a specific joker that can only be created this way, negative, doing x5 and destroying itself upon doing so

brazen tusk
#

truee

cursive sentinel
#

but thats doing junk to avoid the issue x)

scarlet storm
#

that would be kinda funny

#

how would I create a joker when I sell this one

#

im gonna do that

cursive sentinel
#

i have a joker that does that, although it creates an already existing joker

#

im not sure on how to create a unexisting joker 🧐

#

or it can recreates itself negative, and the x5 would be negative-conditionned, then destroy self condition can be on negative

#

im sorry i think like an ork

brazen tusk
#

i'd make a duplicate joker that isnt in the shop/pack pool

cursive sentinel
scarlet storm
#

idk how to do that either

wraith kiln
#

anyone knows how to specify where to look for sounds

#

or like how to play sounds in general

scarlet storm
#

although having it make a negative joker seems kinda cool

cursive sentinel
brazen tusk
#

2 different jokers, im sure we could figure out how to stop it from showing up in the shop

cursive sentinel
#

you can add 2 values for pitch and volume iirc

wraith kiln
#

does it just look into my assets folder

scarlet storm
cursive sentinel
#

just root i'd guess? see what a random mod does

brazen tusk
wraith kiln
#

k thanks ill try rthat

brazen tusk
cursive sentinel
scarlet storm
#

secret rarity 5

cursive sentinel
#

my go to would be that the joker has a x5 in it but conditionned to itself being negative, and self destruct on its mult proccing, and that selling the joker would create a negative copy of self

#

it's ugly but heh

#
  • might be confusing for player
brazen tusk
#

you need to use in_pool somewhere

scarlet storm
#

my only concern then would be what if you pull it as a base negative

brazen tusk
#

looking into it

cursive sentinel
#

then the saviour is in a hurry

scarlet storm
#

its true...

cursive sentinel
#

quick quick!!! get saved!!!!

final goblet
#

guys... i need some help with something

scarlet storm
#

with what

final goblet
#

mainly FX stuff

manic rune
final goblet
#

if yall didnt know im cooking up a tarot variant out of dislike for morefluff's 45 degree rotated tarot cards

manic rune
#

😭

final goblet
#

and i gotta decide on what cards do what :p

wraith kiln
brazen tusk
# manic rune 😭

bepis while you are here if ydm, do you know how i could make destroying effects like madness target a specific joker?

manic rune
wraith kiln
#

like right now im trying and it gives the error 'resources/sounds/soundname does not exist'

brazen tusk
#

prefix?

manic rune
wraith kiln
#

thanks ill check it out

pure salmon
#

how do i get the suit of a card?

manic rune
#

card.base.suit

#

if im not wrong

pure salmon
#

thanks

brazen tusk
#

it'll be in the channel somewhere do a search if it doesn't work

pure salmon
#

what does that return on suitless cards? just nil?

manic rune
#

...maybe?

#

i havent checked that myself, but thats likely the case

#

either that or smt like Blank, idk

brazen tusk
#

likely nil

pure salmon
#

yeah, i'm trying to make a joker effect that triggers when you score at least 3 different suits

brazen tusk
manic rune
#

just to be sure, you saw my reply right gelo :3

brazen tusk
#

i did ty

wraith kiln
brazen tusk
#

outside

wraith kiln
#

okay ill try that thanks

brazen tusk
#

thats like importing the sound

brazen tusk
pure salmon
#

likewise

manic rune
#

you will want to do smt like

#

-# one sec, i will be typing on phone

pure salmon
#

using a table for tallying so it works with modded suits

wraith kiln
brazen tusk
#

yeah

wraith kiln
#

oky

#

balatro crashes when starting

manic rune
#
local scored_suits = {}
for _,c in ipairs(context.scoring_hand) do
   if c.base.suit and not scored_suits[c.base.suit] then scored_suits[c.base.suit] = true end
end

local suitamt = 0
for _,_ in pairs(scored_suits) do
   suitamt = suitamt + 1
end

if suitamt >= 3 then
   -- effect
end
modern kindle
#

Da bepis

manic rune
#

hi dilly

modern kindle
#

Hi

manic rune
#

hi :3

brazen tusk
wraith kiln
brazen tusk
#

should be fine there hm

#

whats the crash say?

manic rune
#

do you have the file in the correct place

#

it should be in assets -> sounds

wraith kiln
# brazen tusk whats the crash say?

Oops! The game crashed:
functions/misc_functions.lua:837: attempt to index field 'replace_sounds' (a nil value)

Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-0511b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.7.1
Platform: Windows
Steamodded Mods:
1: cosomod by coso [ID: cosomod]
2: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.4.2, Uses Lovely]
Lovely Mods:

Stack Traceback

(3) Lua global 'modulate_sound' at file 'functions/misc_functions.lua:837'
Local variables:
dt = number: 0.0200396
desired_track = string: ""
AC = table: 0x16d7a1b0 {ambientFire1:table: 0x16d7a240, ambientFire3:table: 0x16d7a360, ambientFire2:table: 0x16d7a300, ambientOrgan1:table: 0x16d7a2a0}
(*temporary) = nil
(*temporary) = table: 0x16d7a1b0 {ambientFire1:table: 0x16d7a240, ambientFire3:table: 0x16d7a360, ambientFire2:table: 0x16d7a300, ambientOrgan1:table: 0x16d7a2a0}
(*temporary) = number: nan
(*temporary) = string: "ambientFire3"
(*temporary) = table: 0x17342ed8 {volfunc:function: 0x17281a30}
(*temporary) = table: 0x16d7a360 {per:1, vol:0}
(*temporary) = number: 0
(*temporary) = number: 13
(*temporary) = string: "attempt to index field 'replace_sounds' (a nil value)"
(4) Lua upvalue 'gameUpdateRef' at file 'game.lua:2492'
Local variables:
self = table: 0x169d3e30 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, F_ENGLISH_ONLY:false, F_DISCORD:true, STAGE:1, F_MOBILE_UI:false, F_NO_SAVING:false (more...)}
dt = number: 0.0200396
(5) Lua method 'update' at Steamodded file 'src/ui.lua:84'
Local variables:
self = table: 0x169d3e30 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, F_ENGLISH_ONLY:false, F_DISCORD:true, STAGE:1, F_MOBILE_UI:false, F_NO_SAVING:false (more...)}
dt = number: 0.0200396
(6) Lua field 'update' at file 'main.lua:999'
Local variables:
dt = number: 0.0200396
(7) Lua function '?' at file 'main.lua:938' (best guess)
(8) global C function 'xpcall'
(9) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '?' (defined at line 909 of chunk main.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"])

#

woops

#

didnt think itd copy allthat

brazen tusk
#

hm

manic rune
#

wait

#

remove the =

#

i think you only need
SMODS.Sound{
...
}

wintry solar
#

Yes the = would replace the sound class and break everything

wraith kiln
#

thanks to you too gelo

manic rune
#

:3 thought i was gonna be clowned on for a brainfart there when eremel suddenly appeared out of nowhere

desert hedge
#

Any way to make a joker negative from code
When using create_card

manic rune
#

use SMODS.add_card instead

manic rune
#

and also, add edition = "e_negative" in there

desert hedge
manic rune
#

oh

wintry solar
desert hedge
wintry solar
#

Just take ownership and give it a new calculate function

pure salmon
#

add_card has a parameter called no_edition

brazen tusk
manic rune
#

wh

brazen tusk
#

oh ive spotted it

#

nvm

bleak crane
#

im back with more Not Functioning code

#

idea: if played hand is a straight and has a 2, give X3 mult

vast night
#

hi

manic rune
#

that makes it so every scored 2s give X3 mult, pretty sire

normal crest
manic rune
#

sure

vast night
#

i wanted to ask a question

desert hedge
#

Like I have a card

#

I just want to set it as negative

manic rune
bleak crane
#

how do i fix that

desert hedge
#

Right after create_card

manic rune
#

and also, what srockw said

brazen tusk
#

iirc

manic rune
#

if you want the joker to give X3 mult when all of those conditions are met

vast night
#

This is my first time modding balatro, but since I have experience with python and lua aint that different.
So I want to make all club lucky ccards have a 1 in 2 chance to be retriggered. I've taken many things from the example mod github and the vanilla mod github. This is my current joker and I wanted to ask how I could use the pseudorandom() function

#
calculate = function(self, card, context)
        if context.cardarea == G.play and context.repetition and not context.repetition_only and
            context.other_card:is_suit(card.ability.extra.suit) and SMODS.has_enhancement(context.other_card, 'm_lucky') and 
            pseudorandom('vremade_bloodstone') < G.GAME.probabilities.normal / card.ability.extra.odds then
            return {
                message = 'Again!',
                repetitions = card.ability.extra.repetitions,
                card = context.other_card
            }
        end
    end
bleak crane
brazen tusk
#

ive never seen this repitition only thing before today, and i'd have 2 nickels

desert wind
#

hi guys im trying to implement a joker where on the first discard you can destroy 2 cards from your deck (basically the hanged man tarot card ability) would i just repurpose the tarot card code?

manic rune
#

a

brazen tusk
manic rune
#

god helping on phone is hard sob

desert wind
brazen tusk
#

idea is they are all different suits

vast night
manic rune
brazen tusk
#

immediately becomes not an easier one 💀

modern kindle
manic rune
#

like, maybe your approach will work for that card specifically since it should only want to check 3 cards at once, but when you need to check in a hand with like 5+ cards then that becomes tedious

brazen tusk
#

oh yeah i wouldnt do this for anything bigger

#

as long as it works in this case idm

manic rune
#

my approach is more universal :p

#

also

#

dont use "not =="

#

its ~= you are looking for

brazen tusk
#

ahhh i keep forgetting abt that

bleak crane
#

now my code just does nothing instead of crash the game

manic rune
#

thats wrong

bleak crane
#

figured as much

#

hence the Does Nothing

brazen tusk
#

you want joker_main to be your first one

#

everything inside that

leaden remnant
manic rune
#
if context.joker_main and next(context.poker_hands["Straight"]) then
   for _,v in ipairs(context.scoring_hand ) do
      if v:get_id() == 2 then
         return {
            ...
         }
       end
   end
end
#

smt like this, i think

manic rune
#

thats their own take :p

next timber
manic rune
#

can you take a ss of that with the lines too

next timber
#

?

manic rune
#

im on phone so i cant draw a line or smt to point at it

#

sob

next timber
#

of what with what lines

manic rune
#

the picture of ur ui code

#

with the line numbers on the left side of the screen

next timber
#

ohh

manic rune
#

yeah, line 118

bleak crane
#

(yes i updated the return text)

manic rune
#

the first nodes need another {}

next timber
#

ohh

manic rune
#

can you take another ss of ur code rn

bleak crane
manic rune
#

can you try changing Xmult_mod to just xmult

#

also, remove the card = ... line

#

you don't need it

unborn bay
#

y'all really need to stop using _mod fr

manic rune
#

fr...

bleak crane
#

idk what it means im just going off the example jokers,,,,

manic rune
#

wait shit forgot to help the guy with the gd tag

#

hsbbsbs

bleak crane
#

anyway it works now

#

❤️

vast night
#

ok I've set the pseudorandom string to something and now the game ccrashes. how do i use pseudorandom 😭

        if context.cardarea == G.play and context.repetition and not context.repetition_only and
            context.other_card:is_suit(card.ability.extra.suit) and SMODS.has_enhancement(context.other_card, 'm_lucky') and 
            pseudorandom('feelinlucky') < G.GAME.probabilities.normal / card.ability.extra.odds then
            return {
                message = 'Again!',
                repetitions = card.ability.extra.repetitions,
                card = context.other_card
            }
manic rune
#

the pseudorandom looks right

#

whats the crash log?

vast night
#

lemme crash it again

#

some gibberish

#

(the mod is called reddit because it uses jokers from reddit suggestions)

manic rune
#

card.ability.extra.odds is a nil value

vast night
#

SMODS.Joker {
key = 'feelin_lucky',
loc_txt = {
name = 'Feelin' Lucky',
text = {
"{C:green}#1# in #2#{} Chance to",
"retrigger {C:attention}Lucky{}",
"{C:clubs}#3#{} {C:attention}Cards{}"
}
},
config = { extra = { repetitions = 1, suit = 'Clubs', odds = 2 } },
loc_vars = function(self, info_queue, card)
return { vars = { G.GAME.probabilities.normal or 1, card.ability.extra.odds, localize(card.ability.extra.suit, 'suits_singular') } }
end,
rarity = 2,
atlas = 'reddit',
pos = { x = 1, y = 0 },
cost = 6,
calculate = function(self, card, context)
if context.cardarea == G.play and context.repetition and not context.repetition_only and
context.other_card:is_suit(card.ability.extra.suit) and SMODS.has_enhancement(context.other_card, 'm_lucky') and
pseudorandom('reddit_feelinlucky') < G.GAME.probabilities.normal / card.ability.extra.odds then
return {
message = 'Again!',
repetitions = card.ability.extra.repetitions,
card = context.other_card
}
end
end
}

manic rune
#

can i see your config = extra{...} table

#

in the SMODS.Joker

vast night
#
config = { extra = { repetitions = 1, suit = 'Clubs', odds = 2 } },
manic rune
#

mm

#

ok, so

#

make a new run

#

or create another joker

#

im guessing you created the joker before you added in the odds

#

so the joker currently does not have card.ability.extra.odds

vast night
vast night
#

oh i get it

brazen tusk
#

if you created the joker in game beforehand it wont hold the new values

vast night
#

sorry for disturbing

manic rune
#

its all fine lol

#

feel free to ask anything :p

vast night
brazen tusk
manic rune
#

yeah, from what i heard, #table doesnt work if the index is a string

#

and since the person up there only really wanted to check how many unique suits there r in the scoring hand, i only added suits when they arent already in the table

brazen tusk
#

yeah

#

so for what i want id want to iterate through the suit of every card highlighted then check in that table if there are any results that are the same i think

manic rune
#

i see

#

instead of setting to true, you want it to increase by 1 instead

#

and in the table, check if theres any whose value is higher or equal to 2

brazen tusk
#

highlighted_suits[c.base.suit] = highlighted_suits[c.base.suit] +1 like that?

manic rune
#

mhm

brazen tusk
#

aight awesome

manic rune
#

make sure to check for nil, btw

#

nil + 1 will result in a crash :p

brazen tusk
#

like if a stone card is selected?

manic rune
#

...= (highlighted_suits[c.base.suit] or 0) + 1

brazen tusk
#

i see

manic rune
brazen tusk
#

ig this needs to go in the can use not the use

modern kindle
#

I think we should all remove our nil suit checks collectively

digital sun
#

how do you let the player buy a joker even if there are no joker slots (kinda like how negative works)

brazen tusk
digital sun
#

a joker that adds 1 joker slot

pure salmon
brazen tusk
digital sun
brazen tusk
#

hm

digital sun
#

i put it in an add to deck function

#

so thats why you cant buy it
but idk a better way

brazen tusk
#

i'll check it out in a bit and lyk if i figure smth out

digital sun
#

alr

vast night
#

yippe

#

hi again

#

how do i make every card in the shop free?

cyan lagoon
#

how do i check what cards get selected/deselected?

brazen tusk
gleaming jungle
#

(Malverk) I feel like I'm missing something really obvious here, the localization = { ... } isn't working - "attempt to index nil value", but the moment I put it in the localization file it does

#

i do have my reasons for wanting them here instead of in the localisation file - does anyone have any ideas?

pure salmon
#

trying to make a card that triggers every scoring card once for every non-scoring card, but this doesn't do anything

vast night
#

so i can see the behaviour that happens

pure salmon
#

oh i didn't know lua had python-esque print statements

vast night
pure salmon
#

where does it output? can't find it in lovely

vast night
#

did you restart balatro

pure salmon
#

yeah

rugged helm
#

how do i add a blind to my mod?

vast night
vast night
rugged helm
#

ah so both mod sources i checked just do it really annoyingly

pure salmon
rugged helm
#

thanks

vast night
# pure salmon ah

ok try printing the repetitions before and after the
card.ability.extra.repetitions = 0

#

just wanna see if it bugs there

pure salmon
#

all nil

#

wtf

vast night
#

oh

#

i get it

#

you are changing a joker local var

#

that isnt set

#

just create a local variable

#

(replace card.ability.extra.repetitions by repet or smtn)

pure salmon
#

repetitions is set

vast night
#

ok

#

wtf did i jsut say

#

just replace every card.ability.extra.repetitions in the calc function with another variable

#

(afaik this should work)

pure salmon
#

ok but if i set it to a local variable like retrigs or something it'll evaluate to the correct number and then reset to 0 before context.repetition executes

vast night
#

maybe try running the top part in the context?

#

(im very inexperienced just to say lmfao)

pure salmon
#

i'd be recalculating it for every scored card but i suppose that's not a big deal

bleak crane
pure salmon
#

oh! i just fixed it by changing the name "repetitions" to something else (i chose "retriggers"). maybe that's already defined in config.extra for whatever reason

wintry solar
pure salmon
#

wow that's. wow

#

i might be stupid

hazy mountain
#

are consumable cards sprite size the same size as the jokers (71x95)?

cursive sentinel
#

seems like

#

although their art makes them more thin

hazy mountain
#

sweet thanks!

cursive sentinel
#

i have a question, trying to do a wheel of fortune-like effect except it individually checks for each joker, and i want it to be sequential, so my structure is like

for i = 1, #G.jokers.cards do
EVENT
  function
    if fortune yes then
      EVENT
        trigger before
        function
          set edition
    else
      card_eval nope!
end

although the edition doesnt have a cd, like a end charge-time so it feels rushed when it's a success when i'd want it on the same pace as nopes'
any ideas?

digital niche
#

does G.hand.highlighted work for consumables and jokers aswell?

placid star
#

will support for text styling in names with info queue be coming soon?

placid star
digital niche
desert hedge
#

How can I replace a 0 in source code of balatro with a bit of code

#

Using lovely patches

hard needle
#

how can i get the max amount of discards and hands the player has

vast night
placid star
hard needle
digital niche
#

how do i check if a joker is the one i want in a functtion

#

?

placid star
hard needle
hard needle
#

thank you

digital niche
#

for enhancements is 'SMODS.has_enhancement'

#

what would be the thing like that but for joker?

#

to check the highlighted joker key

placid star
#

oh to check highlighted?

digital niche
#

yye

#

yeye*

placid star
#

G.jokers.highlighted[1].config.center.key == 'j_whateverjoker'

digital niche
#

tyy!

cyan lagoon
#

is there an non-context version of context.consumeable.beginning_end?

wooden nexus
#

How would i make a joker that increases the maximum selection of tarot and/or spectral cards?

cyan lagoon
# red flower beginning_end?

i have this code in one of my jokers (unrelated to what i'm doing) and i assume context.consumable.beginning_end is what i'm looking for

#

basically i want a non-context way to detect if a consumable is being used

red flower
#

idk what beginning_end is but what do you need this for exactly

cyan lagoon
#

for more context, this incorrectly deducts selection limit when using the tower tarot

red flower
#

and what is this trying to do?

cyan lagoon
#

'Stone cards ignore selection limit'

#

it works fine rn, but if you use the tower it deducts selection limit

#

also, i'm working with a lovely patch if that helps

red flower
#

I think it's easier and more mod-friendly to just add a field to the card when it increases the selection limit likt self-highlighed[i].increased_stone_selection and then you only decrease the limit if the flag is true

#

that means if a stone card was turned into one while highlighted nothing should happen

cyan lagoon
#

alright, how do i add that field?

red flower
#

where do you do highlighted_limit + 1

cyan lagoon
red flower
#

just add a line there that says card.increased_stone_selection = true

cyan lagoon
#

oh and when you deselect a card i can just check for this flag right?

red flower
#

yes

cyan lagoon
#

ok after a couple minutes of being an idiot i got it

#

but

#

another problem appeared

#

when there's more than 5 cards selected the 'play' button becomes inactive

red flower
#

yeah you need to patch the play limit for that BUT there's an SMODS PR for it