#💻・modding-dev

1 messages · Page 442 of 1

gilded blaze
#

iirc win_ante is not a valid challenge modifier in vanilla

viral ember
#

this helped me a bit

hasty mist
#

i know how to lovely patch

sturdy compass
#

I think she meant like

hasty mist
#

i just dont know what to patch

sturdy compass
#

the actual functionality

viral ember
#

ohh

manic rune
#

probably in here

viral ember
#

mybad

idle plaza
#

Just to be sure, since you said earlier it doesn't work - What is the intention of the effect? Does it do anything right now?

manic rune
#

its in cardarea.lua btw

hasty mist
#

thank you!

lucid owl
#

does anybody here understand regex who can tell me why this is getting no matches?

sturdy compass
# viral ember oh interesting

You can certainly make your own challenge modifiers, but you'd need to patch the game to actually get them to apply

hasty mist
#

i might be able to just hook this right

#

since its a function

manic rune
#

aaaand maybe here too

#

idk

hasty mist
#

😭

#

thanks localthunk

lucid owl
crisp coral
vague crest
#

it currently does not do anything

lucid owl
vague crest
#

added a message thing where the condition is and it doesnt send out anything so thats where the issue is for sure i think

sturdy compass
gilded blaze
vague crest
#

oh AHHHHH

#

it was this 😭 i tricked myself LMAO

#

i flipped the cards and got my 20 mult

#

thank you everybody

gilded blaze
#

huh

formal quest
#

Why is my mod not being detected?

sturdy compass
#

awesome lol

hidden sable
#

whast the funciton to give the player cash

sturdy compass
#

ease_dollars(num)

pallid sleet
#

yeah so uh, my lua file made the game crash???? I couldnt see anything wrong with the code though so any ideas? My first modding session btw.... so im like really new to this. Any ideas?

gilded blaze
#

ease_dollars

manic rune
#

@hasty mist actually, on second thoughts,

#

probably just hook/patch into Card:flip() itself

hasty mist
#

whoops

#

alright wheres card:flip()

manic rune
#

uh

#

search it in your vsc

#

searching function Card:flip should work

#

im eating rn

pallid sleet
#

really? i was watching that "How to make modded joker- Balatro" video and not having atlus didnt crash their game.

idle plaza
hasty mist
unkempt thicket
#

What card area is this?

pallid sleet
#

oh shit

hasty mist
#

doesnt look like i can do anything there

pallid sleet
#

okay thx

hidden sable
#

how can i combine these 2 destroys, and also make it so the random card isnt one of the chosen ones

gilded blaze
manic rune
#

and hook to Card:flip() so that it doesnt run if the card has that flag

hasty mist
#

how would i set a flag

#

(ive actually wondered this for a while)

gilded blaze
#

self.some_key_flag = true

hasty mist
#

awesome seems simple enough

manic rune
#

its just smt like card.ability.perma_flipped = true, smt to tell the code

gilded blaze
#

yea

#

I'd add a safety measures for perma-flipped cards tho
something like Card:flip(bypass_perma_flipped)

#

for debugging purposes Ig

hidden sable
#

any way to check if a single entry is inside a table

gilded blaze
hidden sable
gilded blaze
#
local card_to_destroy = pseudorandom_element(G.hand.cards, 'random_destroy')
local hand_highlight = G.hand.highlighted

for _, card in ipairs(G.hand.highlighted) do
    if card == card_to_destroy then
faint urchin
#

Is there a way to make a challenge that bans every joker except for one including modded jokers without manually listing all of them out? Iterating over G.P_CENTER_POOLS.Joker does not work

vague crest
#

everything works good now, except it doesnt work with mime, what would i need to change the context to to fix this and not have it give the mult once for each card?

gilded blaze
#

oh wait

#

it's not inside

#

BRUH

hidden sable
digital niche
#

is there a way to make something like "if joker checks for this"?

gilded blaze
hasty mist
#

why does this crash me? this is exactly how ive always done hooks

gilded blaze
hasty mist
#

what is wrong with that

#

oh huh

#

it should be a period?

gilded blaze
#

using Card:flip means you're practically calling a function
while Card.flip can be used both in a function call and in assigning

hasty mist
#

this doesnt seem right

#

it still crashes too

gilded blaze
#

also Card:flip() doesn't return

#

you're not hooking it right

hasty mist
#

😭

#

i swear hooks work completely differently every time i code one

gilded blaze
#

return [blank] to do nothing
that's correct
but return Card:flip() is wrong

manic rune
#

calling Card:flip() instead of ast_flip in there will cause a loop lol

gilded blaze
#

so you want to flip a card

hasty mist
#

maybe i need to relearn how hooks work

gilded blaze
#

and within some condition, assign ability.perma_flipped to it

hasty mist
#

ive done plenty idk why im having so much trouble with this one

manic rune
#
local ast_flip = Card.flip
function Card:flip()
  if not self.ability.perma_flipped then
    ast_flip(self)
  end
end
#

probably smt like that? 🤔

#

aewait

#

there

gilded blaze
#

well

manic rune
#

is the self in ast_flip necessary, actually

gilded blaze
#

the name perma_flipped suggested that a card facing down can never be flipped

gilded blaze
manic rune
#

i see

hidden sable
#

this looks cursed...

hasty mist
#

well, the intended effect is that if it was flipped, specifically using the consumable i made, it can not be flipped faceup by discarding or returning to the deck

#

meaning every time you draw it itll stay flipped

gilded blaze
#

alright

hasty mist
#

alrighty

#

hm

#

they still seem to be getting unflipped

gilded blaze
#

when moving from a card area to another?

hasty mist
#

when they get drawn again

#

for example, flipping an ace of spades, then going to the next blind, when i draw the ace again its no longer flipped

manic rune
#

did you set card.ability.perma_flipped = true in your consumable's code

hasty mist
#

yeah, in the for loop

#

this is correct, yes?

manic rune
#

:3

#

no

#

it should be v.ability.perma_flipped = true in this case

hasty mist
#

ohh

#

okay awesome it seems to work

#

thank you so much

gilded blaze
#

v is the card in highlighted area
card is the consumable card

#

lmao
imagine assigning perma_flipped to a used consumable

hasty mist
#

right yes

vague crest
#

