#💻・modding-dev

1 messages · Page 607 of 1

normal crest
#

and can you confirm all 89 of those consumables have the config.extra.element_no property

unkempt bronze
#

Not all of them do, only 8 do

normal crest
#

That is the issue

unkempt bronze
#

Oh.

normal crest
#

You are going through all of them and checking for it, but it's not there for at least one

unkempt bronze
#

so, I have to add that in for each one of 81 more?

normal crest
#

yes, or you can do if (element.config.extra or {}).element_no == el_sum then for now instead

unkempt bronze
#

I've been meaning to put it on the cards anyway. Just wanted to test it first, but guess I can't have that luxury just yet

normal crest
unkempt bronze
#

broke.

normal crest
#

Did you change the name of the variable back

#

If so replace element with the name it currently is

unkempt bronze
#

still broke

normal crest
#

You put Element instead of element I guess

unkempt bronze
#

for the key

normal crest
#

okay here we go again, what is your code again

unkempt bronze
#

IT WORKS NOW!!!!

normal crest
#

glad to hear

unkempt bronze
#

All that to fuse two Beryllium cards into an Oxygen card...

#

least it proves 4+4=8

unkempt bronze
normal crest
#

i'll be an element on your mod's periodic table?

unkempt bronze
#

if you want

#

and if I actually add more

unkempt bronze
ocean sinew
#

what type of mod u making?

unkempt bronze
#

A mix of everything, but the main part currently is with element-themed consumables

ocean sinew
#

looks very cool

unkempt bronze
#

you know Aikoyori's Shenanigans?

ocean sinew
#

yeah

unkempt bronze
#

This is Jimbo Joshua's Shenanigans, otherwise known as Balatro My Way

ocean sinew
#

you do pixel art btw?

unkempt bronze
#

Eh, somewhat.

ocean sinew
#

oh cool

unkempt bronze
#

I use pixel art websites to make card designs, if that's anything

ocean sinew
#

I saw that character in your pfp and assumed you drew it

unkempt bronze
#

I did, and then did it as a joker.

ocean sinew
#

nice

#

do you have any tips btw

#

I been doing pixel art for a while

unkempt bronze
ocean sinew
#

I usually have a hard time with stuff like drawing shoes or even caps

cerulean rose
#

is the text a reference to anything

ocean sinew
#

Idk how to get the feeling of depth in the art

unkempt bronze
unkempt bronze
cerulean rose
#

ten words of wisdom!

unkempt bronze
ocean sinew
frosty rampart
unkempt bronze
cerulean rose
ocean sinew
unkempt bronze
ocean sinew
#

Btw If you need any help w coding or coding questions u can dm me

#

I have some experience with coding

unkempt bronze
#

Trust me, I'll stump you on my next one.

bold sleet
#

Hello. Help, why the fuck is the patch not working?

primal robin
#

SMODS:

bold sleet
#

?

#

what?

vernal seal
#

bump because i still didn't solve the problem
please some help me solve this problem

red flower
vernal seal
red flower
vernal seal
vernal seal
red flower
wild berry
#

how can i force the shop to open

primal robin
wild berry
#

no like, is there a function to do it

#

im planning on making it a skip tag

wicked leaf
#

what's the G.GAME for the number of discards per round? its not in the wiki

wild berry
#

what discards? the ones that the player currently has?

wicked leaf
#

the number it will reset to after clearing a round

tall wharf
wicked leaf
#

is it discards left?

#

I just want to permanently increase my discards

tall wharf
#

yes

#

oh

wild berry
#

look at vanillaremade

#

search for drunkard

tall wharf
wild berry
#

im getting this error

#

when starting a blind

slim ferry
#

well you probably want to update steamodded since youre 2 releases behind

#

and also actually show your code

wild berry
slim ferry
#

you should use card:add_sticker("perishable", true)

wild berry
#

oh

#

thanks

#

im using an outdated version of smods to keep it compatible with balatro mp too

#

also how can i force it to not be a certain joker

slim ferry
#
local pool = get_current_pool("Joker", "Common")
local key
for k, v in ipairs(pool) do
    if G.P_CENTERS[v].perishable_compat == false or v == "<some joker key>" then
        pool[k] = "UNAVAILABLE"
    end
end
local no_available = true
for _, v in ipairs(pool) do
    if v ~= "UNAVAILABLE" then no_available = false end
end
if no_available then
    key = "j_joker"
else
    repeat
        key = pseudorandom_element(pool, "seed")
    until key ~= "UNAVAILABLE"
