#💻・modding-dev

1 messages · Page 585 of 1

long sun
#

okay new question

#

how would i hook in_pool 😭

daring fern
long sun
#

ya it changes the tarot and planet rates and such

#

oh i see, it uses patches

#

gotcha

wispy falcon
#

bump

rotund sable
#

It's called SMODS iirc

#

But depending what you want to test you may not need a custom deck

wild berry
#

how can i check when a joker gets moved

wispy cove
#

guys help

#

im trying to make it so if there's 3 of any kind of face card individually, it gives 3.14 mult

#

but my code is the uh

#

'not workl

wild berry
#

could you reformat please? it looks awful on my screen

daring fern
wispy cove
#

explain?

#

im a bit dum dum

wild berry
#

i think you pass an id

#

and it gives you how many of that id

daring fern
wild berry
#

are in the hand passed

#

or table

wispy cove
daring fern
wild berry
#

oh

daring fern
vale grove
#

hey yall just a quick question, how many py and px are seals?

daring fern
long sun
#

this patch works, except for the blind select page, where the blinds display their normal values

#

why doesn't that specifically work?

daring fern
long sun
#

ahhh i see

daring fern
#

Because it uses the dollars from the object from G.P_BLINDS

quartz pendant
#
    calculate = function(self, card, context)
        if context.pre_discard and G.GAME.current_round.hands_played == 0 then
            G.E_MANAGER:add_event(Event({
                trigger = 'immediate',
                func = function()
                    local discard_count = #G.discard.cards
                    G.FUNCS.draw_from_deck_to_hand(discard_count+1)
                    card:juice_up()
                    return true
                end
            }))
    end

I want to design a Joker card with the effect: "When discarding, you can draw one extra card." But my G.discard.cards seems to be empty during the first discard? (The first time, I discarded 5 cards, so I should have drawn 6 cards, but G.discard.cards was nil; the second time, I only discarded one card, and then G.discard.cards stored the cards from my previous discard, resulting in drawing 6 cards.)

robust marsh
#

Can I ban specific jokers from being spawned by SMODS.create_card

daring fern
robust marsh
daring fern
robust marsh
# daring fern What do you mean?

Sorry, what I meant is would this somehow affect the seed pool in any way? For example if blueprint gets banned then unbanned again would that allow it to be spawned naturally? I thought banned keys permanently alters the joker pool

daring fern
robust marsh
#

I know I can just flick it from true to false and slot in SMODS.create_card in between

#

alright

#

thank you

quartz pendant
daring fern
meager quiver
#

hai :3 so uhm, im tryinna move a thing that currently works on math.random and math.randomseed into pseudoseed so it changes every time u go into a run, but im getting confused on how i should structure it

here is the original code:

math.randomseed(n)
return allowed[math.random(1, #allowed)]

and heres how i tried doing it (sorry if its stupid xwx):
return pseudorandom_element(allowed, pseudoseed(n))

any help would be useful <3

#

btw idk if its important but, allowed is a table

slim ferry
#

you should use pseudorandom

#

its just the same but in 1 function

quartz pendant
ashen drift
#

this is so fucked up

slim ferry
#

actually

#

wait

#

pseudorandom_element is correct yeah

ashen drift
#

indeed psuedorandom element

daring fern
lavish elm
#

what is the use of event manager add event

meager quiver
quartz pendant
meager quiver
#

but its crashing :C

daring fern
slim ferry
#

though cryptid is usually not the best reference

ashen drift
#

true

slim ferry
meager quiver
slim ferry
#

uhm

ashen drift
#

game isnt loaded for some fucking reason??

slim ferry
#

when does the crash happen

ashen drift
#

nvm 88 mods

daring fern
slim ferry
#

okay

#

yeah

meager quiver
ashen drift
#

how do people even play with 88 mods

slim ferry
#

okay but still maybe not a great idea to test with 88 mods 😭

ashen drift
#

in general it is best to dev your mod individually

meager quiver
ashen drift
#

show code

quartz pendant
slim ferry
#

yea

quartz pendant
#

but it's actually working

#

is there any way to fix this

#

after discarding twice, It's now drawing two cards that I don't recognize lol

#

those two blank spaces are (probably?) the card it drew

lament agate
#

am i doing this right

#

wait shit

daring fern
lament agate
#

not Joker

daring fern
#

vale grove
#

hey yall just curios, how do you make a tarot card show up in the collection/tarot tab
i made my first tarot card and im kinda confused on how to make it show up in the collection (if it even exists lol)

lavish elm
vale grove
#

then im probably doing something wrong lol

daring fern
lavish elm
#

ok thx for clarifying

vale grove
daring fern
vale grove
daring fern
vale grove
#

i just recently organized everything is there something i should know about that

#

previously everything was in a main.lua

daring fern
vale grove
#

how does loading work exactly

daring fern
wild berry
#

how can i get a rank's id

daring fern
wild berry
#

ty

#

are the suits in SMODS.Suits just their names

#

and if they arent, how can i get them

#

like with how card.base.suit stores them

daring fern
wild berry
#

and how can i get the key of a suit from a card

#

is it still card.base.suit

daring fern
wild berry
#

okty

lofty elm
#

quick question, anyone know if there's an equivalent next(SMODS.get_enhancements(k)) for seals or editions?

lofty elm
#

oh damn, I literally looked in that document but missed it

daring fern
lofty elm
#

ty lol

slim ferry
#

there isnt a function like that because quantum seals and editions dont exist

wild berry
#

why does this cause an overflow

lavish elm
#

how to increase booster shop and voucher shop slots?

wild berry
#

look at how vanillaremade does it

slim ferry
#

??

wild berry
#

search for overstock

slim ferry
#

vanillaremade doesnt do that

wild berry
#

wait

#

oops

#

i misunderstood

lavish elm
#

yeah I was confused

slim ferry
#

iirc

daring fern
wild berry
#

to create a temporary table for the suits

daring fern
wild berry
#

because im trying to make a deck that deletes 2 random suits for each rank

#

is the issue copytable?

daring fern
wild berry
#

what do i do instead then?

vale grove
#

is it a good idea to make one "main" file in my mods folder

#

that runs everything

#

so for example in meta deta i call main.lua as my main folder and then in that main cast all load files

daring fern
vale grove
vale grove
#

yeah but

#

in more detail

slim ferry
#

theres not much detail to be explained

#

its jsut a file path

daring fern
vale grove
vale grove
daring fern
vale grove
#

so just mods?

daring fern
wild berry
daring fern
wild berry
#

ahh ok

vale grove
#

man im trying to look at other mods i have installed to try and draw inspiration and with every single line i read i get more and more confused

slim ferry
#

just look at vanillaremade

#

in VanillaRemade.lua

vale grove
#

wait what

#

if its that simple why does every mod ive looked at so far do it in a way more complicated way?

slim ferry
#

a lot of mods do recursive loaders because they have a lot of things split into individual files

stiff locust
#

i don't do recursive loaders

#

but also chaaaaat i need help with SMODS.gradient

#

I tried using it with custom colours and it's just coming out as black

wild berry
#

why does my deck delete every single card

stiff locust
#

from a glance, is this supposed to be a not?

wild berry
#

yes

#

because it chooses suits to keep

#

for that rank

stiff locust
#

what

#

hold on so you're destroying every card except

#

the 7 of hearts or something

#

?

wild berry
#

wait huh

#

no like

#

for every rank

stiff locust
#

oh for each rank

wild berry
#

yeah

#

if i like

#

choose hearts and spades

#

for example

#

jacks

#

it will only keep jacks of hearts and spades

#

and the suit will be randomized for the other ones

stiff locust
#

why don't you just destroy 2 cards from each rank in the deck

#

doesn't that have the same effect

wild berry
#

wait ur right

stiff locust
#

yeah i was wondering why you didn't do that

wild berry
#

smthing like this?

#

forgot the pairs, dont mind that

#

and it still destroys everything

stoic void
daring fern
stoic void
#

dang

#

ok

wild berry
daring fern
#

Also are you editing directly on GitHub?

wild berry
#

are you referring to @stoic void or me

stoic void
daring fern
wild berry
#

wait shit i realized the issue

#

i used the entire table of cards to destroy lmao

stoic void
cursive gazelle
#

Vscode is free and by Microsoft

vale grove
#

im reading from vanllia remade on how to add tarots but im a little confused by something

wild berry
vale grove
#

-- The config field already handles the functionality so it doesn't need to be implement,
it says this under all of the tarots

cursive gazelle
#

Vscode is 100% safe

stoic void
vale grove
#

where and what is the config field exactly

slim ferry
cursive gazelle
#

Config is where you usually store your variables/values

wild berry
#

why is the amount of cards i lose incosistent

cursive gazelle
#

You can check the tarot remade code for reference

vale grove
slim ferry
#

how it works

#

the function of the card

vale grove
#

to jokers atleast theres alot more to it no?

slim ferry
#

yeah because jokers always require code

#

afaik

vale grove
slim ferry
#

but with consumables max_highlighted, mod_conv and suit_conv is handled automatically

stoic void
#

I dont know how to use vs code

vale grove
#

simple?

#

easy

lofty elm
#

Hey, I realied when you add a card to your hand from your deck, it comes facedown. I tried just adding :flip() after drawing it but it didnt work lol, anyone know how to fix that? (I'm drawing it using emplace like dna in vanilla remade)

cursive gazelle
lament agate
#

is calc_dollar_bonus a thing

vale grove
#

ig for more specification

#

i want to make a tarot that adds one seal to a card

#

so i was thinking of looking at justice and then change the glass value to a seal value

cursive gazelle
#

I believe

slim ferry
#

no???

vale grove
#

but now bcs of this whole config field im a little confused

cursive gazelle
#

Like a set of tarot ?

#

Like spectrals

slim ferry
#

even then

#

you would use ConsumableType

stoic void
#

I know how to use it now

cursive gazelle
#

My bad i forgot

vale grove
#

i was thinking about a whole seperate thing (like tarots, planets, spectrals, mything) but i have a feeling thats way to difficult (WAS as in not anymore just gonna stick to tarots for now)

cursive gazelle
#

God forbid you forget function

slim ferry
daring fern
slim ferry
#

also copy from vanillaremade seal spectrals

vale grove
#

i completely forgot about those

lofty elm
cursive gazelle
lofty elm
#
G.E_MANAGER:add_event(Event({
  func = function()
    magnet_card = pseudorandom_element(most_changed,  pseudoseed('magnet'))
    G.hand:emplace(magnet_card)
    magnet_card:flip()
    magnet_card:juice_up(0.5, 0.5)
    return true
  end
}))
vale grove
cursive gazelle
vale grove
#

i ussually have a game open to play when i eventually have had enough headaches from trying to understand this XD

lofty elm
daring fern
lofty elm
#

oh ok cool

#

ty

#

or wait

#

can I draw a specific card this way?

daring fern
#

Use draw_card

lofty elm
#

doesn't seem like that's the way to do it

daring fern
lofty elm
#

sorry I'm unfamiliar with this one so just draw_card doesn't get me there

#

draw_card(card_to_draw)?

#

i need to draw a specific card

daring fern
lofty elm
#

ok cool

#

Where would I be able to find that information? I feel like I can never find functions like this in the github stuff I've seen

#

And I hate always asking you guys but idk where else to find this stuff

frosty rampart
#

vanilla functions like draw_card should have a bit of documentation in the lsp_def/vanilla.lua file in smods, but it's not super human readable because it's meant to be used by the LSP system

lofty elm
#

got it

#

someone should make a more accessible way to find this stuff lol

#

I say that as if that wouldn't be a ton of effort but like

#

it would be nice

frosty rampart
#

yea it's definitely a lot of work to write good documentation

#

but well worth the effort

lofty elm
#

ye

stoic void
lofty elm
#

yeah sorry, are you asking how to implement your joker? or what

royal comet
#

Made a. Rat

#

It shakes then explodes

lofty elm
royal comet
#

The smooth chaotic movements were actually pretty difficult to make properly

lofty elm
#

(in a good way)

daring fern
quartz pendant
#

it won't let me select the face-down card

#

I should record this

daring fern
modest cradle
lofty elm
#

got it, all good

quartz pendant
#

how can I solve this?

#

and sometimes it still shows up as blank lol

#

probably a refresh issue or something similar, but I don't really know how to fix that

royal comet
stiff locust
daring fern
stiff locust
#

oh

#

that's cool

#

do you know anything about smods.gradient

daring fern
stiff locust
#

do you know why it would always be coming out black

stiff locust
#

local tsunlc = loc_colour
function loc_colour(_c, _default)
    if not G.ARGS.LOC_COLOURS then
        tsunlc()
    end
    G.ARGS.LOC_COLOURS.tsun_gold1 = HEX("FFD700")
    G.ARGS.LOC_COLOURS.tsun_gold2 = HEX("f6e3c3")
    G.ARGS.LOC_COLOURS.tsun_gold3 = HEX("edd5a9")
    G.ARGS.LOC_COLOURS.tsun_gold4 = HEX("dcbe78")
    G.ARGS.LOC_COLOURS.tsun_gold5 = HEX("d8b162")
    G.ARGS.LOC_COLOURS.tsun_pale = HEX("E1ECF2")

    return tsunlc(_c, _default)
end

SMODS.Gradient {
    key = "tsun_gradient_gold",
    colours = {
        G.C.tsun_gold1,
        G.C.tsun_gold2,
        G.C.tsun_gold3,
        G.C.tsun_gold4,
        G.C.tsun_gold5,
    },
    cycle = 1
}

i made the code for all the other colours aages ago and i'm trying to convert them into a gradient now

#

the individual colours work properly

#

but the gradient is just always black

daring fern
rotund sable
#

Loc_colours are used in text

stiff locust
#

but when I do {C:tsun_gold1} in a joker the colours still work?

#

oh

#

well I guess that explains

#

that

#

it should work if I just put in the hex codes then right

stiff locust
#

right okay

lofty elm
#

Hey, I'm having an issue where I add a card to hand at the start of a round, but if the played leaves and rejoins the run the card isn't there. I tried throwing a save_run() after adding the card to hand since I saw that somepleace but it didn't seem to work, anyone know how I might go about fixing that?

stiff locust
#

i completely forgot that everyone else can save runs and I can't

stiff locust
daring fern
stiff locust
#

oh

#

it didn't work

daring fern
stiff locust
#

the gradient works in text but here it just comes out white

SMODS.Rarity {
    key = "tsun_gold_legendary",
    default_weight = 0,
    badge_colour =  SMODS.Gradients.tsun_tsun_gradient_gold,
    pools = { ["Joker"] = false },
    get_weight = function(self, weight, object_type)
        return weight
    end,
}

and yes i tried it with only one tsun_ and it still just came out white

daring fern
stiff locust
#

I'm not sure

#

this code is at the top of a file loaded with load_file

#

and the file is loaded before the gradient is defined

#

but I thought loaded files ran after the current file was finished loading?

#

oh I can just put it in end_of_code

daring fern
stiff locust
#

i had this issue with something else and I made a lua file specifically for the end of the code

#

that didn't work either

#

¯_(ツ)_/¯

wild berry
#

is it possible to set other blinds (ex. small and big blind) to another blind?

stiff locust
#

yeah

wild berry
#

how so

stiff locust
#

idk

#

morefluff's hidden voucher does it

wild berry
#

who's what?

#

link it

rotund sable
#

From what I recall it needs a lot of patches

willow scroll
#

What's the best way to alter the chip amount per blind as long as a thing is held

#

Like if I wanted a voucher that doubled the score requirement

slim ferry
#

so you need fancy patches

#

if thats what you want to do

wild berry
#

yeah

#

is it possible to get the blind from the current choices

#

like

#

get the small and big blind

#

and modify their propreties

slim ferry
#

oh like

#

yeah theres like G.GAME.round_resets.blind_choices i think?

#

but thats just 3 keys, you cant modify anything else about the blind before starting it besides what blind it is

wild berry
#

can i atleast get its position

#

like

#

is it in the place of the big blind or not

#

or

#

get their index

#

in the rounds

#

is there a hook i can add to check when a blind is selected

stiff locust
#

you can hook any context as a function

wild berry
#

how

wild berry
shadow thicket
#

Can someone let me know what went wrong?

jolly shadow
#

not without seeing any code probably?

shadow thicket
#

Oh?

jolly shadow
#

or well

#

wait 1 sec

#

youre on the wrong smods for multiplayer

wild berry
stiff locust
#

sorry

#

busy

jolly shadow
jolly shadow
wild berry
#

ok thanks

#

is there something that allows me to get the boss blind's position? something like i just did on the image?

dry fractal
#

Hey I’m having an issue where stakes wont unlock for me (example playing purple stake to unlock orange and playing white stake to unlock black) does anyone have any tips or ideas to which file would handle this issue?

jolly shadow
wild berry
#

no like

#

their index

#

or wait

slim ferry
#

its Small, Big and Boss

#

they arent numbered

jolly shadow
#

ye

wild berry
#

oh

#

could i do something like this to prevent antes from increasing

jolly shadow
wild berry
#

so i should copy the code and add my check?

jolly shadow
#

no

#
if context.modify_ante and context.ante_end then 
  local halt_ante = true -- set this to your condition for stopping the ante increase
  if halt_ante then return { modify = 0 } end 
end
wild berry
#

ahh ok

#

is G.GAME.blind still defined during context.ante_end?

jolly shadow
#

ye

#

took me a bit to find it

wild berry
jolly shadow
#

code i found was a little bit outdated so im adjusting the solution, one moment

#

set modify to -1

#

instead of 0

wild berry
#

ok

#

worked but

#

it still resets the blinds

#

is there any way to circumvent that?

jolly shadow
#

im not sure, went looking thru both balatro source & smods for a bit but cant seem to find an easy way to do so, still looking tho

mystic river
#

bringing this back since it's been a while and nobody had an answer at the time

SMODS.PokerHandPart{ -- Handful of Rocks base
    key = 'handful',
    func = function(hand)
        local cards = {}
        local count = 0

        for _, card in ipairs(hand) do
            local enh = card.config.center.key
            if MINTY.rocks[enh] then
                table.insert(cards, card)
                count = count+1
            end
        end
        
        if count >= 5 then
            return cards --IT'S ALREADY A TABLE, YOU DON'T NEED TO PUT IT IN A TABLE
        else
            return {}
        end
    end
}

SMODS.PokerHand{ -- Handful of Rocks
    key = 'Handful',
    visible = false,
    chips = 55,
    mult = 6,
    l_chips = 25,
    l_mult = 2,
    example = {
        { 'S_2', true, enhancement = "m_minty_microcline"  },
        { 'D_7', true, enhancement = "m_minty_microcline"  },
        { 'C_3', true, enhancement = "m_minty_marble"      },
        { 'C_5', true, enhancement = "m_stone"             },
        { 'H_K', true, enhancement = "m_minty_crystal"     },
    },
    evaluate = function(parts)
        return parts.minty_handful
    end
}

any ideas why some of the rocks in a handful wouldn't score, despite being part of the poker hand?

ripe oak
#

maybe compare with the Cryptid Bulwark hand code

#
        local stones = {}
        for i, card in ipairs(hand) do
            if card.config.center_key == "m_stone" or (card.config.center.no_rank and card.config.center.no_suit) then
                stones[#stones + 1] = card
            end
        end
        return #stones >= 5 and { stones } or {}
    end,```
mystic river
#

hmm
not all of these rock enhancements have always_score
i feel like that's related

#

cryptid doesn't need to handle anything for the bulwark, since vanilla stones do have that trait

lofty elm
#

hey gang, I've got something that adds a card to hand after the first hand is drawn, but it doesnt save or happen again if I leave and come back, anyone know why?

ripe oak
#

then idk

lofty elm
#

I did yeah

#

didnt seem to make a difference :/

wild berry
#

are you calling it before making the card or after creating it?

lofty elm
#

well I'm not creating it im just drawing it out of the deck

#

but after

wild berry
#

show code

ripe oak
#

BTW while that's happening does anyone know how to reduce the reward money from blinds with a custom stake?

wild berry
#

set dollars to a lower value

#

the property

#

wait

#

custom stake??

jolly shadow
ripe oak
wild berry
#

its from some of my code

lofty elm
#
  func = function()
  magnet_card = pseudorandom_element(most_changed,  pseudoseed('magnet'))
  draw_card(G.deck, G.hand, 100, nil, nil, magnet_card) 
  G.hand:sort()
  save_run()
  return true
  end
}))
wild berry
#

you can just do a math.max(0, blind.dollars - 1)

wild berry
#

try that

lofty elm
#

wont that run before the event though

#

i mean I can try it i suppose

#

didnt work unfortunately

ripe oak
# wild berry something like this

I'm mostly just wondering where to put that code to execute it like what to take ownership off or insert somewhere with lovely etc.

mystic river
wild berry
#

and check for the current stake

#

and if its the stake that you want

#

do the code snippet

lofty elm
#

is there maybe a context for reentering a run from the menu lol

#

since it doensn't redraw the cards my thing doesn't retrigger

#

and for some reason I cant save

ripe oak
lofty elm
#

I checked the list I usually look at and its not there but someone sent me one that isnt on that list once so idk

timid zinc
#

My deck's variables don't reset run-to-run

#

How do i get it to reset?

slim ferry
#

use a variable in G.GAME

#

self is the prototype object thats in G.P_CENTERS, changes to that are permanent

maiden phoenix
stiff locust
#

breaking news: this user made a slight grammatical error using brackets

royal comet
stiff locust
royal comet
lofty elm
#

I'm so confused, I'm playing spot the difference between my code and vanilla remade code bc mine doesn't save the card it adds

My code:

G.E_MANAGER:add_event(Event({
    func = function()
        magnet_card = pseudorandom_element(most_changed,  pseudoseed('magnet'))
        draw_card(G.deck, G.hand, 100, nil, nil, magnet_card) 
        magnet_card:juice_up(1, 1)
        G.hand:sort()
        SMODS.calculate_context({ playing_card_added = true, cards = {magnet_card} })
        save_run()
        return true
    end
}))

From vanilla remade:

G.E_MANAGER:add_event(Event({
    func = function()
        G.hand:emplace(_card)
        _card:start_materialize()
        G.GAME.blind:debuff_card(_card)
        G.hand:sort()
        if context.blueprint_card then
            context.blueprint_card:juice_up()
        else
            card:juice_up()
        end
        SMODS.calculate_context({ playing_card_added = true, cards = { _card } })
        save_run()
        return true
    end
}))```
#

I don't even want to do the calclulate context in mine bc im not even adding a card to my deck I just thought maybe that was the problem

#

maybe adding a card to your deck makes it save but drawing one doesn't?

jolly shadow
lofty elm
#

ik lol, i didn't have it until I was banging my head agaisnt the wall tryna figure out what was different

#

it didnt do anything so its gonna die but i left it in in case someone else thought that

jolly shadow
#

i dont think this would cause u not to save, theres gotta be something else in ur code that youre not showing

faint yacht
lofty elm
# jolly shadow i dont think this would cause u not to save, theres gotta be something else in u...
calculate = function(self, card, context)
  if context.first_hand_drawn then
      --Find a list of most changed cards
      local most_changed = {}
      local max_change_count = -1
      local change_count = 0
      local in_hand = false
      for i, playing_card in pairs(G.playing_cards) do
          in_hand = false
          for _, card_in_hand in ipairs(G.hand.cards) do
              if playing_card == card_in_hand then
                  in_hand = true
              end
          end
          if not in_hand then 
              change_count = 0
              if next(SMODS.get_enhancements(playing_card)) then change_count = change_count + 1 end
              if playing_card.edition then change_count = change_count + 1 end
              if playing_card.seal then change_count = change_count + 1 end

              if change_count > max_change_count then
                  max_change_count = change_count
                  most_changed = {playing_card}
              elseif change_count == max_change_count then
                  table.insert(most_changed, playing_card)
              end
          end
      end

      --Draw card to hand
      G.E_MANAGER:add_event(Event({
          func = function()
              magnet_card = pseudorandom_element(most_changed,  pseudoseed('magnet'))
              draw_card(G.deck, G.hand, 100, nil, nil, magnet_card) 
              magnet_card:juice_up(1, 1)
              G.hand:sort()
              SMODS.calculate_context({ playing_card_added = true, cards = {magnet_card} })
              save_run()
              return true
          end
      }))
  end
end,
#

actually it is pretty bad

broken rivet
faint yacht
#

save_run() should be its' own event afterwards.

jolly shadow
lofty elm
timid zinc
lofty elm
#

oh shit

jolly shadow
#

it might be that ur setting it as a global

#

i missed that entirely

lofty elm
#

oop, lemme see

#

i did too obviosuly lol

jolly shadow
#

should fix the saving

lofty elm
#

ty ill let you know if it works

lofty elm
#

ty for finding that tho it was probably not good

jolly shadow
#

im not the greatest w/ debuggin stuff but i tried

#

all in a days work for eddy rob

lofty elm
#

should i maybe make the variable outside the event?

#

lol thats fair

#

ty for trying

wild berry
#

why are the cards so incosistent?

lofty elm
#

if u dont feel like debugging ur all good lol

slim ferry
#

hello

lofty elm
#

but you tend to be quite helpful

slim ferry
#

try saving the run in a seperate event after that drawing cards one maybe?

tender ermine
#

Any1 know of a way to edit an enhancement/edition’s weight?

lofty elm
#

i did try that but maybe i did it wrong ig? someone else suggested that too

slim ferry
tender ermine
lofty elm
#

damn

#

ty for trying tho

tender ermine
wild berry
#

im like getting 9 jacks

slim ferry
# tender ermine Yes

take ownership of it, and then set weight to a value (default is 5), or also add a get_weight function if you want it to be dynamic instead of a static weight

wild berry
#

is there a way to get a card's rank as in the string format

#

like in SMODS.Ranks?

robust marsh
#

are there any modded jokers that inherit the ability of a random joker? I can't figure out how to do it at all considering i'm also targeting a specific group of jokers

wild berry
jolly shadow
wild berry
#

by picking it out from G.P_CENTERS

wild berry
tender ermine
robust marsh
wild berry
#

ill try

tender ermine
robust marsh
robust marsh
slim ferry
tender ermine
#

But it was the best I could find, still kinda new

faint yacht
snow geode
#

hello, i'm trying to make a mod that changes the sprites for constellation and hologram using malverk, i tried to do it myself but i honestly can't wrap my head around how to start with that, could anyone here help me with that?

wild berry
#

take ownership

#

and change atlas

slim ferry
#

dont?

#

theres a reason malverk exists

#

and its so you dont have to take ownership of stuff

snow geode
#

so what should i do if you wouldn't mind? i tried looking it up and didn't really get anything back
which is why i came here to ask

slim ferry
#

have you asked in the malverk thread? idk many people here that use malverk much

snow geode
#

didn't know that was a thing if im being honest

tender ermine
#

Okay my weight stuff is still tweaking out, I’m trying to make my modded enhancement and edition scale on how many of them you have

#

And I’m having trouble altering the weights

snow geode
slim ferry
#

okay wtf i cant find the malverk thread

#

who ate it

snow geode
#

😔

wild berry
#

why does the deck show like this?

snow geode
snow geode
#

oh yay thank you

#

should i just forward the initial message there

jolly shadow
#

anyone know how i would go abt adding another tab to the collection's "other" section? i want to add a section under stickers for my custom card type

jolly shadow
crystal perch
#

trying to make my joker have custom dimensions like square joker by hooking some functions, but i keep getting this crash. any help? here's the code:

-- Custom dimensions for Jokers
local set_sprites_ref = Card.set_sprites
function Card:set_sprites(_center, _front)
  local ret = set_sprites_ref(self, _center, _front)
  if _center then
    if _center.set then
      if _center.key == "j_chak_steal_this_joker" and (_center.discovered or self.bypass_discovery_center) then
        self.children.center.scale.y = self.children.center.scale.x
      end
    end
  end
  return ret
end

local set_ability_ref = Card.set_ability
function Card:set_ability(center, initial, delay_sprites)
  local ret = set_ability_ref(self, center, initial, delay_sprites)
  if center.key == "j_chak_steal_this_joker" and (_center.discovered or self.bypass_discovery_center) then
    H = W
    self.T.h = H
  end
  return ret
end

local load_ref = Card.load
function Card:load(cardTable, other_card)
  local ret = load_ref(self, cardTable, other_card)
  if self.config.center.key == "j_chak_steal_this_joker" then
    H = W 
    self.T.h = H*scale
    self.T.w = W*scale
  end
  return ret
end
#

tbf the base game uses _center.name but when i did that it just didn't work

red flower
crystal perch
#

it might be from a different mod this time though'

red flower
#

that looks like you did something wrong while modifying .T.h

crystal perch
#

i pretty much 1:1 copied it from the source code so idk

red flower
#

like what does this mean

#

H and W are nothing?

crystal perch
#

blame the thunk

red flower
#

no i blame you

#

read the code properly

#

also i just realized

#

why are you trying to change the size in a hook

#

there are smods apis for that

crystal perch
#

i looked and couldn't find anything on that

red flower
crystal perch
#

🤷‍♀️

red flower
#

also vanillaremade

toxic rain
#

vanillaremade is nice

wild berry
#

how can i move a card i created with add_card into the deck

#

because add_to_deck doesnt work for me

red flower
#

do you want to create it directly in the deck

wild berry
#

yes

red flower
#

add area = G.deck

wild berry
#

kty

red flower
#

add_to_deck doesnt add cards to the deck, it just runs functions when a card should be added to the players slots

#

add_card does that automatically

toxic rain
#

am still struggling with this, it looks fine in the collection but not during a run, its probably something simple but i do be stupid

red flower
#

oh its because it says xmult =

#

remove that

static valley
#

how do I make a joker with a sticker play a sound when it appears in the shop?

#

for context it's going to be a pre-owned sticker which will be used in a custom stake. Pre-Owned jokers will be cheaper, but slightly worse than their new counterparts (as in all of their values are multiplied by 0.75)

toxic rain
static valley
toxic rain
versed swan
#

are color codes in localization case sensitive?

versed swan
#

gotcha, thank you

toxic rain
red flower
#

can i see

#

you didnt change it in calculate didnt you

toxic rain
#

ill post the whole thing just need a seperate message because character limit

#
         local solo_tally = 0
        if G.playing_cards then
            local ranks = {}
            for k, v in pairs(G.playing_cards) do
                 ranks[v:get_id()] = ( ranks[v:get_id()] or 0) + 1
            end
            for k, v in pairs(G.playing_cards) do
                if  ranks[v:get_id()] == 1 then
                    solo_tally = solo_tally +1
                end
            end
            return {
                Return_mult = 1 + card.ability.extra.xmult * solo_tally,
            }
        end
        return { vars = { card.ability.extra.xmult, 1 + card.ability.extra.xmult * solo_tally } }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            local solo_tally = 0
            local ranks = {}
            for k, v in pairs(G.playing_cards) do
                ranks[v:get_id()] = (ranks[v:get_id()] or 0) + 1
            end
            for k, v in pairs(G.playing_cards) do
                if ranks[v:get_id()] == 1 then
                    solo_tally = solo_tally +1
                end
            end
            return {
                Return_mult = 1 + card.ability.extra.xmult * solo_tally,
            }
        end
    end,
#

wasn't sure which return to change so i did both

red flower
#

i said remove, not change

#

also the bottom one was correct before

toxic rain
#

oh whoops, i may be stupid

#

so no return for the top one?

red flower
#

remove just the Return_mult =

toxic rain
#

got it

red flower
#

and you need to add vars too actually

#

return { vars = {1 + card.ability.extra.xmult * solo_tally}}

#

this

toxic rain
#

return { vars = { card.ability.extra.xmult, 1 + card.ability.extra.xmult * solo_tally } } ?

i already have that line two rows down from the edited return, do i need it else where?

#

oh wait yeah this is diffrent

red flower
#

the bottom one is if G.playing_cards doesnt exist

toxic rain
#

ah ok, so i change the return to that?

red flower
#

the first one, yes

toxic rain
#

it works now, thanks 👍

static valley
#

how do I make a custom stake be in-between the red and green stake

feral tree
#

how would i get a joker's loc vars to change if it detects that you have another joker?

frosty dock
#

chat is this any good

frosty dock
frosty dock
feral tree
#

yep

frosty dock
# frosty dock chat is this any good

context: there's a UI inconsistency with vanilla in smods where there's pages on the hands page when there shouldn't be with the vanilla 12 hands or less

#

now a page size of 12 doesn't really work because of space

feral tree
#

what about getting a joker to change entire atlases mid-gameplay?

#

is that possible?

frosty dock
#

a little impractical and maybe too slow if you're reloading a lot of sprites, but sure

wintry solar
#

oh aure's done the poker hand list thing I was suppsoed to do 🤣

vale grove
#

okay so im kinda stumped, i recently got a normal file structure bcs i wanted to add a tarot card

#

so i made a main.lua that runs everything etc

#

now

frosty dock
vale grove
#

when i run my consumables.lua with only this that is straight from vanilla remade

feral tree
#

would be alot more convienient for my situation specifically that i will not elaborate about

vale grove
#

my game instantly crashes

#

with this error

frosty dock
feral tree
#

uh

frosty dock
feral tree
#

Enough to use it??

frosty dock
#

this depends on a custom consumable type 'vremade_Tarot' that you haven't defined in your mod

wintry solar
loud summit
frosty dock
wintry solar
#

unless we remake the page selector

vale grove
frosty dock
frosty dock
#

vremade does it so its redefined tarots don't mix with the vanilla ones

vale grove
#

i just want this to be a tarot

nova orchid
#

how do i make a custom consumable card set

frosty dock
#

you can just change the set to 'Tarot'

vale grove
frosty dock
# feral tree uh

on a scale of 'hint me to some resources that will help me accomplish this' to 'give me all of the code for it'

nova orchid
#

guys how do i make a custom set

#

and then add my consumables to my pack

frosty dock
#

i don't have time for that, as i said it's a tad impractical. maybe someone else will

feral tree
#

where can i find the code for it then??

frosty dock
#

and vanilla remade i guess

frosty dock
#

if this was ready written somewhere and I knew about it, I would have just told you that

violet void
feral tree
#

okay now im genuinely curious how bad it can be

frosty dock
#

changing an individual joker's sprite within the same atlas can be done by calling set_sprite_pos on that joker's center sprite

jolly shadow
#

yo, how do i change the badge color of a custom objecttype ?

boreal iris
#

Random question... how hard is it to make a Balatro mod with near 0 coding knowledge. To learn from scrap and also is there any good ressources

#

I keep getting idea for jokers sometime when I sleep or shower and would love to give a shot at just making them lmao

violet void
frosty dock
#

yeah see that's why I don't really want to give an answer

#

it's annoying to deal with

frosty dock
#

it's worse if you're changing atlases on top of that

boreal iris
jolly shadow
frosty dock
static valley
#
SMODS.Stake:take_ownership("red", {
    unlocked_stake = "comedy_pre_owned",
})

what dod I do wrong???

#

speaking of which,

-- Pre-Owned Stake
SMODS.Stake {
    name = "Pre-Owned Stake",
    key = "pre_owned",
    atlas = "comedy_stakes",
    pos = { x = 0, y = 0 },
    sticker_atlas = "comedy_stickers",
    sticker_pos = { x = 1, y = 0 },
    colour = HEX("fd5f55"),
    unlocked_stake = "green",
    applied_stakes = { "red" },
    modifiers = function()
        G.GAME.modifiers.comedy_enable_preowned_in_shop = true
    end,
}

it doesn't seem to apply the red stake either

fluid lagoon
#

is there a good base to make a deck skin?

static valley
red flower
fluid lagoon
#

so what about a base for the cards themselves

visual sequoia
#

question, do you guys prefer steam modded or balamodded?

frosty dock
frosty dock
static valley
frosty dock
#

lovely+smods is the standard and all content mods use smods

static valley
#

now for the bigger issue at hand: why isn't the sticker appearing

-- in the code for the stake
    modifiers = function()
        G.GAME.modifiers.comedy_enable_preowned_in_shop = true
    end,

-- in the code for the sticker
    rate = 0.3,
    should_apply = function(self, card, center, area, bypass_roll)
        return G.GAME.modifiers.comedy_enable_preowned_in_shop
    end,
frosty dock
#

redefining should_apply like that breaks a few bits and pieces

#

not entirely your fault, the API is just really janky

#

there's a default enable flag though that you should be using

lament agate
static valley
#

btw how do I make it so that the sticker makes the joker cheaper in shops?

round lion
#

how do i add use buttons to non-consumables

static valley
#

wait why is it not showing up

long sun
#

how do i check if a card is a consumable, again?

boreal iris
#

Is there a mod that put us in like a creative mode that allow us to just cheat in joker to test stuff?

long sun
#

DebugPlus

frosty dock
long sun
#

thanks ^u^

static valley
long sun
#

how can i apply stickers to consumables?

jolly shadow
long sun
#

well i tried set_eternal but that hasn't worked

#

DebugPlus also seems to be unable to do that

boreal iris
frosty rampart
#

hold tab for the debugplus cheat sheet

boreal iris
#

oh thanks

static valley
#
    apply = function(self, card, val)
        if card.ability and card.ability.extra then
            card.cost = math.floor(card.cost * 0.75)
            if type(card.ability.extra) == "table" then
                for k, v in pairs(card.ability.extra) do
                    if type(v) == "number" then
                        card.ability.extra[k] = v * 0.75
                    end
                end
            end
        end
    end

this single function is what's causing the sticker to collapse in on itself. the modifiers do work, but now for some reason it does this

#

fixed it

drowsy heath
#

okay so i have a weird question i just want to know if a feature i want to add is even possible, so i have a joker pool called coffee jokers which i have a consumable to give a random one but i specifically let it surpass the joker limit, once the joker limit has been met i want the consumable to give something called "spilled coffee" and they will be negative as to not disrupt the other jokers if you want to change synergy later but it will gain +1 mult for every extra of said card obtained, the others will not grant the mult so im thinking it will have to be 2 seperate jokers but i dont really know where to start with that, thats not what im here for though i will figure it out i just want to know if its even possible

#

well in simple terms is there a way to say if joker count is at 100% do this instead and if its over 100% then give this instead

#

well no i plan on making it negative so maybe an if joker is present in hand then give this

#

actually that sounds possible but i have no idea the code for it, ima go figure it out guess i helped myself

static valley
static valley
#

as for why, I think what happened is how my should_apply function works:

    should_apply = function(self, card, center, area, bypass_roll)
        -- only applies if the card has values that can be made worse
        return G.GAME.modifiers.enable_comedy_preowned and (card.ability ~= nil) and card.ability.extra
    end,
long sun
#

oooo nice ^U^

#

i managed to get it to work by patching set_eternal

drowsy heath
#

is there a way to check if joker slots are full ?

upbeat bronze
#

so i basically want this Joker to have a 25% chance of giving a meteor tag when blind is skipped, and a 75% chance of a Meteor Tag instead. As is, its only giving Orbital. Does anyone know how i'd fix that within the confines of JokerForge?

long sun
#

ability.eternal is true. why might i still able to sell the card?

bold gyro
#

why can't i properly set the rate of my custom sticker? i have rate = 0.3 but the sticker gets applied to all compatible jokers. also, i took ownership of the perishable and eternal stickers to change their should_apply function, and for some reason the same rate issue occurs???

#

is it a problem with bypass_reroll?

drowsy heath
#

how do i get a consumable to do something depending on different variables in the game

#

like if a joker limit has been reached then do this instead ?

#

because at the moment its doing both

frosty rampart
drowsy heath
frosty rampart
#

what's your goal

drowsy heath
#

like what do i want it to do ?

frosty rampart
#

yes

drowsy heath
#

i want it to give me a random joker from a pool i st which is what this does until i reach the limit i want it to give me one spilled coffee joker then when it detects that i want it to instead give me overflow but right now its giving me spilled coffee + the first set and never giving me the overflow

frosty rampart
#

what you have right now is: always create a coffee1 joker. then, if your jokers are over the limit, create a spilled_coffee joker. then, if your jokers are over the limit and you have the card mm_joker36 (which will never be true, assuming that's supposed to be a joker key), create an overflow joker

if all that logic makes sense otherwise, you probably just need to change the joker key to j_mm_joker36

drowsy heath
#

ah thanks, what do i do to stop getting a coffee1 joker

#

as an if #G.jokers.cards < G.jokers.config.card_limit then before thr first part crashes the game

frosty rampart
#
if #G.jokers.cards <= G.jokers.config.card_limit then
  -- add a coffee1 joker
else
  -- add a spilled coffee joker and maybe an overflow joker
end

if that still crashes, show the crash log
also use SMODS.add_card, it does the whole card = create_card(); card:add_to_deck(); G.jokers:emplace(card) thing for you

drowsy heath
#

okay i will try this

#

that worked for stopping the creation of coffee 1 after the limit has been reached but i still am not getting overflow after i have a spilled coffee in hand

lofty elm
#

Hey gang, I've been trying off and on to fix this bug since this morning, my game doesn't actually save the drawn card. Anyone know why this might be happening? It's stuctured just about identical to certificate from vanilla remade

G.E_MANAGER:add_event(Event({
    func = function()
        local magnet_card = pseudorandom_element(most_changed,  pseudoseed('magnet'))
        draw_card(G.deck, G.hand, 100, nil, nil, magnet_card) 
        G.hand:sort()
        save_run()
        return true
    end
}))
frosty rampart
drowsy heath
#

joker 36 is spilled coffee it has its own pool so it worked, i dont exactly know why but once i defined the joker having its own pool the code worked fine

#

so would i be able to replace j_mm_joker36 with spilled_coffee so it checks the pool instead ?

nova orchid
#

how do i fix this?

SMODS.Back {
    name = "Family Deck",
    key = "familydeck",
    atlas = "oliverteaganmod",
    pos = { x=4,y=0 },
    config = {},
    loc_txt = {
        name = "Family Deck",
        text = {
            "Start with the",
            "Oliver Teagan Mod",
            "Jokers"
        }
    },
    apply = function ()
        G.E_MANAGER:add_event(Event({
            func = function ()
                SMODS.add_card("j_otm_teagan")
                SMODS.add_card("j_otm_oliver")
                SMODS.add_card("j_otm_andre")
                SMODS.add_card("j_otm_august")
            end
        }))
    end
}
#

it's crashing when i start a run with the deck

lofty elm
#

whats the error message?

nova orchid
frosty rampart
drowsy heath
#

so what would i need to do

nova orchid
#

what do i need to do

drowsy heath
#

ive taken a break from coding for the last like month so im a bit clueless on half thre things i used to know

#

im warming back up but im not there yet

lofty elm
nova orchid
#

do i need to have the "j_otm_"

lofty elm
#

ye

#

think so

nova orchid
#

do i need to have the "j_otm_"

#

ok

#

now it works but now it's looping forever??

lofty elm
#

oh uh, prolly need a return

#

after adding the jokers

nova orchid
#

got it

lofty elm
ivory citrus
#

Hello, anyone know how the paperback mod can retrigger jokers with the normal joker?

drowsy heath
#

wait what do you want your joker to do ?

#

wait not joker what are you trying to do

ivory citrus
#

wait a minute

winter flower
nova orchid
winter flower
#

ah

ivory citrus
#

this joker retrigger all common joker, but because i'm a begginer i dont know how to do it

#

And i want do it with a pool, no with a rarity

lofty elm
#

anyone know of any mods that do stuff in first_hand_drawn context?

winter flower
drowsy heath
#

to include vanilla jokers aswell as custom ones it would be easier to do so with rarity wouldnt it

winter flower
#

(if you're using a different file make sure to assert it)

drowsy heath
#

just turn on all optional features tbf easier to do it now than forget later that its optional, thats what i did

winter flower
drowsy heath
#

yeah thats what i was thinking it is easier to just do it as the rarity

ivory citrus
inner cosmos
#

How do you make an animated joker? I've been racking my brain for hours now

red flower
#

if you're patient there's an SMODS PR that would allow jokers to use animated sprites

inner cosmos
#

You need to know what youre doing to do this

#

I eas really hoping I was just naimg things wrong :(

daring fern
#

ashen drift
#

how does quantum ranks work again

frosty rampart
#

it doesn't yet
(unless you specifically downloaded the PR, in which case you should read through the PR for the details)

ashen drift
#

dang

inner cosmos
#

So happyyyy

iron haven
#

how much do tarots cost?

#

or spectrals

#

nvm

winter flower
#

<@&1133519078540185692>

jolly shadow
#

how do i hide mod badge

daring fern
lofty elm
mild bronze
#

Why is there just crypto

red flower
#

mods are asleep

winter flower
#

unfortunately.

mild bronze
#

Ah

lofty elm
# red flower what's the goal

to draw the magnet_card to hand at the start of the round. rn it draws but if you leave and rejoin its not there anymore

mild bronze
#

Okay

#

7 mods not a single on is alive rn

red flower
lofty elm
#

ikr

red flower
#

can i see the full thing

lofty elm
#

i also tried putting it in its own event

#

ye

#
calculate = function(self, card, context)
    if context.first_hand_drawn then
        --Find a list of most changed cards
        local most_changed = {}
        local max_change_count = -1
        local change_count = 0
        for i, playing_card in pairs(G.deck.cards) do
            change_count = 0
            if next(SMODS.get_enhancements(playing_card)) then change_count = change_count + 1 end
            if playing_card.edition then change_count = change_count + 1 end
            if playing_card.seal then change_count = change_count + 1 end

            if change_count > max_change_count then
                max_change_count = change_count
                most_changed = {playing_card}
            elseif change_count == max_change_count then
                table.insert(most_changed, playing_card)
            end
        end

        --Draw card to hand
        G.E_MANAGER:add_event(Event({
            func = function()
                local magnet_card = pseudorandom_element(most_changed,  pseudoseed('magnet'))
                draw_card(G.deck, G.hand, 100, nil, nil, magnet_card) 
                G.hand:sort()
                save_run()
                return true
            end
        }))
    end
end,```
#

theres prolly some goofy stuff in there but it does draw the card just doesn't save

#

Already stumped a couple other people unfortunately

red flower
#

😭 the cards that are not in hand are in G.deck.cards

lofty elm
#

ope

red flower
#

i don't think thats the issue but it's very convoluted code

lofty elm
#

yeah ik sorry

#

im a beginer and its hard to find all the documentation of everything

red flower
#

how did you do the event thing for save_run

jolly shadow
#

how do i add_card a specific joker

lofty elm
red flower
lofty elm
# red flower how did you do the event thing for save_run
calculate = function(self, card, context)
    if context.first_hand_drawn then
        --Find a list of most changed cards
        local most_changed = {}
        local max_change_count = -1
        local change_count = 0
        for i, playing_card in pairs(G.deck.cards) do
            change_count = 0
            if next(SMODS.get_enhancements(playing_card)) then change_count = change_count + 1 end
            if playing_card.edition then change_count = change_count + 1 end
            if playing_card.seal then change_count = change_count + 1 end

            if change_count > max_change_count then
                max_change_count = change_count
                most_changed = {playing_card}
            elseif change_count == max_change_count then
                table.insert(most_changed, playing_card)
            end
        end

        --Draw card to hand
        G.E_MANAGER:add_event(Event({
            func = function()
                local magnet_card = pseudorandom_element(most_changed,  pseudoseed('magnet'))
                draw_card(G.deck, G.hand, 100, nil, nil, magnet_card) 
                G.hand:sort()
                return true
            end
        }))
        G.E_MANAGER:add_event(Event({
            func = function()
                save_run()
                return true
            end
        }))
    end
end,
#

ill double check it doenst work

red flower
#

ok instead of that put the event in the place save_run was originally

lofty elm
#

oh like nest them?

red flower
#

yes

lofty elm
#

ill try that

red flower
#

you want that event to be after the event draw_card does

lofty elm
#

goot it that seems promising

#

tho i still dont know how vanilla remades would work

red flower
#

because vanillaremade doesn't use draw_card there

#

draw_card specifically uses an event

lofty elm
#

omigosh ty it worked

#

huh, I did try using emplace and it didnt work either

#

idk lol it works now tysm

pastel kernel
#

purpose: retriggers face cards in played hand by how many cards are played.

if context.repetition and context.cardarea == G.play and context.other_card:is_face() then
            return {
                repetitions = #context.scoring_hand
            }```
#

this is how i do it?

daring fern
fluid lagoon
#

for making custom cards for playing cards, do I need to make a full suit or can I just edit the face cards? My other question of how do I properly palettes cause I am so confused and getting it telling me to do it right or use the old formatting

pastel kernel
#

gains xmult if a face card is retriggered but what context

lofty elm
daring fern
lofty elm
#

oh i didnt read retriggered

#

hey uh is there a pseudorandom that gives a random number in a range

pastel kernel
daring fern
lofty elm
#

oh got it

#

ty

fluid lagoon
#

do any peeps know rather or not that I would need to do a full suit for custom cards or can I just edit the face cards?

pastel kernel
#

i'll just use an if a face card is scored context instead

#

or if it's a king

daring fern
fluid lagoon
#

like how the friend of jimbo stuff works

daring fern
safe dawn
#

how would i make it so if you discard cards it has a chance to give that card an effect

lament agate
#

is there a way to detect if a gold card existed in player's hand

#

this one just crashes

true jasper
stoic void
#

This isnt actually making a joker

daring fern
stoic void
faint yacht
stoic void
#

re-booting balatro

faint yacht
#

return is not closed properly in calculate

stoic void
#

and do I need , after every "end"

faint yacht
#
if context.joker_main then return { xmult = ... } end
faint yacht
#

Can be, yes.

stoic void
#

ah ok

#

I dont think you can do that in python, and thats what im learning in school

daring fern
# stoic void yeah

If the file has syntax errors and the game is opening without crashing that means the file isn't loading.

stoic void
#

how do I see syntax errors?

daring fern
faint yacht
#

...assuming VSCode is used.

stoic void
#

:|

stoic void
#

because apparently github isnt ggod enough

#

Im guessing this one?

#

Colours

cursive gazelle
stoic void
#

lsp?

cursive gazelle
#

Check vanilla remade wiki

#

N has a tutorial

cursive gazelle
faint yacht
#
local result = {}
for k, v in pairs(houseofcommons) do
    print(inspectDepth(result))
    result = SMODS.merge_effects(result, { x_mult = card.ability.extra.x_mult })
end
return result

...am I not using SMODS.merge_effects right?

daring fern
daring fern
faint yacht
#

SMODS.merge_effects({{result}, { x_mult = card.ability.extra.x_mult, card = G.consumeables.cards[v] }})?

daring fern
stoic void
#

Ima try -1 booster slot

true jasper
stoic void
stoic void
#

SMODS is underlined in yellow

#

im guessing that isnt good

true jasper
stoic void
#

ah ok

#

this isnt the good bit

true jasper
stoic void
#

how do I do that just so i know if I have

true jasper
stoic void
#

I dont think I have

true jasper
stoic void
#

under the main.lua ? ok

stoic void
#

idk why I dont have audio on this

cursive gazelle
#

Cooked obs

stoic void
#

i dont have obs

#

I used ctrl f11 because of steam

cursive gazelle
#

If you’re using it check if you have audio output

#

Idk i never recorded w steam

stoic void
#

Ive done clips with sound on other games tho, idk

sterile lotus
#

'Ello!
I'm new to Balatro modding. I'm doin' a small mod for me and my friends, and I'm wondering if there's like a wiki or something to check functions I can use to do some events in the game (Like turning a joker into its negative version, or stuff like that)

stoic void
true jasper
faint yacht
#

-# How do I add a cardarea to UI?

lavish elm
#

how a custom game over dialogue that activates when a certain joker is in your hand

red flower
real crown
#

I'm working on a Joker that "eats" a card if it's the first hand of the round and there's only one card, then gives all eaten card back when destroyed or sold. Logically I don't see why this wouldn't work, but in practice it seems broken, and a weird draggable card stays on the screen instead of disappearing when playing a 1 card hand

red flower
#

you can't save cards to a card's ability table anyway

#

it will not reload properly

#

i would recommend storing these cards in a hidden cardarea

real crown
#

Is there some sort of a modded or non-modded Joker that does something similar, so I can have a reference? Never worked with hidden cardareas

slim ferry
#

entropy butterfly deck stores cards in a hidden cardarea, you could try looking at that

real crown
#

Thank you!

violet void
# real crown Is there some sort of a modded or non-modded Joker that does something similar, ...

If you want you can put the cardarea above the Joker's card area so when you "eat" the card you move it towards the Joker who ate it and then it goes offscreen

this is my lovely patch for the cardarea if you want to take a look

# Add off-screen Stack area
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''G.SPLASH_BACK = Sprite(-30, -6, G.ROOM.T.w+60, G.ROOM.T.h+12, G.ASSET_ATLAS["ui_1"], {x = 2, y = 0})'''
position = "before"
payload = '''

self.cs_stack_W = 4.9*G.CARD_W
self.cs_stack_H = 0.95*G.CARD_H

self.cs_stack = CardArea(
    G.jokers.T.x,
    G.jokers.T.y - (G.jokers.T.h*2), 
    self.cs_stack_W, 
    self.cs_stack_H, 
    {card_limit = 5, type = 'cs_stack', highlight_limit = 0}
)
'''
match_indent = true```
real crown
lavish elm
#

how to make localization file to make my quip?

#

I made my localization file a lua file and put this inside of it

return {
    misc = {
        quips = {
            xmpl_evil_quip = {
                          "example quip"
            }
        }    
    }
}
#

is there any other steps I should be aware of?

faint yacht
#

That should be it...

lavish elm
#

ok then why isn't it appearing?

faint yacht
#

Is your modprefix matching? Is the localization file named right?

lavish elm
#

wait there is a name for the localization file?!

#

I just named it quips.lua

faint yacht
violet void
# real crown Thank you so much, that's really helpful! And it would be great visually to have...

Oh and also

local original_draw_card = draw_card
function draw_card(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
  if card and card.cs_stolen then
    return original_draw_card(from, G.cs_stack, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
  end

  return original_draw_card(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
end

This is the hook that precedes draw_card. If you don't know what a hook is, it lets you run something either before or after the original function call

If the card is eaten (for me, I am using stolen because I'm stealing it but it's the same behaviour) then instead of going to the right it's placed into the hidden cardarea

You can set a similar flag in your Joker's calculations for your card (is_eaten) and check for that instead

faint yacht
#
quip_filter = function(quip, type)
  if (quip.key == 'toga_srb2kartwin' or quip.key == 'toga_srb2kartlose') then return true else return false end
end

I myself am crashing because of this on the SMODS.Back object.
-# Ping me if responding to this, I'll catch it later-

lavish elm
#

it worked thx

quartz pendant
#

Aside from the smod and vanilaremade wiki, where else can I find information on the smod API? Some things, like the G object, don't seem to be well-documented

#

or should I just look at other mods for comparison

slim ferry
#

i mean almost everything is stored in G

#

i dont think theres documentation on everything in it

#

a lot of it isnt really useful anyway

viral ember
#

Print(G)
egg

#

I wonder what that would look like lmao

slim ferry
#

it would look like table: <some memory address>

#

it doesnt actually print the contents

viral ember
#

Oh

#

Damn

#

Let me imagine 😭

slim ferry
#

you can do eval G with debugplus though

#

that shows everything

viral ember
#

Sick