trying to get this to not give chips if played hand is the same as the last hand, but it just unconditionally gives chips, can anyone see what i did wrong here teehee

manic rune
#

i

#

that looks like it does the complete opposite of what you want 😭

#

but also, whats znm_sackboy_hand?

vague crest
#

ohhhh my goodness that variable is still there from iteration 1 of this

#

thats whats going on

manic rune
#

mhm

#

and also, change ~= to ==

#

else you are making it so it gives chips when played poker hand is not the same as the last poker hand

#

and you can remove the else block

vague crest
manic rune
#

oh

#

soadm

#

a

#

i misunderstood your effect, sorry 😭

hidden sable
#

curious, is the card looking around effect done with shaders?

manic rune
#

yeah, its fine then, just change znm_sackboy_hand, remove the else block (not that it affects anything, its just unnecessary)

vague crest
#

YAYY it works 🔥

#

my beautiful boy

scarlet imp
#
if context.discard and not context.blueprint then
  if card.ability.extra.Xmult - card.ability.extra.Xmult_loss <= 1 then
      G.E_MANAGER:add_event(Event({
          func = function()
              play_sound("tarot1")
              card.T.r = -0.2
              card:juice_up(0.3, 0.4)
              card.states.drag.is = true
              card.children.center.pinch.x = true
              G.E_MANAGER:add_event(Event({
                  trigger = "after",
                  delay = 0.3,
                  blockable = false,
                  func = function()
                      card:remove()
                      return true
                  end
              }))
              return true
          end
      }))
      if SMODS.find_card("j_tboi_binge_eater") then
          for i = 1, #G.jokers.cards do
              if G.jokers.cards[i].config.center_key == "j_tboi_binge_eater" then
                  if G.jokers.cards[i].ability.extra.Xmult == nil then
                      G.jokers.cards[i].ability.extra.Xmult = 2
                  else
                      G.jokers.cards[i].ability.extra.Xmult = G.jokers.cards[i].ability.extra.Xmult + 2
                  end
              end
          end
      end
      return {
          message = localize("k_eaten_ex"),
          colour = G.C.FILTER
      }
  else
      card.ability.extra.Xmult = card.ability.extra.Xmult - card.ability.extra.Xmult_loss
      return {
          message = localize ({
              type = "variable",
              key = "a_xmult_minus",
              vars = { card.ability.extra.Xmult_loss }
          }),
          colour = G.C.RED
      }
  end
end
if context.joker_main then
  return {
      xmult = card.ability.extra.Xmult
  }
end

I copied this code from the Vanilla Remade page except for the "binge eater" stuff obviously, and it has a bug where the food can get "eaten" multiple times. Anyone have an idea on how to prvent this?

#

this is for "Ramen" btw, I'm taking ownership of it to add some functionality

gilded blaze
#

SMODS.find_card returns a table of the card you're looking for

#

in case it doesn't find any, it returns an empty table

#

if SMODS.find_card(...) then is not a valid check since it always gets executed
use if next(SMODS.find_card(...)) then instead

scarlet imp
gilded blaze
#

oof

scarlet imp
#

yeahh its rough

#

I tried changing it to == instead of <=, but now it has the opposite problem of where I can overshoot and get Ramen to something like X0.99 mult

gilded blaze
#

what are you trying to achieve here

#

a joker similar to Ramen

#

what would be the full effect

scarlet imp
#

I added some functionality to all the food items, and as I was debugging I found this bug for Ramen

gilded blaze
#

wait, this is Ramen code copied from Vanilla Remade

scarlet imp
#

exactly

gilded blaze
#

Vanilla Remade could be wrong somewhere

scarlet imp
#

I think its bugged and idk how to fix it 😭

#

i'm gonna look at the source code for Ramen

gilded blaze
#

what would be Binge Eater's effect

scarlet imp
#

Binge Eater absorbs the abilities of Food Items that get eaten while you're holding Binge Eater

#

like I said, that part works fine

gilded blaze
#

in case of the code above, I assume it can only absorb Ramen for now

#

that's the intention right?

scarlet imp
#

I added a similar chunk of code to all the food items. At first I wanted to make a function inside of Binge Eater that gets called, and I can pass into it the arguments I want, but it never really worked out so this is the solution I have

#

I got it to work with all the vanilla items except for Ramen, which I'm trying to fix

gilded blaze
#

huh, you're taking Ramen ownership?

scarlet imp
#

yeah

gilded blaze
#

I wouldn't recommend tho

scarlet imp
#

why is that

gilded blaze
#

what's wrong with the Ramen check inside Binge Eater

#

X1.01 Mult, discard 5 cards, eaten 5 times?

scarlet imp
#

whether or not I have Binge Eater, I get this problem. The Binge Eater effect is entirely separate functionality from the item being eaten

gilded blaze
#

no I mean

#

you said earlier that you made a Ramen check inside Binge Eater but it didn't work

scarlet imp
#

Previously, instead of having a huge block of code where I manually edit Binge Eater's config, I had a function inside of the Binge Eater joker that would make it edit itself, as long as it was passed arguments. I couldn't get the function to work because the game always thought it was nil, so I opted for having a bunch of code that edits Binge Eater from elsewhere. It's not pretty, but for now its getting the job done

gilded blaze
#

so every food joker works inside Binge Eater's block of code but Ramen

scarlet imp
#

yeah, all of them work because the other food Jokers don't get eaten in the same circumstances as Ramen. Usually its at round end, or in the case of Ice Cream and Seltzer, after you play a hand. All of these actions only trigger once, so the Joker gets eaten once. Ramen gets eaten on discard, but you can discard up to five cards. The if statement

if context.discard and not context.blueprint then
  if card.ability.extra.Xmult - card.ability.extra.Xmult_loss <= 1 then

somehow allows the action to be triggered multiple times even after the carrd is destroyed

gilded blaze
#

alr let me check

scarlet imp
#

I found a solution

#

putting card:remove() right before the return statement guarantees that Ramen gets destroyed

#

unfortunately, it comes at the cost of butchering the animation

#

it just vanishes without any animation at all

gilded blaze
#

it's because Card:remove() is called properly in vanilla, but delayed inside event queue

#

rip, vanilla issue

scarlet imp
#

yeah, is there a fix anyone can think of for this? I'd rather not have to sacrifice the animation when the whole synergy is to intentionally eat the item lol