end
local card = SMODS.add_card{ key = key } ...
```bit of a workaround but this should work i think
daring fern
lean whale
#

infoqueue not loading for custom seal

daring fern
slim ferry
# wild berry alright thanks

you'll probably want to look at how morefluff does this so you dont unban cards that were previously banned already

wild berry
#

this is the find function

slim ferry
#

it should be G.GAME.banned_keys[<object key>] = true

wild berry
#

oh

slim ferry
#

that should work

lean whale
slim ferry
#

no that just means its not discovered

lean whale
#

if this is in my loc file, what should be the seal's key

wild berry
#

out of the question but wouldnt making the card negative do the same thing

lean whale
#

is that a thing

wild berry
#

yes

lean whale
#

lol

#

fuck me

wild berry
lean whale
#

i thought it worked with jokers

wild berry
#

replace card.ability.extra.edition with "e_negative"

#

and _card with ur card of choice

lean whale
#

thanks man

wild berry
#

np

lean whale
#

I still do want to keep it as a seal just to understand how it works and what I'm doing wrong

#

still haven't managed to display the infoqueue

#

ok figured it out

wild berry
#

how can i poll a joker from a pool

#

a specific one

daring fern
wild berry
#

no like

#

what function

#

to get the pool i want to use

#

and then poll it

daring fern
wild berry
#

thanks

#

do i have to include my mod prefix tho

daring fern
wild berry
#

this doesnt give me the jokers im trying to fetch

daring fern
wild berry
#

ohty

#

why doesnt this work

weary grail
#

what

wild berry
#

code?

weary grail
#

local blind = NFS.load(mod_path .. "blinds/" .. v .. ".lua")()

wild berry
#

is NFS ur mod name?

weary grail
#

no

wild berry
#

what is NFS then

weary grail
#

i don't know

wild berry
#

wait nvm

#

i got it wrong

#

so

weary grail
#

this is my first mod idk how to do anything

wild berry
#

is mod_path initialized

weary grail
#

local mod_path = SMODS.current_mod.path

wild berry
#

maybe do local mod_path = "".. SMODS.current_mod.path

#

or local mod_path = tostring(SMODS.current_mod.path)

daring fern
weary grail
#

oh

wild berry
#

yeah ur right

#

if you want to automate the process do this

#

replace items with ur directory where ur storing the lua files

#

except main

weary grail
#

lemme test this

#

still isnt working

#

same error

wild berry
#

show code again

weary grail
#

this is all of it

#

i know i did something wrong

wild berry
normal crest
#

you don't need to put your mod path in SMODS.load_file

wild berry
#

why are you calling the loaded file?

weary grail
#

uh

wild berry
#

also you dont need to load every blind individually

weary grail
#

ok

normal crest
#

And calling the loaded file is correct

wild berry
#

you should just do a file that does it

normal crest
#

You just need to remove the mod path from there

wild berry
weary grail
#

im cheeks bro this is my first program

wild berry
#

heres a way you can format it

#

in the file youre loading

weary grail
#

thanks

wild berry
#

np

wild berry
weary grail
#

OH MY GOD IT DIDNT CRASH

normal crest
wild berry
#

im using my own pool

normal crest
#

The code you sent looks fine then, what's the issue?

wild berry
#

because it didnt work

normal crest
# wild berry

Also your inject function here is very redundant, you can remove it and it'd do the same

wild berry
#

hold on

#

see?

normal crest
#

What's the entire joker code

wild berry
weary grail
#

the blind isn't in the blinds list

wild berry
#

wdym

weary grail
#

in my collection

wild berry
#

ah

weary grail
#

its still 30/30 blinds

wild berry
#

you probably didnt load it properly

weary grail
#

i'd assume the blind doesn't work either

wild berry
#

show how ur mod is structured

#

and show the main.lua code

weary grail
#

so this is the structure

wild berry
#

you can put all your blinds in one lua file

#

you dont have to make a folder that contains each one

weary grail
#

really?

wild berry
#

yes

weary grail
#

i feel like each one'd be more organized

wild berry
#

look at mine for example

wild berry
normal crest
#

If you're planning on making a big mod I'd recommend having each in a different file

wild berry
#

why

normal crest
#

So you don't end up with a Jokers.lua file with 20000 lines

wild berry
#

ctrl + f

weary grail
#

am i missing anything

#

i probably am

wild berry
#

wheres the key

normal crest
wild berry
weary grail
#

ah

wild berry
weary grail
#

so would the key be

#

cherry

wild berry
#

yes

#

and i noticed youre not using SMODS.Blind to initialize it

weary grail
#

i don't know how to

#

i've read the docs a bit

wild berry
#

wrap it inside the SMODS.Blind function

#

and put the table inside that

normal crest
# wild berry

Try making the condition just if (x.config.center.pools or {}).food then

wild berry
#

SMODS.Blind{put the stuff here}

weary grail
wild berry
wild berry
weary grail
#

ok

wild berry
#

its SMODS.Blind not SMODS.blind

normal crest
wild berry
#

k

weary grail
#

let me test it rq

wild berry
weary grail
#

it doesnt crash but nothings there

#

as in the blinds

wild berry
#

you can just do this
local yourblind = SMODS.Blind{
key = "cherry",
pos = {x = 0, y = 0}
dollars = 5,
mult = 2,
debuff = {["Pair"] = true}
boss_colour = HEX("8f0d0d"),
}

return yourblind

weary grail
#

oh i dont need the paratheses?

wild berry
#

and function(local variable = {}) is highly likely to be an error

weary grail
wild berry
#

like that

#

yeah

#

try now

weary grail
#

ok

#

still nothing

wild berry
#

maybe try not returning

#

and dont set a variable

#

just do SMODS.Blind{

#

and set its atlas

#

manually

weary grail
#

really dumb question but like

#

what even is an atlas

#

idk how anything works

wild berry
#

spritesheet

weary grail
#

ohh

wild berry
#

also its an error to set the atlas AFTER initializing an object

weary grail
#

so how do i set it

#

rather where

wild berry
#

copy this structure

weary grail
#

main.lua or cherry.lua

wild berry
#

cherry.lua

weary grail
#

ok

wild berry
#

but you should make it blinds.lua instead

#

so you dont have to create 1 file for each single blind

normal crest
# wild berry didnt do anything

Make sure card.ability.extra.mult isn't somehow 0, and try typing eval G.P_CENTER_POOLS.food in debugplus console and see if there's even anything in the pool and you didn't make a mistake in loading it

wild berry
#

ill see

weary grail
wild berry
wild berry
normal crest
wild berry
#

how come? i did it correctly

#

wait

#

do i have to switch the pool's cards to indexes

#

instead of values

weary grail
#

nothing there

normal crest
#

Forgot about that

wild berry
weary grail
#

ok

wild berry
#

replace items with ur directory's name

wild berry
wild berry
weary grail
#

it certainly loaded

#

theres an error in the cherry.lua

normal crest
#

What is the error

wild berry
#

their blind file is not loading

weary grail
wild berry
#

mods, crush his balls

normal crest
#

<@&1133519078540185692>

normal crest
weary grail
#

yeah but why

#

pos = {x=0 y=0}

#

oh

#

i forgot a comma

#

still isnt working

wild berry
#

errors?

normal crest
#

you were missing 2 commas in that line

weary grail
#

oh

normal crest
#

after x=0 and at the end of y=0}

weary grail
#

im a dingnut

#

still isnt working

normal crest
#

check that you're not missing commas anywhere else

umbral spire
#

how can i randomize suit and rank of all played cards before scoring?

this kind of works, but when deselecting(?) it randomizes before hand is played?

weary grail
#

IT'S THERE

wild berry
weary grail
#

it's a small blind

#

what

wild berry
#

atlas isnt defined

wild berry
#

should work now

wild berry
normal crest
weary grail
#

yeah

#

wait

#

here

umbral spire
# weary grail

"Cherry.png" is in your_mod/assets/1x/Cherry.png right?

weary grail
#

yes

#

and 2x

umbral spire
#

if you have debugplus maybe reload atlases (with ctrl+m)? also is it discovered by default? discovered = true?

wild berry
#

is the atlas "Cherry"?

normal crest
#

put atlas = "Cherry" in your blind

wild berry
#

yeah

#

if you want to add more blinds dont make an individual spritesheet for each one

#

and just separate them vertically

weary grail
#

IT WORKS

wild berry
#

so you dont have to make an atlas for each one

#

good job

weary grail
#

now i need to see if the debuff works

wild berry
#

you can force the blind if you have the cheat panel enabled

umbral spire
weary grail
wild berry
#

and see if anything appears

weary grail
#

the menu is there

wild berry
#

then its good

#

press esc

#

collection

weary grail
#

theres only boss reroll

wild berry
#

blinds

weary grail
#

do i hit spawn?

wild berry
#

and press 3 on the blind you want

weary grail
#

3

wild berry
#

yes

wild berry
#

and do a for loop for each card

#

in play

weary grail
#

it crashed

wild berry
#

show the error

weary grail
wild berry
#

you need to initialize a boss thing

weary grail
#

is boss an initialization?

wild berry
#

its a table

weary grail
#

oh

wild berry
#

you must insert the minimum ante in which it will appear

weary grail
#

minimum ante?

#

ok

wild berry
#

yes

weary grail
#

so like

#

1

umbral spire
wild berry
#

try doing that

weary grail
#

boss = {min = 1},

wild berry
#

yeah

weary grail
#

it's not breaking but the pairs are working

wild berry
#

so thats good?

#

i mean

weary grail
#

it's supposed to debuff pairs

wild berry
#

hold on

weary grail
#

isnt that what debuff ={} does

#

debuff = {['Pair'] = true},

wild berry
#

do hands = {(insert ur hands here)}

umbral spire
wild berry
#

something like this
hands = {["Pair"}] = false}

wild berry
umbral spire
wild berry
#

for loops inside tables dont need to have i already initialized

umbral spire
#

ah that fixed it

weary grail
#

still isnt working

umbral spire
wild berry
#

try to do test prints

umbral spire
wild berry
wild berry
#

heres how vanillaremade it kinda does it

#

look at the debuff_hand

#

i think i got it now

#

do next(context.poker_hands["Pair"])

weary grail
#

ok

wild berry
#

if next(context.poker_hands["Pair"]) then

#

return {debuff = true}

weary grail
#

so do i get rid of the debuff

#

debuff = {hand = {["Pair"] = true}},

#

this one

wild berry
#

yes

umbral spire
wild berry
#

maybe even a variable

umbral spire
wild berry
#

try removign context.other_card

gusty compass
#

how would i happen to add custom buttons to jokers that are in a shop, like for a freeze mechanic for instance?

weary grail
#

if next(context.poker_hands["Pair"]) then
return {debuff = true}
end

wild berry
#

like this

#

this is the calculate function you want to use

#

if not blind.disabled then
if context.debuff_hand then
if next(context.poker_hands["Pair"]) then
return {debuff = true}
end
end
end

#

paste it

weary grail
wild berry
#

code

weary grail
#

if not blind.disabled then
if context.debuff_hand then
if next(context.poker_hands["Pair"]) then
return {debuff = true}
end
end
end

wild berry
#

no li

#

like

#

the entire blind's code

umbral spire
#

image prol

weary grail
wheat rapids
#

How do I make a joker always have an edition?. Something like cryptid does with some jokers

wild berry
umbral spire
#

oh my code finally works, it was the context.other_card

daring fern
wheat rapids
#

Thanks y'all

weary grail
wild berry
# wheat rapids Thanks y'all

add_to_deck = function(self, card, from_debuff)
if not card.edition then
card:set_edition(poll_edition(nil, true, true, true))
end
end,

#

incase you want a random edition

umbral spire
# weary grail

do this

SMODS.Blind {
  key = "cherry",
  dollars = 5,
  mult = 2,
  atlas = "Cherry",
  pos = {x=0,y=0},
  boss_colour = HEX("8f0d0d"),
  loc_txt = {
    name = "The Cherry",
    text = {
      "All pairs are debuffed"
    }
  },

  debuff = {
    hand = { ['Pair'] = true}
  }
#

there is no need for calc function

wild berry
#

oh

umbral spire
#

when there's a built-in hand debuff

daring fern
wild berry
#

whats even set ability??

weary grail
#

they still score

umbral spire
weary grail
#

yes

umbral spire
#

hm

#

or is it 'Pairs'?

#

try that

vague crag
#

Pairs sounds about right

weary grail
#

worth a shot

wheat rapids
weary grail
#

nope

wild berry
#

replace the 3rd argument with a false then

weary grail
#

still broken

vague crag
#

Tell me what I'm doing wrong, I've been pulling my hair out trying to apply an enhancement

wild berry
#

the enhancement must start be formatted like this

#

m_(mod prefix)_(key)

umbral spire
#

also do 'modprefix_popper'

red flower
umbral spire
#

and for confetti

wild berry
red flower
#

hi

slim ferry
wild berry
#

ohhhh

weary grail
#

how do i set this yp

#

up

#

unless i just did

#

i think i did

vague crag
#

Oops! The game crashed:
[SMODS 2_Year_Mod "BirthdayJoker.lua"]:171: attempt to index global 'scored_card' (a nil value)

It's been returning this whenever I play a hand

#

For context, I'm trying to make a joker that applies this enhancement to the played hand

umbral spire
#

can i see your code @weary grail

weary grail
elder rune
#

How do you make a temproary consumable effect

umbral spire
# weary grail

why is debuff not at the same column as loc_txt or something, idk if that'll do anything tho

red flower
vague crag
#

I tried both

elder rune
red flower
red flower
umbral spire
# weary grail wdym

press space twice on line 14,15 & 16, also do you get a crash ? or does it just do nothing?

elder rune
#

im looking for hand size

red flower
weary grail
#

it still doesnt work

vague crag
#

Oops! The game crashed:
[SMODS 2_Year_Mod "BirthdayJoker.lua"]:171: attempt to index field 'other_card' (a nil value)

@red flower

umbral spire
weary grail
#

😔

vague crag
red flower
# vague crag

before the event do local scored_card = context.other_card then use scored_card in the event

azure laurel
#

im having trouble with this joker, i want to debuff the lojer to his right, but here just debuff itself, what i do ?

wild berry
#

you specified card as the one to be debuffed

#

debuff is a boolean

vague crag
#

YES it works

wild berry
#

source is a string

vague crag
#

Thank you so much

#

That was a nightmare for my pea brain

wild berry
red flower
wild berry
elder rune
red flower
elder rune
#

same

azure laurel
wild berry
#

🤦

#

text

#

something like this

#

"text"

#

or 'text'

azure laurel
#

oh

red flower
azure laurel
#

oh, im dumb af

umbral spire
#

to give mult ( specifically for a edition ) you just do return { mult = some_value } right?

lucid owl
wheat rapids
#

Why isn't my joker working?
I think that the problem is the context but I'm not sure
calculate = function(self, card, context) if context.before and context.cardarea == G.play then return { play_sound('fm1_cool', 1, 1), message = 'Cool!', colour = G.C.GREEN, } end end

wheat rapids
#

I don't remember the name

lucid owl
# elder rune im looking for hand size

here's code from my consumable that gives +2 temp hand size
G.hand:change_size(card.ability.extra.h_size) G.GAME.round_resets.temp_handsize = (G.GAME.round_resets.temp_handsize or 0) + card.ability.extra.h_size
where card.ability.extra.h_size is whatever variable you want to increment it by until the end of the round

elder rune
#

thx

elder rune
lucid owl
elder rune
#

its positive

#

but when it should increase it doesnt, and when it resets back it then decreases by the amount I set

wild berry
umbral spire
#

how do you make a credits section for your mod

slim ferry
#

SMODS.current_mod.extra_tabs is a function thatll return the ui elements of extra mod page tabs

#

so learn ui and then make a funny credits page

lucid owl
#

also, try and put it in an event

elder rune
#

I'll try that later not on computer rn

vague crag
#

What's the event to modify the starting deck (in making a new deck)

slim ferry
#

wdym "the event"

#

you have to create an event

#

because otherwise it happens before the default deck is set

vague crag
#

I know but how do I actually change the cards

#

Is it the same as modifying them midgame

slim ferry
#

yes

#

just loop over G.deck.cards and use whatever functions you normally use for modifying cards

vague crag
#

Ok cool

wild berry
wicked leaf
#

im trying to make a tooltip that shows the credits of a joker

the problem is I have no fuckin clue how to make the tooltip ACTUALLY appear

wicked leaf
#

I think thats giving you the error

wild berry
#

oh

#

but it worked before

#

nvm fixed it

vague crag
#

I am the big stupid I don't know how to loop G.deck.cards

slim ferry
#

do you know how to loop any other cardarea

#

because its the same

umbral spire
#

how do you change this icon in the mods tab

slim ferry
#

create an atlas with the key modicon

vague crag
slim ferry
#

yeah

#

for i, card in ipairs(G.deck.cards) do

#

either variable can be replaced with an underscore if you dont use them

wild berry
#

how can i freeze the game for a certain amount of time

slim ferry
#

like completely freeze or just stop the player from making actions?

wild berry
#

freeze the game

slim ferry
#

time.sleep

umbral spire
wild berry
#

k thanks

slim ferry
wild berry
#

should i just keep it as is or?

slim ferry
#

oh nvm i thought that was thing

#

uhhh fuck

wild berry
#

ill try love.timer.sleep

daring fern
vague crag
#

So I have 'for i, card in ipairs(G.deck.cards) do'
but it keeps telling me "Bad argument #1 to ipairs (expected table, got string)

slim ferry
#

what does the code look like

vague crag
slim ferry
#

you should probably put the entire loop inside of the event

#

is what im guessing

vague crag
#

There shouldn't be anything wrong, all I did was put the for loop in the event

slim ferry
#

uh

#

show code again

vague crag
slim ferry
#

yeah because

#

it has to be in the actual function part of the event

vague crag
#

Ah I'm dumb

#

It's giving me bad argument #1 for ipairs agian

stone dagger
#

try to use just pairs instead

slim ferry
#

that wont change anything

#

pairs is identical to ipairs besides that its unordered and loops over non-integer indexes

vague crag
#

I don't know what to do about this supposed bad argument

slim ferry
#

i mean i have this deck which does the exact same loop with different code so like

#

idk the issue

umbral spire
#

how can i debuff (for a blind) multiple ranks, suits or poker hands?

unkempt bronze
#

And I have another issue: I have two psuedorandom_element calls, and when I had one it worked but both break the game

slim ferry
wild berry
#

why does this error appear

slim ferry
wild berry
umbral spire
slim ferry
#

well calculate for blinds functions the same as calculate for jokers

faint yacht
#

modprefix_key

slim ferry
#

and you return debuff=true to debuff

wild berry
umbral spire
wild berry
#

now i get this

slim ferry
#

you should check the pillar in vanillaremade since i think that uses a calculate

#

and for hand debuffing check the eye or the mouth since they also use a calculate

slim ferry
#

yes

slim ferry
#

context.debuff_card is also the actual card being checked to debuff

umbral spire
#

oh

slim ferry
#

so you can do whatever checks you want on context.debuff_card

umbral spire
#

so how can i check the rank of it per se?

#

@slim ferry

slim ferry
#

:get_id()

#

like checking a rank with anything else

vague crag
#

I'm worried something got screwed up

umbral spire
vague crag
#

I don't think it matters what I put in there, it'll just return a bad argument

slim ferry
unkempt bronze
#

SMODS.add_card({ pseudorandom_element({ 'c_xiferp_lanthanum', 'c_xiferp_cerium', 'c_xiferp_praseodymium', 'c_xiferp_neodymium', 'c_xiferp_promethium', 'c_xiferp_samarium', 'c_xiferp_europium', 'c_xiferp_gadolinium', 'c_xiferp_terbium', 'c_xiferp_dysprosium', 'c_xiferp_holmium', 'c_xiferp_erbium', 'c_xiferp_thulium', 'c_xiferp_ytterbium', 'c_xiferp_lutetium' }, 'Lanthanide_pull' )} )
Why isn't this working?

umbral spire
# slim ferry yeah

how can i make it to where if you play X or Y rank the hand isnt allowed, not debuffed

unkempt bronze
stone dagger
umbral spire
#

☝️ @unkempt bronze

slim ferry
unkempt bronze
vague crag
#

Both pairs and ipairs return a "bad argument"

#

I have a different mod that doesn't even calls pairs and it still crashes

slim ferry
#

then i imagine its an issue elsewhere

#

when is it actually crashing

vague crag
#

Right at the end of loading, after injection

stone dagger
slim ferry
#

since that would only crash if you start a run with the deck

vague crag
#

I have no idea where to look to fix that

unkempt bronze
#

Works now

stone dagger
#

nice

#

Im gonna pop a question of my own

#

why doesn't this work?

if context.after and card.ability.extra.used then

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

            return {
                x_chips = card.ability.extra.xchips
            }

        end
#

it's a calculate inside a consumable

wild berry
#

is it possible to emplace cards used after scoring back into G.playing_cards

stone dagger
# daring fern What is the full code?
SMODS.Consumable {
    key = "nylahs_intervention",
    set = "spells",
    loc_txt = {
        name = 'Nylah\'s Intervention',
        text = {
            "Next hand gains {X:chips,C:white}X#1#{} Chips",
            "increased by {X:chips,C:white}X#2#{} for each",
            "scored card this round"
        }
    },
    atlas = 'TherosBD_spells',
    pos = {x = 9 , y = 0},
    cost = 3,
    config = { extra = { initial_xchips = 1.5, current_xchips = 1.5, xchips_increase = 0.1, used = false} },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.current_xchips, card.ability.extra.xchips_increase } }
    end,
    use = function(self, card, area, copier)

        card.ability.extra.used = true

        local eval = function() return card.ability.extra.used end
        juice_card_until(card, eval, true)

    end,
    calculate = function (self, card, context)

        if context.individual and context.cardarea == G.play then

            card.ability.extra.current_xchips = card.ability.extra.current_xchips + card.ability.extra.xchips_increase

        end
        
        if context.after and card.ability.extra.used then

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

            return {
                x_chips = card.ability.extra.xchips
            }

        end

        if context.end_of_round then
            card.ability.extra.current_xchips = card.ability.extra.initial_xchips
        end

    end,
    keep_on_use = function (self, card)
        return true
    end,
    can_use = function (self, card)
        if not card.ability.extra.used and G.hand and G.hand.cards then
            return G.GAME.blind and G.GAME.blind.chips > 0
        end
        return false
    end
}
#

sorry for the wall

wild berry
#

after scoring, cards used in the played hand can be drawn again

daring fern
stone dagger
#

bruh xD

#

thanks for catching that :)

daring fern
wild berry
#

yeah

daring fern
wild berry
#

kty

fluid steppe
#

what context would i use for detecting when a joker is destroyed

daring fern
vague crag
#

Does anything look wrong with this? It's crashing on line 1719

daring fern
vague crag
#

The last 'end' at the bottom there

#

After everything else

#

Both of my mods crash due to ipairs, I'm trying to see why

daring fern
vague crag
#

I give up

#

I'll try again later

daring fern
umbral spire
daring fern
umbral spire
#

im tryna make it where you can only play face cards, why isn't this working?

umbral spire
zealous glen
#

true and true == true are the same thing

umbral spire
#

oh right

zealous glen
#

not true and true == false are the same thing

umbral spire
zealous glen
#

It should be syntactically equivalent yes

native bone
#

I am trying to make a Joker that randomizes the suit and rank of played cards, this is the current script to find all ranks and suits.

umbral spire
# native bone I am trying to make a Joker that randomizes the suit and rank of played cards, t...

you might need to modify this because its for a blind but i have sm similar:

SMODS.Blind {
    name = "endermen",
    key = "endermen",
    atlas = "blindatlas", 
    discovered = true,
    pos = { y = 2 },   
    dollars = 5,
    mult = 2,
    boss = { min = 3 },
    boss_colour = HEX("e079fa"), 

    calculate = function(self, blind, context)
        if not blind.disabled then
            if context.setting_blind then
                play_sound('bc_endermen3', 1, 0.5)
            end
            if context.before then
                for i, c in ipairs(G.play.cards) do
                    local _card = G.play.cards[i]

                    local rank = pseudorandom_element(SMODS.Ranks, pseudoseed('endermen_ranks')).key -- get a random rank
                    local suit = pseudorandom_element(SMODS.Suits, pseudoseed('endermen_suits')).key -- get a random suit

                    SMODS.change_base(_card, suit, rank)

                    play_sound('bc_endermen', 1, 0.5)
                end
            end
        end
    end,
    defeat = function(self)
        if not G.GAME.blind.disabled then
            play_sound('bc_endermen2', 1, 0.5) return true
        end
    end,
    disable = function(self)
        play_sound('bc_endermen2', 1, 0.5) return true
    end
}


umbral spire
#

ehow can i make it where the hand isnt allowed if you play anything else then a face card or ace

daring fern
median rose
#

I'm watching this tutorial on how to create a joker. I got to this point , and have this code, when I run the game, I don't see the joker in my collection. Is this video outdated? Did I mess something up? My smods version is 1.0.0-beta-0711a

SMODS.Atlas{
    key = 'Jokers', --atlas key
    path = 'Jokers.png', --atlas' path in (yourMod)/assets/1x or (yourMod)/assets/2x
    px = 71, --width of one card
    py = 95 -- height of one card
}

SMODS.Joker{
    key = 'joker2',
    loc_txt = {
        name = "Joker: The Sequel",
        text = {
            'When Blind is selected,',
            'create a {C:attention}Joker{}',
            '{X:mult,C:white}X#1#{} Mult'
        }
    }
}
daring fern
#

Is the mod loading?

median rose
#

no

#

I downloaded this zip, changed the folder to be the name of my mod, and changed the code inside main.lua to what I have above.

slim ferry
#

that is also very outdated

median rose
slim ferry
#

just ignore those because basically all of the example mods are very outdated

#

all the other resources should be fine though

median rose
#

is there a way to allow beta versions of smod?

slim ferry
#

yeah

unkempt bronze
#

Any tricks to buff the last played card of a hand?

slim ferry
#

the last scoring card is context.scoring_hand[#context.scoring_hand]

#

same can be done for context.full_hand

#

or any cardarea

unkempt bronze
#

Thank you (i had a similar bit, but with a 5 hard-coded(

#

Hang on, that also makes my Letter Seal a lot more dynamic

timid zinc
#

does any of this code destroy a card? i can't figure out why it's destroying itself

slim ferry
#

my best guess is the card.children.center.pinch.x = true

#

since thats also what the food destruction animation uses

daring fern
unkempt bronze
#
SMODS.Consumable {
    key = "neptunium",
    set = "xiferp_Element",
    atlas = "Golden_Brick_Road",
    cost = 3,
    pos = { x = 4, y = 6 },
    unlocked = true,
    discovered = true,
    can_use = function(self, card)   
      if card.ability.extra.yes_is_no == false then
        return true
      end
    end,
    config = { extra = { element_no = 93, odds = 62, yes_is_no = false } },
    loc_vars = function(self, info_queue, card)
        local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'c_xiferp_neptunium')
        return { vars = { numerator, denominator } }
    end,
    use = function(self, card, area)
        yes_is_no = true
    end,
    loc_txt = {
        name = 'Neptunium',
                text = {
                    'x5 mult per average card for the',
                    'hand after this is used',
                    '(1/62 chance to radioactively decay)',
                },
            },
    calculate = function(self, card, context)
    if card.ability.extra.yes_is_no == true then
        if context.individual and context.cardarea == G.play then
            if context.other_card:get_id() > 5 and context.other_card:get_id() < 10 then
                   G.GAME.xiferp_rowseven_xmult = (G.GAME.xiferp_rowseven_xmult or 0) + 5
                 SMODS.destroy_cards(card, nil, nil, true)
             end
        end
    end
         if SMODS.pseudorandom_probability(card, 'c_xiferp_neptunium', 1, card.ability.extra.odds) then
                SMODS.destroy_cards(card, nil, nil, true)
                SMODS.add_card({ key = 'c_xiferp_uranium' })
        end    
    end
}```
What in this is closing the game upon mousing over?
daring fern
unkempt bronze
plucky berry
#