gilded blaze
#

so when it gets eaten 5 times, Binge Eater gains 5 times X2 Mult?

#

💀

scarlet imp
#

well it gets X2 mult ADDED five times, so a total of X10, not X2^5 lol

#

but yes

gilded blaze
#

that's still 5 times X2, not X2^5

#

X2^5 is X2 with 5 triggers

vague crest
#

how would i set up a joker that discards cards remotely? like in the speciifc context im doing, i want discarding one card to discard your whole hand

#

i can see the hook does things that are kinda close to what im doing but it seems very specific to the hook

scarlet imp
gilded blaze
#

hook discards when you play a hand

#

discarding one card discards your whole hand is a different context

scarlet imp
#

is there a list of valid arguments for trigger in an Event?

vague crest
#

it seems like i need to get a for loop going and ihave that set up but the actual discarding of the cards remotely i cant find anything for since using what the hook has just crashes

gilded blaze
gilded blaze
#

if discard has only 1 card, highlight all unhighlighted cards before discarding

vague crest
#

what does this bit do? it says it's crashing

gilded blaze
#

it should be a comma, not a dot there
my bad

vague crest
#

ohh

scarlet imp
vague crest
#

it says it's attempting to get the length of highlighted which is a boolean

gilded blaze
#

wait

scarlet imp
#

also, I copied/pasted the code from VanillaRemade directly with no edits, same problem

gilded blaze
#

it's a vanilla issue 💀

scarlet imp
#

frl? this happens in Vanilla, even with no Mods?

gilded blaze
#

Vanilla Remade is only a reference

#

for developing mods

scarlet imp
#

yes I know

gilded blaze
#

they should have no difference from true vanilla

#

in fact

#

the Ramen you're using is vanilla, not Vanilla Remade

scarlet imp
#

yeah

#

so this bug probably exists in base game too then

gilded blaze
#

yep

scarlet imp
#

great lol. That means its not my problem 💀

gilded blaze
#

like I said, Vanilla Remade is a code reference that you can easily copy-paste into your mod
it's not a mod

vague crest
gilded blaze
#

oof

#

take a look at Trading Card’s code in Vanilla Remade

vague crest
#

it does this

gilded blaze
#

I kind of wrote the code without doing so

vague crest
#

thats what i was looking at originally i can change the criteria to that

gilded blaze
#

oof

#

it uses context.discard

vague crest
#

yeah the crash is still the not v.highlighted bit

gilded blaze
#

it's #G.hand.highlighted == 1

#

alr let me have lunch first

near bay
#

How do i do Xchip?

scarlet imp
scarlet imp
#

It worked for me without any extra work, I'm not sure if Vanilla has functionality for it that's unused or if SMODS adds it, but regardless that's all you need

near bay
scarlet imp
#

I figured. It would be pretty odd for Xchips to exist in Vanilla and be unused

#

I figured out how to prevent the Ramen issue. I added a boolean flag to its config and set it to false when it's eaten. The conditional statement is modified to check for this flag, which prevents it from running any code after it is supposed to be destroyed

stray hearth
#

Hello I'm very new on balatro modding and I would like to know is there any docummentation on G module or the only option is to check Balatro source code? I would like to simulate a controller button trigger but I don't now If I would be able to do so with G.CONTROLLER

gilded blaze
#

like, no problem whatsoever

vague crest
#

huh weird

gilded blaze
#

check your code again

vague crest
#

this is what im working with currently, changed a few things around to no avail

gilded blaze
#

uh, why are you returning true

vague crest
#

uhhh great question it is what the hook did iirc 👍 will try without

gilded blaze
#

when you pasted my code in, did you remove your previous attempt

vague crest
#

yeah

gilded blaze
#

now try that again, if it crashes, send me the crash screen

vague crest
gilded blaze
#

huh

#

CardArea.highlighted is a table wtf

tranquil gull
#

thats probably a Card not a CardArea then

royal ridge
#

shouldn't that be v.area:add_to_highlighted(v)

#

or like G.hand:add_to_highlighted(v)

#

idk

vague crest
#

oh something

#

something happens

royal ridge
#

i don't think it's gonna work because of highlight limit

vague crest
#

ah

#

yeah its grabbing 4 cards and not discarding them

#

unfortunate

gilded blaze
#

damn it

#

finally