how do you make selectable cards inside boosters? like not to use immediately but to keep them in the slots when selected

native bone
plucky berry
#

yeah

native bone
#

Then I would start snooping around in the code for Code Packs

#

You might find something

plucky berry
#

i looked and didn't find anything that resembles that

#

i also looked in pokermon cause it has a voucher that does that

native bone
#

Oh yeah

#

Is it an added game event, perhaps? Under G.E.MANAGER?

lofty stratus
#

ive lost all knowledge in the sea of poor documentation, what do i use to set 3 free rerolls per shop in a deck

plucky berry
#

SMODS.change_free_rerolls(3) i think????

slim ferry
#

yeah

#

that

daring fern
vernal seal
daring fern
vernal seal
daring fern
#

Also 2-0 is less than 3

plucky berry
vernal seal
daring fern
#

Also replace random_set with 'Consumeables'

vernal seal
slim ferry
#

default area for that set is G.jokers for some reason

#

add area = G.consumeables to the add_card

plucky berry
native bone
#

This Joker crashes whenever the shop ends. It gives no crashlog, and I am very confused as to what the crash log is trying to say. What am I concatenating? I dont know.

#

For some reason, the message I pasted has the crashlog, but I dont see it on the crash menu. Odd

daring fern
native bone
honest bridge
#