royal ridge
#
G.E_MANAGER:add_event(Event({ func = function()
  local any_selected = false
  for _, v in ipairs(G.hand.cards) do
    if not v.highlighted then
      G.hand.cards.highlighted[#G.hand.cards.highlighted+1] = v
      v:highlight(true)
      any_selected = true
    end
  end
  if any_selected then
    play_sound('cardSlide1')
    play_sound('card1', 1)
    G.FUNCS.discard_cards_from_highlighted(nil, true)
  end
return true end }))
delay(0.7)
return true
#

who knows

#

maybe that works

hasty mist
#

how do i check if a playing card is flipped?

royal ridge
hasty mist
#

tyy

vague crest
#

since the previous thing did do something at some point

gilded blaze
#
if context.pre_discard and not context.blueprint and not context.hook then
    if #G.hand.highlighted == 1 then
        local buffer = G.hand.config.highlighted_limit
        G.hand.config.highlighted_limit = #G.hand.cards
        for _, v in ipairs(G.hand.cards) do
            if not v.highlighted then
                G.hand.add_to_highlighted(G.hand, v)
            end
        end
        G.hand.config.highlighted_limit = buffer
    end
end

here, try this

vague crest
#

🫡

royal ridge
faint urchin
vague crest
#

oh thats weird

#

it selects them all (making a very loud noise) but doesnt discard them or let you do anything to discard them yourself until you deselect enough to have 5

gilded blaze
#

ouch

royal ridge
#

i mean that one doesn't discard them right?

#

it's just highlighting

#

oh wait is this a joker

vague crest
#

true true im looking at what hook does here tryingto debug it out

#

yep

royal ridge
#

thought it was a blind

vague crest
#

ohhh yeah no trying to set up a joker that lets you discard your whole hand by discarding once

#

YIPPEE

royal ridge
#

gg?

vague crest
#

it works BEAUTIFULLY

#

thank you so much everyone 🙏 i have learned from this experience and out of it i am a new man

#

just needed to add this bit in the middle

gilded blaze
#

so it worked?

vague crest
#

yep!

#

doesnt crash with no cards either

gilded blaze
#

oh right

#

you wanna test some stuff with Burnt Joker behavior

#

because you're wasting your first discard to discard everything in hand

vague crest
#

oh it works fine with that yeah

#

also doesnt have to be the first discard either

hasty mist
#

what would i check for if i want to loop through each played card?

royal ridge
#

G.play.cards

hasty mist
#

awesome

royal ridge
#

if you're doing it through a joker you can also use context.full_hand

hasty mist
#

im doing it through a function

loud gorge
#

how do i make a blueprint joker

hasty mist
#

actually theres a better way to do this i think

#

hm

#

im trying to make every facedown card count as every suit and be unable to be debuffed

#

but idk how to do that passively

royal ridge
# loud gorge how do i make a blueprint joker
calculate = function(self, card, context)
  local other_joker = nil
  for i = 1, #G.jokers.cards do
    if G.jokers.cards[i] == card then
      other_joker = G.jokers.cards[i + 1]
    end
  end
  return SMODS.blueprint_effect(card, other_joker, context)
end,
loud gorge
#

thank

royal ridge
#

blueprint recreation

hasty mist
loud gorge
royal ridge
#

i think you'd have to do some hooks and stuff

loud gorge
#

i dont know anything about codin-

loud gorge
vague crest
#

thats odd isnt happening on my end

#

ill try with two

#

still works

gilded blaze
#

what

#

oh

#

I see

#

@vague crest btw add true to add_to_highlighted
it will remove the sound

royal ridge
#

probably doesn't work

#

you'd want something recursive

royal ridge
#

yeah never checked if ret existed

#

try that

gilded blaze
#

did you check if other_joker exists

#

since if it doesn't, SMODS.blueprint_effect does nothing

#

wait, that's the intention

#

lmao

royal ridge
#

yeah

#

ret will just be nil

pastel kernel
#

is there a tool that helps with creating code for jokers?

#

for example, one that can find terrible code grammar

lament agate
#

pardon, is there any mod that utilizes Xmoney and Xprobabilities?

hasty mist
gaunt thistle
lament agate
#

but i never figured out what mod is it

royal ridge
#

doesn't dice use xprob

pastel kernel
royal ridge
#

+prob is the rare one

gaunt thistle
pastel kernel
lament agate
#

i see

#

so like

pastel kernel
#

the thing i was looking for

lament agate
#

OA6 has it?

royal ridge
#

yes

lament agate
#

ill look it up

#

i think they have it in vanillaremade

near bay
#

whats the variable name for a jokers sell value

royal ridge
# near bay whats the variable name for a jokers sell value

card.sell_cost is the amount you get when you sell the card (this is reset when calling card:set_cost()), you shouldn't modify this, but you should read from it
card.cost is the amount the joker costs in the shop (divided by 2 for sell cost)
card.ability.extra_value is usually 0, but is what egg + gift card uses to modify the sell cost, this is added onto sell cost

royal ridge
#

yes

#

egg does

card.ability.extra_value = card.ability.extra_value + card.ability.extra -- (card.ability.extra == 3)
card:set_cost()
near bay
#

why is it orange

hexed heath
#

check your ctrl+f

near bay
#

oh my god bruh

#

oops

royal ridge
#

ignore placeholder joker

lament agate
#

what is the thing that doesnt get documented by the wiki

#

uhhhh

#

the font thing

#

and uhh

#

G.P_center iirc

royal ridge
# royal ridge somehow got that half blueprint working
    calculate = function(self, card, context)
        local other_joker = nil
        for i = 1, #G.jokers.cards do
            if G.jokers.cards[i] == card then
                other_joker = G.jokers.cards[i + 1]
            end
        end
        local function rec_change(table, factor)
            for k, v in pairs(table) do
                if type(v) == 'number' then
                    table[k] = v*factor
                elseif type(v) == 'table' then
                    rec_change(v, factor)
                end
            end
        end
        if other_joker then
            rec_change(other_joker.ability, 0.5)
            local ret = SMODS.blueprint_effect(card, other_joker, context)
            rec_change(other_joker.ability, 2)
            return ret
        end
        return
    end,

very bad since there's like way too many edgecases but it works generally

tawdry oriole
#

how do you create a custom pool for booster packs?

hard mica
#

im having a slight problem with the localizations entries , i want it to be more organized but not sure how i can set my set to that organized set aka DementiaJonkler set in my Other set

near bay
#

how do i change the pitch of a sound?

stoic fulcrum
#

is there a reason why start_dissolve gets called a nil value here? the code is almost 1:1 with madness from vanilla remade except with jokers replaced with consumeables (and the random seed is removed)

#

(i'm trying to make a joker that destroys all your consumeables on selecting blind in exchange for $)

hard mica
#

how can i add 2 hands?

subtle merlin
# hard mica how can i add 2 hands?

G.GAME.current_round.hands_remaining or G.GAME.current_round.hands_left (I forget which of the two it is) is the current amount of hands, do with that what you will

hard mica
lament agate
#

can i use SMODS.Gradient for my mod badges?

subtle merlin
hard mica
spring lantern
#

sorry quick question how can i access the playing cards currently selected by a player

spring lantern
#

ah thanks lul

#

had a brainfart and forgot

subtle merlin
subtle merlin
stoic fulcrum
viral ember
#

is it possible to modify base game textures?

near bay
#

how do i change the pitch of a sound?

subtle merlin
subtle merlin
subtle merlin
formal parrot
#

Sorry i slept

stoic fulcrum
subtle merlin
#

Lots of for loops

#

-# (or you could be basic and just use one)

viral ember
formal parrot
#

@lament agate its okay bro you tried
I love you bro
You’re not that guy bro
I’m not that guy 😭

stiff quiver
#

how can I modify what a base game joker does?

viral ember
#

lovely patch probably

pastel kernel
#

help?

stiff quiver
viral ember
formal parrot
viral ember
#

godspeed

formal parrot
#

I recommend not patching if you’re new

#

Its kinda fucked up and i dont understand it lol

drifting vapor
lyric maple
#

how do you just create a card in the first place
i have no idea where to find it in the documentation 😭

gaunt thistle
#

patching is both pretty intuitive once you get the hang of it but you need a bit of finesse to do it right

#

so yeah, don't use patches yet

snow vale
#

can someone show me an example of a tag's code?

lyric maple
# viral ember wdym

i want to make a negative death card whenever a joker is triggered. all the example mods and stuff just give examples of random cards and not actually like a specific card

#

sorry for not stating that earlier, it's like 10:45 pm and i'm kinda tired

viral ember
#

how would this work

formal parrot
#

For the person asking how to create a card

lyric maple
# viral ember how would this work

it would be a 1 in 3 chance of creating a negative death card if played hand is a flush five

i can't even get the death to generate in the first place so i can't even try and implement all the other stuff

lyric maple
pastel kernel
lyric maple
#

is it just whatever the joker/consumable/etc type is

lyric maple
viral ember
#

is this your first mod

drifting vapor
lyric maple
#

i was planning on making simpler jokers first but i already started working on this one and i'd rather finish it

viral ember
#

I HIGHLY reccomend making a different test project to get a grasp on how the stuff works

pastel kernel
formal parrot
#

If you want consumeables

pastel kernel
#

i honestly don't know

formal parrot
#

How to add a tag?

#

Or how to create your own

#

@snow vale

#
                func = (function()
                    add_tag(Tag('tag_double'))
                    play_sound('generic1', 0.9 + math.random() * 0.1, 0.8)
                    play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
                    return true
                end)
            }))```
#

How you add

lament agate
#

how do you make joker say something when they're in my slot and entering a shop

formal parrot
#

How you make

lament agate
#

or play a sound if it's possible

snow vale
formal parrot
#

He has something similar with entropy maybe he can help you

formal parrot
#

Read

#

:>

snow vale
#

ive already read

lament agate
formal parrot
#

My guy

snow vale
#

i just wanted an example 😭

viral ember
#

what you want is for someone else to do it for you.

#

not how we do things here.

snow vale
#

calm down

viral ember
#

i'm chill lol

snow vale
#

what then? will you explain to me how?

viral ember
#

how to do what

#

you haven't said what you wanted

snow vale
#

how to tags work

#

i did say it

viral ember
#

Are you wanting to add a tag?

snow vale
#

yeah

viral ember
#

have you made anything yet

#

/srs

snow vale
#

what i know how to do

viral ember
snow vale
#

yeah, but i dont understand how aply should be done

viral ember
#

you want to add
apply = function(self, tag, context)
-- code here
end

snow vale
#

oh

#

simply?

viral ember
#

this is what does stuff

snow vale
#

ok then

#

thanks

manic rune
#

:yep is such a good function name though

viral ember
#

what?

manic rune
#

you cant tell me thats not a good name

viral ember
#

oh lol

#

peak name

stoic fulcrum
#

ok i figured a much simpler solution, doing this destroys every tarot card
however, the game softlocks if i don't add return true. and if i do add return true, it only destroys a single card

manic rune
#

you put return true outside the for loop

viral ember
#

yea

manic rune
#

also, the reason why it softlocks when you dont return true is because func doesnt stop until you return something in there

stoic fulcrum
#

oh that worked, god bless PatPray

#

now i need to implement gaining cash for each tarot destroyed

snow vale
#

cool idea

#

perkeo + that joker = free money

stoic fulcrum
#

tbh you make more from selling the created negative

snow vale
#

hmm yeah

manic rune
#

you would make more from duplicating hermit/temperance and use them, honestly

idle plaza
#

It would actually be pretty bad with Perkeo since you'd need to be constantly be buying new consumables to duplicate. It destroyes all of them, after all.

stoic fulcrum
#

yeah it's a common so it's not supposed to be too strong
$3 per consumeable destroyed, you can get a full refund on anything unused
or free $3-5(depending on vouchers) if you use emperor/priestess

#

prob a lot more if you play with another mod that can balloon your consumeable size

real rivet
#

do i extract this in the mods folder?

#

the guide on nexusmods is confusing me

viral ember
#

that should all be in 1 folder called smods inside of mods

real rivet
#

okay!

viral ember
#

second guessing myself wait

real rivet
viral ember
#

nevermind i'm right

pastel kernel
#

does anyone else know how to fix my issue? (negative spectral cards not being negative)

viral ember
real rivet
#

renamed the "new folder" to Mods

#

okay

viral ember
#

should work hopefully

real rivet
#

same thing for talisman i guess?

#

okay seems the modding for this game is basic and simple

#

the guide for smods made it seem more complicated

#

does downloading mods that change gameplay use another savefile?

cerulean bane
#

the only mods i know of that use separate save folders are cryptid and some of its addons

gilded bramble
#

when i was modding balatro ppl just told me get mod manager and get balatro

#

i did both

#

bam

#

i could download anything

stoic fulcrum
#

is it possible to replace tarot/planet with something more general (ie, consumeable) or do i have to do it like this?
i tried consumeable/consumable as the set ability but they don't seem to work

manic rune
#

what are you doing here

#

you dont need two hooks 😭

stoic fulcrum
#

yea that's what i'm trying to figure out lmao
how i can make it just one hook

manic rune
#

just multiple if statements are good enough

primal robin
#

Damn, implement good game restart is kinda problematic trash

manic rune
#
local remove_ref = Card.remove
function Card:remove()
  if self.added_to_deck and not G.CONTROLLER.locks.selling_card then
    if self.ability.set == "Tarot" then
      SMODS.calculate_context{card = self, sriot = {destroying_tarot = true}}
    elseif self.ability.set == "Planet" then
      SMODS.calculate_context{card = self, sriot = {destroying_planet = true}}
    end
  end
  return remove_ref(self)
end
#

something like that, probably

stoic fulcrum
#

i do wanna figure out if i can make something that specifically targets the consumable area
cause then i fear i won't have retroactive compatibility with mods that add their own stuff

primal robin
#
function Card:remove(...)
  return remove_ref(self, ...)
end

Better do this for all functions even if the're not taking any arguments

stoic fulcrum
#

like cryptid and all the random bullshit they add lmao

manic rune
primal robin
#

Because right now it's not taking any arguments, but what happened after Balatro 1.1.0 cames out? No one knows. Better be ready

manic rune
#

this actually checks for all the destroyed cards, and return context.sriot.destroying_[...] accordingly depending on which set it came from 🤔

#

hm

#

hooow do you check if a card is a consumable again

#

oh yeah, self.ability.consumeable

native zinc
#

nooo oooo

manic rune
#

rip

native zinc
stoic fulcrum
modern kindle
#

Good schmorning chat

wintry solar
#

That’ll track used cards too right?

native zinc
#

fucked up error with hard to find issue

wintry solar
#

Should they count as destroyed?

stoic fulcrum
#

this is the way i had it work when i had two hooks

manic rune
#

dunno, thats how smtcom suggested adding a "check if destroy" context 🤔

#

-# this is to eremel's question btw

manic rune
#

if you use a planet card then it will return context.sriot.destroying_planet, if you use a tarot card then it will return context.sriot.destroying_tarot

#

but if you want to group them all together then

#
local remove_ref = Card.remove
function Card:remove()
  if self.added_to_deck and not G.CONTROLLER.locks.selling_card and self.ability.consumeable then
     SMODS.calculate_context{card = self, sriot = {destroying_consumable = true}}
  end
  return remove_ref(self)
end
worthy stirrup
#

How could I change how much debt the player can go in?

wintry solar
#

I'm going to add an actual destroyed context at some point

#

but I'm pretty sure that this one will trigger on used cards

#

which I'm also pretty sure is an unintended effect

stoic fulcrum
worthy stirrup
modern kindle
#

oh you nvm'd

#

damn

native zinc
#

uhhh just for loop through the G.jokers

modern kindle
#

doesnt smods.find_card exist

red flower
#

next(SMODS.find_card("j_modprefix_key")) yeah

worthy stirrup
#

what does next() do?

modern kindle
#

👋 N

red flower
worthy stirrup
#

ohh

#

thank you

native zinc
#

i want to make a copy of a playing card and replace first card in standard pack

#

actually maybe it's copy_card

#

fuc k.

long sun
#

hiya! how do you overwrite some of the Joker sprites?

#

i've already made an atlas ^^

native zinc
long sun
#

ah gotcha :D i'll do the first thing

red flower
native zinc
#

you'd be more ✨ crossmod compatable ✨

native zinc
#

it should copy one of
the pool cards and properly replace it but it's crashing

#

¯_(ツ)_/¯

red flower
#

the pool might be empty

native zinc
#

the pool was not empty when i got the first crash

worthy stirrup
#

Just to be safe, does a card being created by a Judgement call for this context?

if context.buying_self then
native zinc
#

i don't believe so

worthy stirrup
#

fuck

red flower
native zinc
#

oh Bollocks

worthy stirrup
#

how do i make sure this triggers when its bought or made by judgement?

red flower
#

add_to_deck?

native zinc
#

add_to_deck?

#

...

worthy stirrup
#

oh right...

#

i forgot..

#

so ive been bruteforcing it this whole time

#

just to be sure, this is only called when itself is added to the deck

red flower
#

yes

worthy stirrup
#

thank you

#

i need to now go fix my code

red flower
#

also when undebuffed

native zinc
#

you can change that anyway

worthy stirrup
#

as long as i also check if from_debuff is false it will only apply when bought/sold right

worthy stirrup
#

thank you

#

How do i check to see if a card has a seal?

near bay
#

how do i check how many hands i have

timid star
#

what value can i check that's unique to only playing cards so i can distinguish playing cards from jokers, consumables, etc.

timid star
worthy stirrup
#

damn, it really do be obvious

errant fulcrum
#

Could someone tell me why this is giving me an error about indexing 'center' [a nil alue]?

    SMODS.add_card({set = 'Joker', area = G.jokers, key = 'raven'})
        G.GAME.joker_buffer = 0
        card.ability.extra.ready = false
        return {
        true
    }```
gilded blaze
#

it should be j_yourmodprefix_jokerkey

errant fulcrum
#

Oh

manic rune
#

area and set aren't actually necessary here, you can remove them if you want

near bay
#

how do i check the hand count

gilded blaze
#

G.GAME.current_round.hands_left iirc

worthy stirrup
#
    calculate = function(self, card, context)
        if context.before then
            for _,v in ipairs(context.scoring_hand) do
                if not v.seal then
                    v:set_seal("s_OAL_CakeSeal", true, true)
                end
            end
        end
    end,
formal parrot
#

Hey day devs

worthy stirrup
#

ill send the crash log in just a sec

#

It crashes when a card is played

formal parrot
#

Try

#

1 second

worthy stirrup
#

i have been /j

#

lol

formal parrot
#

There’s

#

SMODS.has_enhancement

#

But no SMODS.has_seal

#

Lmfao

#

Wait let me check something

worthy stirrup
#

bruh

#

i think the act of giving a card a seal might be the crash

formal parrot
#

Probably not

#

I think

#

Its Big S

#

For seals

#

Not sure

faint yacht
#

modprefix_key for seals.

formal parrot
#

Oh so no S

worthy stirrup
#

oh

formal parrot
#

strange

worthy stirrup
#

i would have never guessed that

formal parrot
#