Hiya! anyone know why this isn't working?

daring fern
honest bridge
honest bridge
daring fern
crystal perch
#

is there any way to cause an effect to draw a card but only while the hand is actually out

#

(i.e. in blinds and some boosters)

honest bridge
slim ferry
#

well it doesnt appear to be

honest bridge
slim ferry
#

wdym just in case

#

thats not even stored in self for jokers plus name doesnt exist for jokers unless you specifically define a name field

native bone
#

This does not detect when Cryptid's Pizza Slice is sold. I dont really know why. Although it does work correctly otherwise

crystal perch
# slim ferry wdym just in case

i can only assume that they're replicating how balatro is coded, because the game defines all the joker abilities in a huge name = list

slim ferry
#

card is the joker itself

native bone
#

Thanks.

red flower
crystal perch
#

detecting, and i just want to draw when you sell the joker so no big there

red flower
#

you can probably just do if next(G.hand.cards) then

crystal perch
#

i'll test that out

bold sleet
#

help, what the fuck is going with my lovely patch?

#

wtf is cfg, why _c is being replaced, how do I prevent it from doing just that?

red flower
#

some other patch might be changing it after

#

try changing the priority

bold sleet
#

Do I lower it even more?

red flower
#

no the opposite

bold sleet
#

ok

red flower
#