Same

#

I fucking love how inconsistent it is lmao

#

Did it work ?

worthy stirrup
#

yea

#

sorry, i meant to type that

formal parrot
#

Lol , its okay :>

#

What does cake seal even do

near bay
#

how do i check round score and required score

modern kindle
#

current score is G.GAME.chips and requirement is G.GAME.blind.chips

worthy stirrup
formal parrot
worthy stirrup
#

look at my name and i think youll know who

worthy stirrup
#
    calculate = function(self, card, context)
        if context.before then
            for _,v in ipairs(context.scoring_hand) do
                if not v.seal then
                    v:set_seal("OAL_CakeSeal", true, true)
                end
            end
        end
        if context.cardarea == G.play and context.individual then
            if card.seal == "OAL_CakeSeal" then
                return {
                    chips = 50
                }
        end
    end
end,
#

the cake aint caking and giving the 50 chips

formal parrot
#

Silly

worthy stirrup
#

gordon ramsey will be pissed if this aint workin

formal parrot
#

Card refers to the joker

#

You make a for in scoring hand

worthy stirrup
formal parrot
#

If v.seal==

worthy stirrup
#

but this is outside the loop, no?

formal parrot
#

You want to check for seal

#

Every card

#

If card has seal give 50 chips right?

worthy stirrup
#

yea

formal parrot
#

Wait i’ll edit it for you

worthy stirrup
#

but doesnt v only exist in the for loop

formal parrot
#

Make another for loop

#

1 second

#
    calculate = function(self, card, context)
        if context.before then
            for _,v in ipairs(context.scoring_hand) do
                if not v.seal then
                    v:set_seal("OAL_CakeSeal", true, true)
                end
            end
        end
        if context.cardarea == G.play  then

for _,v in ipairs(context.scoring_hand) do
                if  v.seal ==“your seal”then
                    Return{chips=50}
                end
            end

 
    end
end,
worthy stirrup
#

ill try this

formal parrot
#

I typed with phone so check for commas

worthy stirrup
#

i will

formal parrot
#

Hello will i’m heaven

worthy stirrup
#

it worked! thank you

formal parrot
#

Card reference the joker

#

Not playing cards :D

#

You were testing if the joker has a seal or not

worthy stirrup
#

oops lol

formal parrot
#

Silly :3

modern kindle
#

so silly

worthy stirrup
#

How do i make it so a joker cant appear in the shop but only spawn in from a soul?

royal ridge
#

i believe just make it legendary?

manic rune
#

card.seal is an entire table

#

no actually

#

nevermind

#

im wrong

#

im dumb

worthy stirrup
#

i got it working so dont worry!

modern kindle
#

what if i want to worry

lament agate
#

@formal parrot WHERE THE FUCK DO I PUT

#

IT

#

@daring fern we were talking about Xmoney without using Talisman

formal parrot
worthy stirrup
#

This isnt doing anything, how could i get it to work? it changes the rank just fine

    calculate = function(self, card, context)
        if context.after and #context.scoring_hand >= 5 then
            for _,v in ipairs(context.scoring_hand) do
                G.E_MANAGER:add_event(Event({
                func = function()
                SMODS.modify_rank(v, _)
                message = "Bump!"
                Message_card = card
                return true
                end}))
            end
        end
    end,
}
modern kindle
#

hi smtcom the goat 👋

manic rune
formal parrot
daring fern
lament agate
#

okay

#

no

#

im SO confused

formal parrot
#

Return {dollars=G.GAME.dollars}

lament agate
lament agate
formal parrot
#

But its -1

lament agate
#

im

#

SO LOST

#

0i983uhdqkl=-0o980uodjqnka

formal parrot
#

Return {dollars=G.GAME.dollars*x}

lament agate
#

okay

daring fern
formal parrot
#

If you want double

#

X should be 1

#

If you want 3 x should be 2

manic rune
lament agate
formal parrot
#

Just multiply by (x-1) and add if card.ability.x~=1

daring fern
lament agate
#
return
 {dollars = G.GAME.dollars * 3}
#

?

worthy stirrup
daring fern
formal parrot
#
return
 {dollars = G.GAME.dollars * card.ability.extra.x-1}
formal parrot
lament agate
daring fern
worthy stirrup
formal parrot
daring fern
formal parrot
#

@lament agate my method works , just tested it 🤓

worthy stirrup
#

I really want to do that card flipping animation but idk how

formal parrot
#

Ease_dollars don’t let you make it compatible with other jokers

worthy stirrup
#

do i do it twice for the little animation

#

like what strength does