that's lower than smods

bold sleet
#

Up it goes.

heady maple
#

Hey guys Im trying to change the card at the main menu I only did the effect (negative) but i want to have Ace of hearts. Any help ?

[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "replace_card.states.visible = true"
position = "after"
payload = """
if replace_card and replace_card.base then
    replace_card.base.value = 'Ace'
    replace_card.base.suit = 'Hearts'
    replace_card:set_edition(G.P_CENTERS.e_negative and 'e_negative' or 'e_negative', true, true)
end
"""```
sharp arch
#

remaking all my changes (CUZ IM STUIPD), i just lost the message where someone helped me check for specific jokers sold can someone help me find it

daring fern
sharp arch
#
    key = "modicon",
    path = "ModIcon.png",
    px = 32,
    py = 32
})

logo = "balal.png"



SMODS.Atlas ({
        key = "balal",
        path = logo,
        px = 333,
        py = 216,
        prefix_config = { key = false }
    })```
ignore the modicon for a sec, why isnt the logo showing up?
daring fern
sharp arch
heady maple
# daring fern `SMODS.change_base(replace_card, 'Hearts', 'Ace')`

am i doing it wrong ?

pattern = "replace_card.states.visible = false"
position = "after"
payload = """
if replace_card and replace_card.base then
    SMODS.change_base(replace_card, 'Hearts', 'Ace')
    replace_card:set_edition(G.P_CENTERS.e_negative and 'e_negative' or 'e_negative', true, true)
end
"""```
heady maple
stoic void
heady maple
daring fern
weary grail
heady maple
crystal perch
# red flower you can probably just do `if next(G.hand.cards) then`

this works but the playing card is drawn face down and if you draw multiple they overlay on top of each other
code:

calculate = function(self, card, context)
        if context.selling_self and card.area == G.jokers and next(G.hand.cards) then
            for i = 1, card.ability.extra.draw do
                local drawn_card = G.playing_cards[1]
                G.hand:emplace(drawn_card)
                G.E_MANAGER:add_event(Event({
                    func = function()
                        drawn_card:flip()
                        return true
                    end
                }))
            end
        end
    end
#

it's drawn face down even without drawn_card:flip() btw

red flower
crystal perch
#

i wasn't aware of that func i see, i based this off of how dna adds a card to deck then immediately draws it

red flower
#

lmao

#

dna says that in the description but doesn't actually do that

crystal perch
#

🤷‍♀️

red flower
#

@zealous glen you're vindicated

crystal perch
#

i also noticed this because if you pair it with my joker that makes you draw in order, you get a random card

#

see how the 2 of clubs is erroneously drawn

weary grail
crystal perch
#

at least try

weary grail
#

alright

#

doesnt work

crystal perch
# weary grail alright

why not instead do

  calculate = function(self, blind, context)
        if not blind.disabled then
            if context.debuff_hand then
                blind.triggered = false
                if context.scoring_name == 'Pair' then
                    blind.triggered = true
                    return {
                      debuff = true
                    }
                end
            end
        end
    end
mystic river
#

if i want to make an enhancement that makes the card monochrome, how would i do that
i don't know what a draw step is or how it works okay

zealous glen
elder rune
lucid owl
elder rune
#

Balatro at 3 am 😧

wheat rapids
#

How could I modify the values of a joker through another joker?
Something like the Oil lamp from Cryptid. I tried looking at the code but didn't understand how to do it

wheat rapids
#

Alright smiley_face

elder rune
#

ik its a bunch but focus most on the modify_value function

wheat rapids
#

Okay I'll try to do it
Thanks

weary grail
#

🙏

vernal seal
#

Question:
How can i make it gives for Best Hand Stat?

hallow slate
#

How do you get whether you're selling a card or destroying it, or removing it? Trying to have it do smth only if you destroy it -- not if you sell/remove it

vague crag
#

Is there a list of what you can do in stake modifiers

red flower
vague crag
#

thx

obtuse silo
#

is there a variable that checks the number of hands played on a given round

#

i want to be a merciful soul and not force my player to sit through triple baka again

obtuse silo
#

i should go do that
it's been a while ngl-

#

just
had a sudden hankering to mod, you know

hallow slate
rocky plaza
#

how would i prevent the player from making any form of input for a short period of time?

vernal seal
vague crag
#

Can stake modifiers affect stuff when a hand is played

#

Like, when I play a hand, x happens

red flower
red flower
red flower
vague crag
#

That's amazing to know thanks

obtuse silo
#

mmm
now i'm wondering if it's possible to "undebuff" cards

#

nvm
found a method

#

hold on
they literally just debuff themselves again
how do i keep them debuffed

vague crag
#

What am I doing wrong here?

red flower
obtuse silo
red flower
vague crag
#

Why are underscores inconsistent

red flower
#

CardArea is a type of object

vague crag
#

Hm...

wheat rapids
#

How do I fix my code?
It should duplicate the values on the joker to the right but it just crashes cuz of "extra"

obtuse silo
vague crag
#

Is there anything wrong with THIS?

chrome widget
vague crag
mystic river
red flower
urban wasp
#

why doesn't this take_ownership attempt work?

SMODS.Edition:take_ownership("negative", {
  shader = false
})
rocky plaza
obsidian spear
#

tried that

#

didnt work

urban wasp
rocky plaza
#

ah

#

i forgot

urban wasp
#

and SMODS.Joker:take_ownership("invisible,..." works for invisible joker without a j_

rocky plaza
#

that detail of take_ownership

#

hmmmm

urban wasp
#

yea

rocky plaza
#

that is odd

obsidian spear
#

note that if i put this in an update hook nothing happens

harsh belfry
#

this version of pairs wouldn't obliterate a false i think so it isn't skipping over it in that sense

chrome widget
#

yeah I checked that too

#

It's not that it's skipping it as a falsy value

#

hold on let me check smth

obsidian spear
#

we have 6 people tryna fix the same problem bro

harsh belfry
#

modify key wouldn't be going off on accident because of the guard...

chrome widget
#

The reason why is, probably, because negative has a separate clause for this:

if (edition and edition.negative) or (self.ability.name == 'Antimatter' and (self.config.center.discovered or self.bypass_discovery_center)) then
    self.children.center:draw_shader('negative_shine', nil,     self.ARGS.send_to_shader)
end
harsh belfry
#

i know this because i've used that shader

chrome widget
#

So it's always drawing this regardless of the value, even though it might skip the base one

urban wasp
harsh belfry
#

to be lazy

obsidian spear
#

have we tried lovely patching

harsh belfry
#

we could actually

#

target the shader = 'negative' line and kill it

urban wasp
chrome widget
#

otherwise it's possible it's somehow interfering with SMODS already taking ownership of it

urban wasp
#

oh fair actually

obsidian spear
#

but it takes ownership after

chrome widget
#

a more bootleg version of this would be to declare SMODS.Shader on the vanilla negative shader key and point the path at the dissolve shader instead

harsh belfry
#

yeah atp actually lovely patch it

#

ong

obsidian spear
#

🙏

chrome widget
#

But yeah do you have anything in your debug log about it failing to register the take ownership?

obsidian spear
#

lemme check

#

time between load and other info

#

i dont see nothing

harsh belfry
#

the order is this for loading the smods stuff

#

loader is after game object where the take ownership happens

#

weird

obsidian spear
#

odd...

#

istg if we need to ask another person for help

harsh belfry
#

even here its done in the right order

#

wtf

rigid pebble
red flower
obsidian spear
#

yea

red flower
#

they're hardcoded as far as i know like winter showed

#

there's one that applies the base negative as opposed to negative_shine

obsidian spear
#

so lovely patching?

rigid pebble
red flower
#

you could take ownership of the drawstep but patching is probably easier

rigid pebble
#

WHAT

chrome widget
#

oh yeah sorry I was right earlier, just looking at the wrong thing

rigid pebble
#

i was right

obsidian spear
#

omg all this time george was right

chrome widget
#

Because Negative is broken up into two sections, the base negative is hardcoded in 'front'

SMODS.DrawStep {
    key = 'front',
    order = 0,
    func = function(self, layer)
        --Draw the main part of the card
        if (self.edition and self.edition.negative and (not self.delay_edition or self.delay_edition.negative)) or (self.ability.name == 'Antimatter' and (self.config.center.discovered or self.bypass_discovery_center)) then
            if self.children.front and (self.ability.delayed or not self:should_hide_front()) then
                self.children.front:draw_shader('negative', nil, self.ARGS.send_to_shader)
            end
        elseif not self:should_draw_base_shader() then
            -- Don't render base dissolve shader.
        elseif not self.greyed then
            if self.children.front and (self.ability.delayed or not self:should_hide_front()) then
                self.children.front:draw_shader('dissolve')
            end
        end

        local center = self.config.center
        if center.set == 'Default' or center.set == 'Enhanced' and not center.replace_base_card then
            if not center.no_suit then
                local suit = SMODS.Suits[self.base.suit] or {}
                if suit.draw and type(suit.draw) == 'function' then
                    suit:draw(self, layer)
                end
            end
            if not center.no_rank then
                local rank = SMODS.Ranks[self.base.value] or {}
                if rank.draw and type(rank.draw) == 'function' then
                    rank:draw(self, layer)
                end
            end
        end
    end,
    conditions = { vortex = false, facing = 'front', front_hidden = false },
}
harsh belfry
#

so just
kill the drawstep

red flower
#

killing the draw step would stop all the other parts

rigid pebble
#

this is why you listen to me all the time

harsh belfry
rigid pebble
#

i may not know how to code but i know that maybe you could just lovely patch it out

harsh belfry
#

that first if statement needs to be killed however

#

if false goes hard 🔥

frosty rampart
#

streamer why aren't you taking the lovely patch it synergizes with the run

vale zinc
#

Is there any way to pack two variables into a single localize{} statement?


localize = {
    k_lapsems_list_recursive = '#1#, #2#'
    k_lapsems_list_and = '#1# and #2#'
}

LAPSEMS.recursive_list_maker = function(list_to_use, end_of_list)
    if #list_to_use == 1 then
        return list_to_use[1]
    end
    
    if #list_to_use == 2 then
        return {
            localize {
                type = 'variable',
                key = 'k_lapsems_list_' .. end_of_list,
                vars = {
                    list_to_use[1],
                    list_to_use[2]
                }
            }
        }
    else
        local removed_element = table.remove(list_to_use, 1)
        return {
            localize {
                type = 'variable',
                key = 'k_lapsems_list_recursive',
                vars = {
                    removed_element,
                    LAPSEMS.recursive_list_maker(list_to_use, end_of_list)
                }
            }
        }
    end
end

eval LAPSEMS.recursive_list_maker({'milk', 'eggs', 'fabric softener'}, 'and')
--[[
Expected output:
milk, eggs and fabric softener

Actual output:
Table:
1: ERRROR
--]]
jade scarab
#

is this how loading a folder is usually done

red flower
vale zinc
#

How would it be organized incorrectly?

azure laurel
#

I want to know something. In my mod there is new suits and a friend tell me that I should add the spectrum poker hand from Bunco and paperback, but idk if is free to use (code and sprites) or I should ask some kind of permission or smth
Someone could tell me?

red flower
vale zinc
frosty rampart
#

in all cases of your function, you're returning a table that contains the localize call

#

so you've got a bunch of nested tables now

vale zinc
#

It only ever correctly processes the first element.

red flower
#

can't you localize ,, or and and separately

vale zinc
#

Desired output:

eval LAPSEMS.recursive_list_maker({'milk', 'eggs', 'fabric softener'}, 'and')
-- milk, eggs and fabric softener
vale zinc
red flower
#

i feel like this is too complicated for simple concatenation

jade scarab
red flower
jade scarab
#

ic

#

also is it fine for me to look through some mods' source code to get a standard on how localization and stuff is done

red flower
#

yeah everyone does

#

i give you explicit permission to look at vanillaremade, jokerdisplay or joyousspring

vale zinc
frosty rampart
#

remove the outermost set of {} in the return statement
i.e. instead of return { localize... } it should just be return localize...

obsidian spear
#

how would one go about making custom blind types, such as a "new boss blind"

wind steppe
jade scarab
vale zinc
queen meadow
queen meadow
#

uhh no

harsh belfry
#

oml

harsh belfry
queen meadow
#

should it be like that?

harsh belfry
#

yeah

queen meadow
#

🙏

harsh belfry
#

target = '=[SMODS _ "src/card_draw.lua"]' i mean

queen meadow
#

the negative patch didn't work AND the ace is gone 😭

#

we ain't getting this

red flower
#

that one is for playing card fronts