daring fern
# lament agate patch in?
local oldaddroundevalrow = add_round_eval_row
function add_round_eval_row(config)
    config = config or {}
    if config.dollars and next(SMODS.find_card("j_modprefix_key") then config.dollars = config.dollars * 3 end
    return oldaddroundevalrow(config)
end
lament agate
#

which method should i follow

#

im working on another joker rn

stiff quiver
#

how would i do a custom pack that can only pull cards of a certain rarity?

#

nvm i just figured it out

formal parrot
native zinc
lament agate
#

so

#

let me get this straight

#

im gay tho

#

but

worthy stirrup
#

what

formal parrot
#

Niko hear me out

#

Config ={extra={x=1}},

#

If (card.ability.extra.x~=1 )then

#
return
 {dollars = G.GAME.dollars * card.ability.extra.x-1}
#

And you add your context for changing the X or whatever you can make it a fixed value if you want

lament agate
#
config = { extra = {x = 1} }
calculate = function(self, card, context)
if (card.ability.extra.x~=1) then
  return
    {dollars = G.GAME.dollars * card.ability.extra.x-1}
lament agate
#

fuck

#

right

formal parrot
#

And also

#

Add context to change the value

stiff quiver
#

is there a way to make a joker not compatible with rental?

native zinc
#

it's in Joker

formal parrot
#

CHAT WHAT THE FUCK IT WORKS JUST FINE FOR ME

lament agate
#

😭

native zinc
#

nxhoo is this end of round money

lament agate
#

yes

#

cash out money

native zinc
#

then heaven is gaslighting you

formal parrot
#

WHY DIDNT YOU SAY SO

lament agate
#

???????????????

formal parrot
#

DUMBASS

native zinc
#

he did say so

formal parrot
native zinc
#

are you trying to double the cash out money

native zinc
#

or all money

lament agate
native zinc
#

then heaven is gaslighting you squared

formal parrot
#

Oh

#

Then follow the dudes

lament agate
#

heaven.,,,

formal parrot
#

I didnt read properly

#

My abd

#

Bad

worthy stirrup
#

How could i get it to display the messages while the cards are on screen, they are doing the bumping after they leave the screen

    calculate = function(self, card, context)
        if context.final_scoring_step and #context.scoring_hand >= 5 then
            for _,v in ipairs(context.scoring_hand) do
                G.E_MANAGER:add_event(Event({
                    func = function()
                        v:flip()
                        SMODS.modify_rank(v, _)
                        v:flip()
                        SMODS.calculate_effect({message = "Bumped!"}, v)
                        return true
                end
            }))
            end
        end
    end,
lament agate
#

i thought we have something special between us,,,

formal parrot
#

I thought you wanna double inside the round 😭

#

Sorry😭

pastel kernel
#

heaven, do you know how to make it so that every spectral card created is a negative?

lament agate
#

where do i put this

daring fern
native zinc
#

add_round_eval_row(config) and config.dollars

#

or something com is ahead of me

worthy stirrup
daring fern
lament agate
#

okay

#

let me

#

try this

#

brb

stiff quiver
# native zinc read the docs

i dont think it is, the docs say perishable eternal and <sticker>_compat for modded stickers, but if i put rental_compat = false it still appears as rental

gilded blaze
native zinc
#

oh right because rentrals are on everything

gilded blaze
#

actually no I should just take a look at SMODS.calculate_effect

#

lmao

#

I'm so used to using card_eval_status_text

stiff quiver
formal parrot
#

Rental_compat=false

#

I think

stiff quiver
#

already tried that

formal parrot
#

I THINK

daring fern
worthy stirrup
#

hmm, how would one add some delay of the cards flipping?

    calculate = function(self, card, context)
        if context.final_scoring_step and #context.scoring_hand >= 5 then
            for _,v in ipairs(context.scoring_hand) do
                G.E_MANAGER:add_event(Event({
                    func = function()
                        v:flip()
                        SMODS.modify_rank(v, _)
                        v:flip()
                        SMODS.calculate_effect({message = "Bumped!", instant = true }, v )
                        return true
                end
            }))
            end
        end
    end,
daring fern
native zinc
#

you can change the delay further with delay = but do the event thing first

worthy stirrup
formal parrot
#

There’s eternal_compat why’s there no rental_compat

worthy stirrup
formal parrot
#

Yes

worthy stirrup
#

oh

formal parrot
#

Delay =0.2

daring fern
lament agate
#

how do you guys endure coding, what the fuck 😭 im fucking bawling

native zinc
#

not mid event

formal parrot
edgy reef
#

I know for a fact it does not have should_apply to preserve vanilla RNG

native zinc
#

specifically in this case the delay doesn't do what she wants it to do

formal parrot
#

I LOVE DISAGREEING WHEN IM WRONG

worthy stirrup
gilded blaze
#

ok I took a look at SMODS.calculate_effect

formal parrot
modern kindle
#

i think spreading misinformation is peam

worthy stirrup
#

kitty need a fucking break

edgy reef
#

And vanilla does not have rental_compat by default, so prob means you can't.

lament agate
#

is {X:gold} a thing?

formal parrot
modern kindle
#

no i said peam

lament agate
#

its peam

formal parrot
#

PEAK

native zinc
lament agate
#

peam

formal parrot
modern kindle
#

no its peam

lament agate
native zinc
#

{X:anything} is a thing

formal parrot
#

{X:money} exists

modern kindle
pastel kernel
daring fern
formal parrot
#

Do you want to

#

Make sure its not nsfw

#

(Has no shaders )

worthy stirrup
#

does the card:flip() have any inputs

native zinc
#

uea

midnight coyote
#

i need to ease 2 values at the exact same time

formal parrot
worthy stirrup
#

hopefully a delay one

midnight coyote
#

how would i go about this

midnight coyote
pastel kernel
worthy stirrup
#

too many big words

#

im dumb

midnight coyote
#

you arent dumb

#

do not tell yourself that

#

be nice to yorself

worthy stirrup
#

im kitty

midnight coyote
native zinc
#

actually no card:flip() doesn't have any args

worthy stirrup
native zinc
#

or at least i don't think it does

midnight coyote
#

i can build this event rq hold on

native zinc
#

i was confused with juice_up()

daring fern
# pastel kernel
local oldcreatecard = create_card
function create_card(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
    local g = oldcreatecard(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
    if _type == "Spectral" then
        g:set_edition("e_negative")
    end
    return g
end
formal parrot
#

Add delay=0.5 between each card

formal parrot
#

Should fix

#

No ?

gilded blaze
#

huh

#

what

#

why a hook to create_card

worthy stirrup
midnight coyote
#
G.E_MANAGER:add_event(Event({
  trigger = after,
  delay = placeholder, -- CHANGE TO YOUR VALUE
  func = function()
    card:flip()
    return true
  end
}))
#

this probably works

formal parrot
#

@worthy stirrup You’re stacking events put the for inside the event

native zinc
#

you could probably just make held in hand spectrals negative

midnight coyote
#

i need to ease 2 values at once >:b

formal parrot
#

Skull emoji

gilded blaze
midnight coyote
#

how do i ease 2 values at once

native zinc
#

ease one and then the other :Easy:

#

but i don't think you can do that

midnight coyote
native zinc
#

what are you trying to do

midnight coyote
#

in this situation

#

they HAVE to be at once

midnight coyote
#

move it diagonally for instance

#

in which 2 values would have to change smoothly

#

maybe i make a for loop that i delay inside?

#

hmm

#

to move it diagonally i need to move both x and y at the same time

native zinc
#

you don't gotta do it in the same frame

#

what lib are you using

midnight coyote
#

oh thats fair actually

#

lib?

#

im just using smods

native zinc
#

oh

midnight coyote
#

and love

#

if i just move them individually really fast then i could probably get away with it

native zinc
#

i prolly should've expected lovely has window movement ability

native zinc
#

no really this is what every program does ever

midnight coyote
#

my idea is that im making a bunch of 'animations'

#

that the boss blind is gonna use

#

for the window movement

tawdry oriole
#

how do you check how many jokers are owned?

native zinc
#

#G.jokers

midnight coyote
pastel kernel
#

ok here's the problem

native zinc
#

wait

midnight coyote
#

okay let me figure this out then

pastel kernel
#

they look like negative spectral cards

native zinc
#

oh i'm stupi d.

pastel kernel
#

but they take up space

gilded blaze
#

huh

daring fern
native zinc
#

something something add to deck

pastel kernel
stiff quiver
#

is this what im supposed to do? im kinda new to lua so i dont fully understand everything lua return {set = "Joker", area = G.pack_cards, skip_materialize = true, rarity = "dev",debug.sethook(SMODS.Stickers["rental"].should_apply,"r") }

pastel kernel
#

no.

gilded blaze
#

what is that syntax

#

💀

manic rune
#

where did that debug.sethook come from

#

🤔

gilded blaze
#

the lua at the beginning too

#

💀

manic rune
#

thats probably at the ```lua part

stiff quiver
#

idk what im doing lol

native zinc
#

that's the code block

manic rune
#

but they left lua inside the block instead

gilded blaze
#

bad newline placement lmao

daring fern
pastel kernel
#

damn, i don't know what to do

manic rune
#

what are you doing

#

im still at class but if its simple enough then i can help, maybe