#💻・modding-dev

1 messages · Page 197 of 1

minor furnace
#

Genshin Impact mentioned?

red flower
#

does something happen when you play a hand?

novel violet
#

anemo, geo, and dendro characters will have synergy with all (or in dendro's case, all but cryo) suits

novel violet
minor furnace
#

I'm driving myself insane trying to figure out how to implement a specific boss blind effect

whole hornet
#

i see now

red flower
#

you have to change joker_main for selling_self

silk wren
#

i hate to bug again but could someone please help me parse this crash report

whole hornet
#

is there a funtion to see if the card is sold

whole hornet
#

perfect

normal crest
minor furnace
novel violet
#

for the record i'm planning to add a skin that at least recolors the main deck to have sensible colors xD

normal crest
#

I was thinking that too

whole hornet
#

it works!

normal crest
whole hornet
#

but, it still gives me a buck

novel violet
whole hornet
#

let me see if i cant set the sell value to 0 by defalt

minor furnace
novel violet
#

yeah absolutely

normal crest
#

fair enough

minor furnace
red flower
#

idk how easy that is

minor furnace
#

I'll keep that in mind as an option

whole hornet
#
rarity = 4,
      atlas = 'century_egg',
      pos = {x = 0, y = 0},
      sell_value = 0,
      config = {
        {extra = 100}
      },
      loc_vars = function(self,info_queue,center)
        return {vars = center.ability.extra}
      end,
      calculate = function(self,card,context)
        if context.selling_self then
          ease_dollars(math.max(0,math.min(G.GAME.dollars, 100)), true)
          return {
            card = card,
            color = G.C.MONEY
          }
        end
      end
     }
``` this shouldn't work erase is not even typed properly
#

lol

minor furnace
whole hornet
#

how would i get around that?

red flower
#

no idea if this will work but what if you do card.sell_cost = 0 after ease_dollars

#

if not then you might need to hook card:set_cost

whole hornet
#

it crashes is i correct my spelling mistake

#

wack

#

ill try what you suggested

#

it works

#

i also got rid of erase_money entirely

#

and just did this card.sell_cost = math.max(0,math.min(G.GAME.dollars, 100))

#

for some reason i thought that it was card.sell_value

#

so it did not work when i tried it

#

lol

#

now i got to make the sell value show the amount before you click it

#

thank you for your help!

red flower
#

if you change the sell_cost in add_to_deck instead of calculate it should do it but it's gonna get overwritten by card:set_cost so a hook might be the only solution

molten ice
whole hornet
#

im dyslexic so when i compared the source code i thought it originaly said erase

#

lmao

molten ice
#

lol
to be fair the source code does have some misspelled stuff too like consumeables so it's a fair assumption

minor furnace
raw geyser
#

Is there a way to add a mult bonus for the next hand? From a consumable?

tall wharf
#

extremely unexpected

whole hornet
#

?

runic pecan
whole hornet
#

i tried ```local old_set_cost = Card.set_cost
function Card:set_cost(...)
old_set_cost(self, ...) -- Call the original set_cost method
if self.ability and self.ability.name == 'Century Egg' then
self.sell_cost = math.max(0, math.min(G.GAME.dollars * 2, 100))
end
end

#

did not work

red flower
raw geyser
whole hornet
#
local old_set_cost = Card.set_cost
function Card:set_cost(...)
  old_set_cost(self, ...) -- Call the original set_cost method
  if self.ability and self.ability.name == 'Century Egg' then
    print("Updating sell_cost for Century Egg:", G.GAME.dollars)
    self.sell_cost = math.max(0, math.min(G.GAME.dollars * 2, 100))
  end
end
wintry swallow
#

is there no documentation on deck making with smods

molten ice
red flower
tall wharf
runic pecan
tall wharf
whole hornet
#

chill out my guy, i typed it wrong

tall wharf
#

anyway ^mult in steamodded when

red flower
whole hornet
#

so its printing the value

plush cove
#

Updating sell_cost for Century Egg: 4

red flower
whole hornet
#

wouldn't that just print the name?

red flower
#

I think it doesn't for modded jokers

#

you usually compare the key

whole hornet
#

huh

red flower
#

yeah

whole hornet
#

ah

#

should i just change the name of the check?

#

no wait

minor furnace
#

this actually sucks to implement

red flower
#

lol

#

it seems like an interesting effect I'll check out if I can do it tomorrow when I'm on my PC

minor furnace
#

I pray my best bet is to figure out how to swap the cards in the cardarea, and I'm just too tired right now to figure out how to do it properly

red flower
whole hornet
#

i did

#

it works but only for the first time

#

ill try to change some things

minor furnace
#

given enough time I'm sure I can figure out, but sometimes it feels good to complain about things

reef gale
#

i feel dumb

#

what am i missing

normal crest
#

you got a syntax error

reef gale
normal crest
#

you need a comma after 'j_red_card'

#

'j_red_card',

whole hornet
#

ok i gave up and used AI

#

i feel dirty

reef gale
#

LAME

whole hornet
#
function Card:set_cost(...)
  old_set_cost(self, ...) -- Call the original set_cost method
  if self.ability and self.ability.name == 'j_nscabm_century_egg' then
    -- Update sell_cost dynamically
    self.sell_cost = math.max(0, math.min(G.GAME.dollars, 100))
  end
end

-- Hook into G.modify_money to update sell_cost when money changes
local old_modify_money = G.modify_money
function G.modify_money(amount)
  old_modify_money(amount) -- Call the original modify_money method
  -- Update sell_cost for all Century Egg cards
  for _, card in ipairs(G.playing_cards) do
    if card.ability and card.ability.name == 'j_nscabm_century_egg' then
      card:set_cost() -- Force update the sell_cost
    end
  end
end

#

this works now at least, Nomad_00 — Today at 11:33 PM
looks like trash though

reef gale
#

welp lol

normal crest
#

G.modify_money does not exist

whole hornet
#

i know right?

normal crest
normal crest
#

at most it will help you with lua stuff

reef gale
#

going to change the text later

normal crest
#

You have a couple syntax errors near original_sheet = true

#

You have an extra } and ,

#

And orignal_sheet is outside the table

#

If you remove the }, above original_sheet = true line you should be fine

minor furnace
red flower
#

this probably breaks something and it doesn't make your played hand act as your remaining hand but it's half of what you want if I understood correctly

[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "-- TARGET: adding to hand effects"
position = 'before'
match_indent = true
payload = '''
final_scoring_hand = G.hand.cards
'''
#

obviously that needs a check for your blind

minor furnace
#

thank you though! I really appreciate it

red flower
#

now i need to sleep zzzzz

red flower
whole hornet
#

arrrg

#

im just going to leave it as is

wintry swallow
#

how do you make a deck

#

is it just with the Back thing?

jovial harness
#

Yeah, Back is a deck from what I understand (not messed about with it)

sturdy compass
#

That is correct

random sleet
sturdy compass
#

I think the reason they're called "Backs" is cuz they're the back of the cards

whole hornet
#

ok i fixed i got rid of all the unnecessary code

#
     function Card:update(...)
       old_card_update(self, ...)
       if self.ability and self.ability.name == 'j_nscabm_century_egg' then
         self.sell_cost = math.max(0, math.min(G.GAME.dollars, 100))
       end
     end```
#

voilà

random sleet
#

does ... actually work in lua

whole hornet
#

man AI actuly does suck

random sleet
#

yes

minor furnace
#

clearly this isn't the way to debuff a blind that increases the base chip score, because it just crashes. The Wall has lied to me...

        self.chips = self.chips/3
        self.chip_text = number_format(self.chips)
        return```
whole hornet
#

i saw what it was trying to do then did it myself

minor furnace
#

I think perhaps 1am is too late for me to be coding

whole hornet
#

samsies

whole hornet
#

i got an exam tmrw anyway

#

lmao

random sleet
#

i am always going to blame talisman for math not working

minor furnace
#

talisman?

random sleet
#

i dont care if you dont have it lol

#

still talisman's fault

minor furnace
#

this is just telling me that the field 'chips' is nil, so clearly I'm supposed to be accessing a different field but I'm too tired to sort it out rn so that's tomorrow me's problem

minor furnace
white spade
#

What are some mods to play with friends (multiplayer wise)

random sleet
#

idk if it works with the multiplayer stuff but play my mod

whole hornet
#

what is it

minor furnace
#

shameless self-promotion for the win 🙏

random sleet
#

theres like 50 jokers and almost 100 consumables

whole hornet
#

what hands are added?

#

ight

#

i gtg

#

thanks for the help again

random sleet
modern kindle
#

What kinda hands are those

random sleet
#

hands

modern kindle
#

Shit fair enough

broken cliff
#

Little dog is 1 Bone card

#

Big dog is 5 Bone cards

random sleet
#

oh yea and nice and twice nice

modern kindle
#

All i know is if I'm at a poker table and someone pulls out a tiger yea ill fuckin fold

random sleet
broken cliff
#

Little cat is 1 ** ** ** ** ** ** ** ** ** ** ** ** ** ** card

reef gale
#

feel like im doing something wrong

broken cliff
#

Big cat is 5 ** ** ** ** ** ** ** ** ** ** ** ** ** ** cards

#

Skeet is scram

#

Castle is 1 king 1 queen 3 jacks

#

Blaze is 5 ** ** ** ** ** ** ** ** ** ** ** ** ** ** cards

novel violet
#

i've been having a lot of trouble with getting the game to find consumables of a specific type in my hand - i looked through here and apparently SMODS.find_card() is supposed to return a table, but attempting to get the length of the local var i assigned to it crashed balatro
i've tried several different implementations to no avail - this is just about the simplest i've gotten to it, all i really need is a way to reference specific consumables and have them send a message within the scope of a joker's calculate function

        -- primary scoring mechanics
        if context.cardarea == G.play and context.repetition and
            not context.repetition_only and context.scoring_name ~= 'High Card' then
            if context.other_card == context.scoring_hand[1] then
                local SkillCards = next(SMODS.find_card('c_Impact_KQSkill'))
                if #SkillCards > 0 then
                    for i = 1, #SkillCards, 1 do
                        card.ability.extra.repetitions = card.ability.extra
                                                             .repetitions + 1
                        SMODS.calculate_effect(card, {
                            message = "Again!",
                            colour = G.C.PURPLE,
                            card = SkillCards[i]
                        })
                    end
                end
                return {
                    message = "Don't Blink!",
                    colour = G.C.PURPLE,
                    repetitions = card.ability.extra.repetitions,
                    card = card
                }
            end
...
sturdy compass
novel violet
#

oooohhh shit right

#

ok let me cook

reef gale
sturdy compass
#

I'm not familiar with localization stuff, wish I could help

minor furnace
novel violet
#

well, it no longer crashes, but it:

  1. doubles the amount of repetitions expected; only 2 of these cards are in the deck, but it adds 4 retriggers
  2. completely skips the calculate_effect message
sturdy compass
#

Can you show what you have now?

novel violet
#

the first thing is weird but easy, just assign local var that's #SkillCards / 2

novel violet
reef gale
jovial harness
plush cove
sturdy compass
novel violet
#

tbf relative to the message being completely skipped that's a fairly minor issue

jovial harness
#

and on the subject of making mistakes I've been trying ot figure out how to change the back sprite of a specific joker when flipped (for a single easter egg!!!!) and everything I've tried hasn't worked. Currently been trying a lovely patch but honestly I feel like I'm way in over my head.

version = "1.0.0"
priority = 0

[[patches]]
[patches.regex]
target = "card.lua"
pattern = 'self\.children\.back = Sprite.*'
position = 'before'
payload = '''
if _center.name == 'Okina Matara' then
    self.children.back = Sprite(self.T.x, self.T.y, self.T.w, self.T.h, G.ASSET_ATLAS["FinalBosses"], { x = 7, y = 2 })
    self.children.back.states.hover = self.states.hover
    self.children.back.states.click = self.states.click
    self.children.back.states.drag = self.states.drag
    self.children.back.states.collide.can = false
    self.children.back:set_role({major = self, role_type = 'Glued', draw_major = self})
    return
end
'''
match_indent = true```
sturdy compass
#

Ah I see

novel violet
#

i've got no idea what's up with the Again! message just not doing anything at all

random sleet
novel violet
#

i'd expect it to crash at least

minor furnace
reef gale
sturdy compass
jovial harness
#

A final bosses mod, but yeah, I want to give Okina Matara a back door!

novel violet
#

that's fucking sick

jovial harness
#

It does have 1 implemented and 1 planned joker right now

novel violet
#

too bad it's final bosses only, i'd love to see reisen reisen_flan

sturdy compass
novel violet
#

interesting 👁️

#

i'll give that a shot!

sturdy compass
#

fingers crossed

jovial harness
novel violet
#

well it did sort of do something, though it's incredibly strange

sturdy compass
#

oh?

novel violet
#

also the repetitions ... somehow got Worse

#

😭

sturdy compass
novel violet
#

you know what i think it's because i'm adding to the card ability

jovial harness
#

Are you forgetting to reset the card ability and it just keeps adding up?

novel violet
#

yeah you're right that completely flew over my head. i thought the config var was temp for some reason OMEGALUL

sturdy compass
#

lmfaooooo

novel violet
#

i'll patch that and record what's going on

sturdy compass
#

Yeah no that persists unless you explicitly reset it

runic pecan
#

What is the new calc's lowest version number?
I need that for listing dependency.

#

ALPLA-14??b or something

raw geyser
# runic pecan

Just so you're tracking:
It looks like tags only triggers at the blind selection, so it can't be added mid round and have effects.
I'm currently looking into creating a temporary voucher that will vaporize after giving the bonuses, because vouchers are processed at the same time as jokers

runic pecan
raw geyser
raw geyser
# runic pecan Show me your code.

I don't have any. I've been dragging through the possible ways to trigger tags, and all the Tag:apply_to_run triggers are extremely limited and none happen during SMODS.calculate_context

#

Wouldn't be too hard to make a Debug Tag that prints out any triggers, but vouchers will definitely work, so I'm going that route

azure wedge
#

hey i downloded a mod took forever to get to work but now whenever i hit the first shop mods or no it crashes

runic pecan
azure wedge
#

sorry took a sec to get the photo

raw geyser
#

Got a confirmation that vouchers can affect scoring.
Tossed this into my SMODS.Voucher(table) definitions:

calculate = function(self, card, context)
  print("DEBUG PRINT: ")
  for k,v in pairs(context) do
    print("context [ "..k.." ]", type(v) =="table" and "table" or v)
  end
end,

And got triggers for before, after, and everything in between

sturdy compass
azure wedge
#

currently

#

i have many lined up but i need this fixed first

edgy reef
#

Like proper voucher calc

raw geyser
#

Yeah, it's looking like vouchers can have joker-style effects

runic pecan
edgy reef
#

Mostly to un-scuff Observatory.

#

But very useful in general

raw geyser
#

I'm using it for a consumable that gives "+10 Mult to next hand"

azure wedge
#

crash sam image but no mod mention

dim lynx
#

post the whole crash

azure wedge
#

this the rest

raw geyser
#

It sounds like the smods lovely patches aren't getting applied. Make sure that your Mods folder is setup properly.
It should be Mods/smods/lovely.toml

random sleet
#

something like this?

#

just for uhhhh only one hand and flat mult

azure wedge
#

wait lovly in smods?

raw geyser
#

Lovely is the base modding tool. SMODS is built on top of it to be a better modding toolkit

random sleet
#

and i build on smods to make the most batshit insane shit

raw geyser
random sleet
#

do a tag maybe

#

i was considering tags for my own "buffs"

raw geyser
#

Tags don't have the calculation triggers unfortunately

random sleet
#

then make them have them

raw geyser
#

Would have to add it in myself, and meh. Would rather use a builtin tool

runic pecan
random sleet
#

tags arent cards

raw geyser
random sleet
#

smods uses a lovely folder

raw geyser
#

I'll check tomorrow with a debug tag, but I'm probably going to create a tag to "show" the effect to the player, but hide the calculations behind a voucher

azure wedge
#

is there a way to make game.lua to agree with pairs?

sturdy compass
#

It’s not game.lua that’s the problem. There’s a variable somewhere that’s passing in “nil” to a pairs() wrapper and that’s what’s causing your crash. What it is I don’t know

random sleet
azure wedge
#

also is it soppost to replay the same seed every lunch>

#

i get the smae hand and discard everytime

#

it says nosave_shop is nil should i have plad balatro before getting a mod?

#

OMG that was the issue i never did a run of regular balatro

#

thanks @sturdy compass for the idea to check for nil

sturdy compass
#

👌

novel violet
# novel violet i'll patch that and record what's going on

this is kinda fucked up
if I have it modify config.repetitions for the duration of the round and then attempt to reset it to 1 in joker_main or final_scoring_step, it just... doesn't do anything at all? which is like, incredibly strange
but if I assign local n to 1 at the very beginning of calculate, there's no way to have that value persist across different context runs as far as I can tell? i guess i could reorder events to calculate n independently of the initial retrigger scheme but that's slightly annoying, let's give it a shot though

#

yep, that's all i needed to do xD

#

fantastic, now it's fully operational, i'll show it off shortly

#

keqing now successfully creates two Lightning Stilettos (desc needs to be updated), and these stilettos successfully add 1 to her retriggers each
these are independent of blueprint/brainstorm for now as to not be too terribly broken, but i think perhaps i will change that?

sturdy compass
#

I see the interesting thing happening with the messages now lol

novel violet
#

oh no it was way worse before

sturdy compass
novel violet
#

it was just because i had two entirely different cards defined in calculate_effect, i.e. one was sending the message, the other was shaking

#

(i am a big dumb idiot)

#

right now it's actually working as intended consistently across rounds!

sturdy compass
#

Huuuuuge

novel violet
#

tysm for your help

sturdy compass
#

Yeah of course

#

We gotchu here

neat plover
#

how would i disbale a hand?

plush cove
#

in a blind?

neat plover
#

and more precisely the most played one

neat plover
novel violet
#

is there any particular way to dynamically check how many times a joker is being copied before scoring -- i.e. without iterating through each context check

sturdy compass
#

With how Blueprint-like cards handle copying, I would guess no

novel violet
#

that's a damn shame

mystic river
novel violet
#

but for now that is OK, very minor issue

#

ty astra

sturdy compass
#

Yup yup

grim remnant
#

yeah, it's the blueprint-like joker again. for whatever reason, after adding repetitions, those work just fine! ...but now, the tripled copy isn't working at all for non-retrigger jokers. (at first, it was also just straight up crashing if it didn't find retriggers because of a > 0 instead of a ~= nil which, uh, obvious fix. ;P

what're we missing here? the error itself seems to be the for loop itself (as it's only running once, not until the amount specified in card.ability.extra.funk), but heck if we know what the exact syntax is supposed to be in this case. it's just over 3:30 AM here, leave us alone... ;P

novel violet
#

for my first joker this has been weirdly complex but it has been very fun

sturdy compass
#

Honestly going super complex for your first isn’t the worst cuz you learn a lot out of it that make the simpler ones that much easier

novel violet
#

that's how i do pretty much everything when i learn something new

#

i start big, frustrate myself to no end, and thank myself months later

sturdy compass
#

My first joker was the Fortune Cookie which has a decaying chance roll and spawns a random tarot card, so I got a lot of valuable experience of out that one

novel violet
#

:o that's a cool concept

#

name is very fitting too

sturdy compass
neat plover
#

just a question, how do you do those?

sturdy compass
#

I haven’t seen any other mod do anything with decaying odds so it was cool to work with

sturdy compass
neat plover
#

oh ok makes sense

sturdy compass
#

Jenga lmao

novel violet
sturdy compass
plush cove
# sturdy compass Jenga lmao

it's because it's a tower that you stack with mult, but the more you stack, the more likely it is to collapse and reset to 4 mult

sturdy compass
neat plover
plush cove
sturdy compass
#

Lmfao

plush cove
#

if you want to double the chance that Jenga resets, be my guest

sturdy compass
#

That’s devious

#

Instead of slowly pulling out a block you’re pulling one of those crazy karate chops that sometimes work lmfaooo

neat plover
#

shaking the tower to get the block out

plush cove
sturdy compass
#

Goofy as hell

neat plover
#

umm someone is playing jenga with paper and glue blocks

plush cove
#

i liken Jenga to Misprint because both can be reliable mult, but can also completely screw you over

sturdy compass
#

That reads

#

Anyways I finally reworked a card that needed reworking for awhile. I teased this in the Maximus server but never showed it off here

sturdy compass
#

Lmfao

#

You will have to find out his true form when the update comes out eye_brow

neat plover
#

i am scared now

sturdy compass
#

You shouldn’t be tbh

neat plover
#

in a good way i mean

sturdy compass
#

Huh

neat plover
#

how good is it gonna be????

sturdy compass
#

Quite

#

Gotta make living with a Jimbo and this extra card for 3 rounds worthwhile

#

Not to mention you need Jimbo in hand for Coronation to appear in the first place

chrome widget
#

Attempting to draw something with a stencil right now and I'm not sure it's doing it right

chrome widget
#

Everything on the entire screen to the right and bottom of the card with the stencil disappears while the stencil is being drawn, and the stencil itself doesn't seem to work

chrome widget
# plush cove

oh hey that's like 4x mult or smth. don't mind if I do

warm sphinx
#

How would someone go about having a joker run a python script? I don't really understand this

frosty dock
#

anything is possible in the realms of arbitrary code execution

#

you can just call another program whenever you want

warm sphinx
#

But how would I go about doing that?

frosty dock
#

they literally sent the code?

#

you just need to have python installed

warm sphinx
#

I have it installed its just that I struggling to understand what I doing wrong with lua telling it cause it crashes balatro anytime I start it up

warm sphinx
#

Io?

warm sphinx
jagged mortar
#

yo chat any clue why lovely "mod" is throwing an error?

royal ridge
#

do you have 2 steamoddeds

jagged mortar
#

nah, just smods-main
should i get rid of -main?

royal ridge
#

it's fine

#

don't know what the issue is then though

jagged mortar
#

it wants this function to have 'end'
i'm not gonna pretend to be an expert in lua, but is there something wrong here?

runic pecan
jagged mortar
manic rune
neat plover
#

ok i dont get it, but clearly you put a ton of work into this so great work

manic rune
#

thanks :D

paper comet
#

I'm making a new joker and idk why this is crashing - i even named the variable reroll_cost_ just in case i was shadowing a variable or smth (yes ik shadowing a variable doesnt make sense with that error message but who knows!) but i cant figure out why ability would be nil

runic pecan
neat plover
#

how would i check if any joker is sold?

runic pecan
frosty dock
#

that evaluates only for the card being sold

#

context.selling_card

spring lantern
#

there's also selling_card tho right

#

yea

neat plover
#

thks!!

runic pecan
manic rune
#

its really fortunate how jokers in other card areas dont trigger, else id need to rewrite most of my code

frosty dock
#

wdym jokers in other card areas

manic rune
#

i added a new card area

#

i initially thought that if i were to put jokers in there then their calculation and allat would still work

frosty dock
#

only if you add the area to SMODS.get_card_areas

neat plover
frosty dock
neat plover
#

oh

neat plover
frosty dock
#

if context.selling_card and context.card.ability.set == 'Joker' then

neat plover
#

i hate when its that easy and i need to ask people

#

how do i add sell value to my joker?

manic rune
#

try looking at the code of egg and giftcard (wait is that the joker's name)

neat plover
#

oh

runic pecan
#

@frosty dock What is the lowest 4-digit version number (and one letter) for smods new-calc? I want to specify the dependency in my mod wiki page.

frosty dock
#

i recommend you set the dependency version as what you developed it on

manic rune
#

just to be sure, theres smt like :get_edition() right?

neat plover
#

so this sets "value" to "value" + "extra" and then justs sets cost ? i dont undestand how "value" is used here

red flower
#

You need to look at what set_cost does, it uses the extra_value

neat plover
#

oh

runic pecan
neat plover
#

i got that

manic rune
neat plover
#

im not going throught that just to add sell value, imma search a mod that adds a joker that does that but thanks

frosty dock
manic rune
#

oh

frosty dock
#

if you just want the edition key, that's card.edition.key

manic rune
#

thanks :D

prisma loom
runic pecan
# prisma loom

What would it look like if you dont use Event?
Just, straight up context.other_card:set_edition(...) in your code.

runic pecan
# prisma loom

What about, instead of applying it when scored, try apply it in context.before/after?

prisma loom
#

at the start and end of round as well

#

its a mess

runic pecan
#

What about DNA's timing?

#

Got to say, your video is quite lagging at the edition-applying moment.

prisma loom
runic pecan
#

No, first hand played.
first_hand_drawn is for the jiggles.

prisma loom
#

this?

runic pecan
#

And you only need to apply it once, so you might as well apply it before instead of during scoring.

spring lantern
#

it seems like you're returning the message on every context

#

when do you want it to trigger

runic pecan
#

Your return is outside of the if statement.

spring lantern
#

yeah that's the issue

#

what size are tag sprites usually?

prisma loom
spring lantern
runic pecan
spring lantern
#

i assume they have the 1 pixel padding right

prisma loom
runic pecan
# prisma loom

Instead of return true, you need to return the {} that has message, colour, and card in it.

prisma loom
#

like this?

#

(it still doesnt work)

frosty dock
runic pecan
# prisma loom

Remove G.play check, individual check, and repetition check, you won't need them.

runic pecan
# prisma loom

Oh and instead of context.other_card, you'll need context.full_hand[1].

prisma loom
runic pecan
runic pecan
# prisma loom

Have you noticed that you typed context. twice in each occasion?

prisma loom
#

I didnt haha

prisma loom
runic pecan
random sleet
prisma loom
runic pecan
prisma loom
prisma loom
ionic timber
#

can someone explain to me why this doesn't seem to work ?

G.GAME[("Legendary"):lower() .. '_mod'] = 0.1

I took ownership of the legendary rarity and added a print in the get_weight, and the weight doesn't change; so my guess is the provided key is not the right one, but how am I supposed to know what's the correct key for vanilla rarities ?

random sleet
#

if THAT'S also not what you want, try putting that func inside an extra table that you return from the same return statement. this makes it act like another, following, "return"

spring lantern
#

tried to hook into set_globals on my main script to add values to the colors table but i guess it doesn't apply the changes

#

should i just make my own globals

random sleet
prisma loom
random sleet
#

oh shoot you wanna do that with an event mb

spring lantern
#

i was about to say

prisma loom
spring lantern
#

if the timing's off then an event can help control that

random sleet
#

but you can use that to prime the event at different timing

prisma loom
#

so I should add a param under G.E.MANAGER?

#

for timing

random sleet
#

i think it defaults to before which is what you want iirc

prisma loom
#

in sfx

random sleet
#

also i don't recall what the set_edition arguments are, which do your nil, false, true correspond to

prisma loom
#

one sec

random sleet
#

i think you want whatever one is "immediate"

prisma loom
#

as args

random sleet
#

wh

#

what

prisma loom
#

arguments for set_edition

#

theres only poll edition inside

random sleet
#

oh shit

#

thats poll editions args lol

#

im on my phone srry

#

i forget exactly but one of the args is immediate

#

i think it's (edition, silent, immediate)

#

so like (poll_edition(...), nil, true) maybe

prisma loom
random sleet
#

but also double check that

#

yeah

prisma loom
#

hallelujah

#

It fixed it!

#

Thanks, folks!peepoLove

plucky goblet
#

Is there a mod, or maybe a debug function that allows you to choose your joker for testing purposes?

tepid crow
spring lantern
#

i've never programmed a tag before so i'm kinda lost on how to spawn in and open a booster :x

edgy mountain
#

trying to check for matching cards when discarding

#

do i use full_hand or something else?

#

isnt working for now

runic pecan
edgy mountain
#

check if there are at least 2 cards of the same rank on discarded hand

west mason
#

how can i use custom colors on the info bubbles? i want the 1 in 2 to be the same custom color as Sacred Fire

frosty dock
manic rune
#

do the same as how you changed the color for X3 Mult

timid oyster
#

Does anyone know if Balatro will load localization files without Steamodded or Lovely? I'm wondering if it's possible to make it easier for people to download my Māori language mod

runic pecan
manic rune
#

but other than that, i dont think so

edgy mountain
manic rune
spring lantern
#

okay i made it work by checking the vanilla code but i feel like there's much better ways of doing this with smods

edgy mountain
#

i just need to detect if onee or more cards share the same rank

#

if i used the poker hands there could be conflict with mods that add more card selection

west mason
frosty dock
runic pecan
runic pecan
edgy mountain
#

the pre discard one that is

#

it does work when i check a played hand on before

runic pecan
edgy mountain
# runic pecan May I see the full calculate function?
        local count = {}
                local found = false
        if pseudorandom('jester_dice_play') < G.GAME.probabilities.normal / card.ability.extra.odds then
            if context.before and context.scoring_hand then
                

                for _, v in pairs(context.full_hand) do
                    if not SMODS.has_enhancement(v, "m_stone") then
                        local rank = v:get_id()
                        count[rank] = (count[rank] or 0) + 1

                        if count[rank] > 1 then
                            found = true
                        end
                    end
                end

                if found == true then
                    ease_hands_played(1)
                    return {
                        message = "snap!"
                    }
                end
                if context.pre_discard then
                for _, v in pairs(context.full_hand) do

                    if not SMODS.has_enhancement(v, "m_stone") then
                        local rank = v:get_id()
                        count[rank] = (count[rank] or 0) + 1

                        if count[rank] > 1 then
                            found = true
                        end
                    end
                end
                    if found == true then
                        ease_hands_played(1)
                        return {
                            message = "snap!"
                        }
                    end
                end
            end
        end
    end```
#

bit too big for a screenshot

runic pecan
manic rune
edgy mountain
#

it wasnt letting me send it

edgy mountain
#

enter was just jumping a line

runic pecan
stiff locust
#

it wont let you send one that is half open

runic pecan
red flower
#
print()
#

it let me

manic rune
#

hacks

edgy mountain
#

i still keep my moint about the send message button

manic rune
#

you forgot the "lua" part, but its probably fine

red flower
manic rune
#
print("wassup big dog")

r u sure your typing cursor is OUTSIDE?

#

it works for me

#

just make sure the typing cursor is outside

runic pecan
runic pecan
#

First of all, you put if context.pre_discard then inside if context.before and context.scoring_hand then, which are exclusive to each other.

runic pecan
#

Second, you put if pseudorandom... then on top of EVERYTHING, which is not exactly bad, but I'm afraid this might bite your hind in the future.

edgy mountain
#

tbh drag me i deserve it lol

runic pecan
#

By putting if pseudorandom... then on top, you are equivalently flipping coins Every single time whenever anything is happening.

runic pecan
#

Third, if you're completely sure found is always a boolean value, you can use if found then instead of if found == true then.

paper zealot
#

And if you're not completely sure if found is always a boolean value, there's the classic if not not found

shadow rapids
#

...

#

That'd also perform the if with any other truthy value e.g. 1

#

I'm pretty sure

runic pecan
# edgy mountain ```calculate = function(self, card, context) local count = {} ...

Hence, I suggest:calculate = function(self, card, context) if context.before or context.pre_discard then local count = {} local found = false for _, v in pairs(context.full_hand) do if not SMODS.has_enhancement(v, "m_stone") then local rank = v:get_id() count[rank] = (count[rank] or 0) + 1 if count[rank] > 1 then found = true end end end if found then if pseudorandom('jester_dice_play') < G.GAME.probabilities.normal / card.ability.extra.odds then ease_hands_played(1) return { message = "snap!" } end end end end

shadow rapids
#

Because both if and not probably use the same algorithm to force values into booleans

manic rune
#

if i were to use, for instance:

local rng = pseudorandom("example")

then i compare rng >= 1/2, then it would be very slightly higher than 50%, right?

shadow rapids
#

Shouldn't be

manic rune
#

really?

shadow rapids
#

pseudorandom should return a number [0,1)

#

Logically

#

I have no idea tho

manic rune
#

yeah, but without the "=" it would ignore if rng was somehow exactly 0.5

shadow rapids
#

Yeah

shadow rapids
#

Without the = it would be slightly less than 1/2

manic rune
#

oh yeah, thats right

frosty dock
manic rune
#

true, its probably like 0.0000000001% considering the number of digits rng has

paper zealot
manic rune
#

good idea, i will do just that

shadow rapids
#

Also I've had an interesting idea for a mod that I don't actually think can be made

frosty dock
#

i don't even know why i did this, it's not even close to enough iterations to even have a considerable chance of happening within that amount of polls 💀

manic rune
#

lottery simulator 😭

paper zealot
frosty dock
#

that seems like too many

paper zealot
#

Since fractions between 0 and 1 would be able to use the full mantissa range

frosty dock
#

the mantissa is 52 bits though

paper zealot
frosty dock
#

it seems there'd be about 2^62 doubles in the range from 0 to 1 in total

#

however my guess it that significantly less are actually possible as it has to be somewhat uniform

manic rune
#

if its not 0%, then its theortically possible

frosty dock
#

given there's 2^52 doubles between 1/2 and 1, I would expect the lower end to use the same amount here, roughly

#

if it uses the full range there, it'd be 1 in 2^53

paper comet
frosty dock
#

that looks like a bad context check at the very least

runic pecan
frosty dock
#

but also your loc_vars has wrong arguments

#

loc_vars args are (self, info_queue, card)

paper comet
runic pecan
manic rune
#

same

long sun
#

how do i score on an unscoring card?

#

i did something with unscoring for Sketch, but it wasn't on individual cards

frosty dock
#

you just replace whatever cardarea check you have with context.cardarea == 'unscored' and make sure you have the optional feature enabled

long sun
#

cheers :D

long sun
frosty dock
#

SMODS.current_mod.optional_features = { cardareas = { unscored = true } }

long sun
#

do i add that to my joker?

#

or does it go elsewhere in the code?

frosty dock
#

that just goes in your mod's main file

long sun
#

grand, thanks :D

#

hmm, no, it's not working :{

#

code:

if context.individual and context.cardarea == 'unscored' and pseudorandom('tennisball') < G.GAME.probabilities.normal / card.ability.extra.odds then
        local target = context.other_card
        target:set_ability(G.P_CENTERS.m_steel, nil, true)
        G.E_MANAGER:add_event(Event({
            func = function()
                target:juice_up()
                return true
            end
        })) 
        G.E_MANAGER:add_event(Event({
        func = function()
            play_sound("tarot1", 1, 0.5)
            return true
        end
        }))
        return {
            message = "Steel",
            colour = G.C.FILTER,
            card = card
        }
    end```
frosty dock
#

smods version?

long sun
#

1.0.0~ALPHA-1326a? or is it 1.0.1o-FULL?

frosty dock
long sun
#

ah i see :D

#

neato!

#

getting this error after updating SMODS:

#
Oops! The game crashed:
Syntax error: blind.lua:353: 'end' expected (to close 'for' at line 351) near 'elseif'


Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~ALPHA-1426b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.6.0
Platform: Windows

Stack Traceback
===============
(3)  C function 'function: 0x28ffcf38'
(4) global C function 'require'
(5) main chunk of file 'main.lua' at line 887
(6) global C function 'require'
(7) LÖVE function at file 'boot.lua:323' (best guess)
Local variables:
 c = table: 0x28ffa5a8  {identity:false, version:11.5, accelerometerjoystick:true, modules:table: 0x28ffa5f8 (more...)}
 openedconsole = boolean: false
 confok = boolean: true
 conferr = nil
(8) global C function 'xpcall'
(9) LÖVE function at file 'boot.lua:362' (best guess)
Local variables:
 result = boolean: true
(10) global C function 'xpcall'
(11) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
 func = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
 inerror = boolean: true
 deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
 earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
frosty dock
#

nvm

#

update lovely

long sun
#

okie doke

#

bingo, thanks!

#

haha okay this works well now :)

#

thanky thanky!!

stiff locust
#

when I try to play a sound from my mod the game keeps checking the vanilla files resouces/sounds for the file (causing a crash since it can't find it) even though I defined the sound with SMODS.sound and it appears to work there

anyone got any idea why this wouldn't be working?

SMODS.Sound({
    key = "s_tsun_probability_tm",
    path = "lucky.ogg"
})

sound is played here

play_sound("s_tsun_probability_tm", 1, 1)

in a joker

frosty dock
#

why did you prefix the key yourself

stiff locust
#

was I not supposed to do that

#

that's why it's having the problem huh

frosty dock
#

sounds don't have a class prefix, so steamodded doesn't recognize that you prefixed it

#

so the real key ends up as tsun_s_tsun_probability_tm here

stiff locust
#

oh I see

#

okay noted thanks

old bane
#

i just have a quick question: how does one update sell value to be a specific value? i'm trying to make a joker that has its sell value randomly change and i keep seeing that its sell value is 4 (which is most likely just the default because the buy cost is 9)

frosty dock
#

normally what you do is you don't prefix when creating it and just use the prefix when playing the sound

stiff locust
#

yeah that makes sense

#

I thought sounds would have a class prefix but i guess not

#

yeah it works now thanks

frosty dock
brisk pond
#

what do you recommend for storing variables inside jokers? config.extra?

frosty dock
#

yes

manic rune
#

what could be the cause to this

brisk pond
frosty dock
spring lantern
#

10/15 done :3

manic rune
#

anyone encountered this problem before?

crisp coral
#

good time to hold G + A

prisma loom
#

It's such a weird bug

runic pecan
long sun
#

how do i get the list of unscoring cards?

prisma loom
#

delay persists

hot island
#

does anyone know if you can patch multiple of the same pattern in lovely instead of just the first instance in a file with just one patch

paper zealot
#
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "self.SPEEDFACTOR = 1"
position = "after"
payload = '''
initSteamodded()
print('{{lovely:var_name}}')
'''
match_indent = true
times = 3
hardy viper
#

they do that by default

#

iirc

long sun
hot island
#

if i do 9999 or something will it break or just do all of them

#

or is there a better way to do all of them

paper zealot
#

For clarity, you should probably count and specify the number, so that it doesn't show an error that it mismatched

hardy viper
#

again it replaces all instances of that pattern by default

paper zealot
#

Setting times to the right number will also help you recognise more quickly if your pattern is matching less or more than what you want it to

hot island
#

well i want it to work without changing it preferably even if balatro gets updates

paper zealot
#

Not necessary as CG said, but the extra sanity-check is helpful

hot island
#

idk why i thought it was only the first one

#

oh maybe i already had times = 1 on my other mod

ionic timber
#

is there an easy way to change the highlighted card limit of the game or should I keep screwing around with toml file etc ? I currently am doing this but it doesn't allow me to pick up more since it's all variable are attributed in the init function of cardarea

hardy viper
#

so for example G.jokers.config.max_highlighted = 2

ionic timber
#

holy f*ck this is so obvious now that you mention it

#

thanks a lot !!!

hardy viper
#

np

modern kindle
#

i couldve sworn by default it replaces all matching patterns unless you specifiy the amount of times

pulsar flower
long sun
#

lemme attempt something rq :D

#

okay no i've got no clue =w=

#

i want it to trigger in joker_main, but i also need to access the context's unscoring cards too

sturdy compass
#

you would probably have to enable the unscored cardarea feature. Try adding this to your code
SMODS.current_mod.optional_features = { cardareas.unscored = true }

#

Not entirely sure if that'll do it but it'll be something along those lines

long sun
#

i've done that, yep

sturdy compass
#

hmm

long sun
#

i've used that for unscoring cards doing something, but i don't know how to check them, is the thing

sturdy compass
#

Can you tell me what the general function of your joker is?

long sun
#

+1 hand if played hand contains an unscoring Ace (3 [3] uses each round)

sturdy compass
#

And how exactly are you checking for it currently?

long sun
#

i'm not, currently, that's the problem :)

#

i don't know how to get the unscoring cards in context.joker_main

paper zealot
# hot island well i want it to work without changing it preferably even if balatro gets updat...

In my experience with Harmony patching over years of RimWorld updates, unless you're patching only a few things, and those things are extremely simple in a very stable or loosely-coupled class, it's almost certain that some of your patches will break between updates. There's just no a guarantee that variables will retain their names, or data structures will remain the same, or classes and functions will continue to exist at all.
If your mod is dependent on patches to the point where it will break down if a single one of your patches breaks, then there's also no point in trying to safeguard only some of them.
Sometimes failing early and in an obvious way is better than attempting to hide, sidestep or predict errors that might occur in the future. Only you can really gauge for your specific case, but something to think about.

long sun
#

though i used context.individual and context.cardarea == 'unscored' for when the game runs through the played hand

#

mm, i guess i could add those cards to a local variable? but i don't like that solution much

sturdy compass
#

Ok then, what I would recommend then is looping through the cardarea context and using get_id() to check if the current card is an ace (ace == 14)

#

a for in loop would work nicely

long sun
#

ohh, and then store that as a bool locally?

#

right okay :D

sturdy compass
#

precisely

long sun
#

i'll give that a go, thanks! :D

sturdy compass
#

And if that bool is true by the end of the loop, do your function

long sun
#

was hoping there'd be a better solution that SMODS allows, but i guess this context was only added a week ago, so =w=

#

thanks again ^^

sturdy compass
#

np, best of luck

crisp coral
#

i love chips madness*

sturdy compass
#

wonky

modern kindle
red flower
#

we really need a custom area API

#

mostly so that dimserene's pack doesn't end with a dozen overlapping areas to the right of the screen

sturdy compass
maiden river
red flower
#

yeah but maybe we can have something with pages if it overflows

granite kettle
#

Yes, I suppose we have done the same fixes to seeds shaders mipmapping, threads and reimplement bitshifts
#⚙・modding-general message
Also had to fix lovejs like you, basically dumb undefined check the sound engine that caused crashes

wintry solar
sturdy compass
#

Eremel after we ask for documentation

long sun
#

sorry to bother, this line's throwing an exception, what's wrong?
for cand in context.removed do
the error message says i'm indexing into a table value

modern kindle
#

is there a particularly easy way to add a 'use' button to a joker? i dont want to make a whole new cardarea just for one joker and would rather make it have 'charges' that can stack and be used while still sitting int he normal cardarea

brisk pond
#

is there a better way to check for boss blinds?

modern kindle
#

i approve of the switch to dark mode

sturdy compass
long sun
#

ah i see, thanks :D

#

is that the same for glass breakages?

sturdy compass
#

I think broken glass cards find their way into that context so yes

long sun
#

coolio :D

onyx sonnet
#

is there a way to know how much the player spent on a reroll?

long sun
sturdy compass
brisk pond
long sun
#

it's probably here:

if context.cards_destroyed and not context.blueprint then
        local count = 0
        for k, v in pairs(context.glass_shattered) do
            if v:is_suit("Diamonds") then count = count + 1 end
        end
        
        if count > 0 then
            card.ability.extra.current_xmult = card.ability.extra.current_xmult + (card.ability.extra.added_xmult * count)
            return
            {
                message = card.ability.extra.current_xmult,
                color = G.C.RED,
                card = card
            }
        end
    end```
normal crest
#

Where did you get context.glass_shattered

long sun
#

that's the context that lists the shattered cards

#

i've used it in Coiny's code

normal crest
#

I don't think that's a thing, loop through context.removed and do if SMODS.has_enhancement(v, 'm_glass')

sturdy compass
#

It is a thing actually lmao

#

try ipairs instead of pairs actually

long sun
#

hokai!

#

nope.

#

same error

sturdy compass
#

hm

#

What's that line in misc_functions.lua doing? Check your lovely dump

normal crest
long sun
#

for b, c in s:gmatch('()(' .. utf8.pattern .. ')') do

#

so that's the s in question

normal crest
#

What is the error? Could you send a screenshot

long sun
normal crest
#

I'm on phone

long sun
#

attempt to index local 's' (a number value)

#

maybe my code included a non-UTF-8 character?? no idea

sturdy compass
#

Btw here's my method of checking for broken glass cards if that helps at all

#

stg = card.ability.extra in my case

long sun
#

mm, okay

#

could you copy and paste that here?

sturdy compass
#

Yeah yours would probs work better, this is an older Joker

long sun
#

oh, kay

sturdy compass
#

It'd be worth changing to that, even if just for debugging

normal crest
#

So make sure to updatr before anything

long sun
#

oh, kay

#

maybe it's that? question mark??

#

i removed the bit about glass and it still threw

sonic cedar
#

how would i have a joker retrigger the use of a consumable?

long sun
#

perfecto, it works now!... for some reason :)

#

thanks ^^

sturdy compass
#

lmfao

#

lovely to hear

long sun
#

...oh, The Hanged Man broke it =w=

brisk pond
#

how to check the suit of a card?

for k, v in pairs(context.full_hand) do
    if v.suit == "Diamonds" then
        count = count + 1
    end
end
manic rune
#

v:is_suit("Diamonds")

long sun
#

will get back on when i get home, i have a bus to catch :)

#

cyaaaaaa! thanks!

sonic cedar
sturdy compass
#

For a joker to retrigger something you would return repetitions = [Number of retriggers]

#

As for cosumables though, I'm not sure if their use functions take a repetition

sonic cedar
#

do you know where i can look for it?

#

the consumable functions i mean

sturdy compass
#

Unfortunately I do not off the top of my head

sonic cedar
#

ah thats ok then

#

thanks

sonic cedar
sturdy compass
#

the second one

sonic cedar
#

thought so

wintry solar
#

No

#

Not that either

#

In calculate

sturdy compass
#

Oh wait yeah I didn't even realize that was in locvars

sonic cedar
#

curses

manic rune
#

i overhauled how gacha works (credits to N')

sonic cedar
onyx sonnet
#

if context.opening_booster is true, would context.card.cost give me the cost of the booster pack?

sturdy compass
# sonic cedar

This would make it attempt to retrigger anything anytime calculate is called. You should constrain it to certain contexts

#

most probably context.repetition

onyx sonnet
#

Thank you!

grim remnant
sonic cedar
#

unless im foolish

normal crest
#

So it's returning on the first iteration every time

sturdy compass
# sonic cedar unless im foolish

I believe this will retrigger all playing cards with no rime or reason. I know you're just doing this to get a feel for how it works which is totally fine, I'm just trying to give you a sense of what it would do

sonic cedar
#

ok cool that's what i thought

tall wharf
#

madness but controllable

onyx sonnet
#

whenever i buy boosters it doesnt do anything, but other cards and vouchers work just fine

sturdy compass
#

context.open_booster is what you want

#

not opening_booster

onyx sonnet
#

ah

#

ty!!!

sturdy compass
#

yup!

manic rune
sturdy compass
#

wtf

onyx sonnet
#

man i know 3 programming languages and i still dont know how to read 🥹

kindred heron
#

Trying to make the joker to the left of mine become negative but i can't seem to get it working

grim remnant
# sturdy compass wtf

we can still read older messages, it might've just been a weird hiccup on discord's end

normal crest
sonic cedar
#

would that be the right context param do you thtink

sturdy compass
#

As I said, I don't believe consumable use functions can be retriggered

sonic cedar
#

what about the effects of the consumables themselves?

sturdy compass
#

Probably not since those are a result of those same use functions

sonic cedar
#

darnnnnnnnn

manic rune
#

unless you got patches, i dont think you can retrigger consumables

sonic cedar
#

i guess i'll jsut have to go with the orgiinal plan of the double probability thing

manic rune
#

oops, all 6s?

sonic cedar
#

i think that SHOULD be possible?

sturdy compass
#

What specific cards?

manic rune
#

it is

sonic cedar
#

i do the for probabilities yada yada thing or whatever and then constrict it to a certain set probably

manic rune
#

make a custom global variable, like G.customProbability or something

sonic cedar
sturdy compass
#

Ok yeah that'd be easy. You've just gotta take ownership of the card and apply your probablility to its prob check

sonic cedar
#

i was originally wanting it to trigger again, like a retry of sorts

but patches,,,,

jovial harness
#

Been trying to figure out how to use a patch to give a specific joker a custom back sprite when flipped but no matter what I've tried, i can't seem to get it to work. Been heavily referencing how Joyous Spring does it but even then, I can't seem to get any result other than "nothing" or "game crash"

sturdy compass
sonic cedar
manic rune
#

mhm

sonic cedar
manic rune
#

pseudorandom(blah blah) < "that global custom probability"/ the odds or something

maiden river
#

is there a way to draw cards from the discard pile to the hand? there's a function for drawing from the discard pile to the deck and drawing from the deck to the hand but the cards aren't drawn from the discard to the top of the deck (unsurprisingly)

grim remnant
sturdy compass
manic rune
sonic cedar
maiden river
#

but I have to figure out the signature

manic rune
normal crest
#

Your return is inside the for loop

manic rune
#

G.GAME.probabilities.normal is the "1", while card.ability.extra.odds being the "6"

so its 1/6

if you change G.GAME.probabilities.normal to your global variable, then you can freely manipulate the odds

sonic cedar
#

i seeee

sonic cedar
manic rune
#

it is calculate

sonic cedar
#

oh fm ig lmao

manic rune
#

its fine lol

grim remnant
#

oh, THAT was what we were missing. for syntax is weird and our attempts to prevent infinite loops end up, counter-intuitively, Ruining The Purpose Of The Loop. ;P

sonic cedar
manic rune
#

mhm

#

you put what you want the joker to do if the rng check is done inside the if statement block

sonic cedar
#

what i have so far

#

i just need to figure out how to make the context be when using a consumable

#

oh wait

manic rune
#

oh, it actually should be G.GAME.farmerProb now that i think about it

#

and if G.GAME.farmerProb hasn't been set beforehand then its nil

sonic cedar
#

well it was set to GAME.probabilities at the top of the code

#

so then it's fine right

manic rune
#

so you want to do smt likee

pseudorandom('farmer') < (G.GAME.farmerProb or 1)/card.ability.extra.odds

manic rune
neat plover
#

how would i add to the ante counter when a joker is sold

sonic cedar
manic rune
#

G.farmerProb is a table?

sonic cedar
#

i just replaced the all6 probs with farmer's

manic rune
#

also, the first if statement is wrong

it should be card.ability.name == "c_wheel_of_fortune", im pretty sure

sonic cedar
#

oh i was going off of

manic rune
#

card itself is an object

neat plover
sonic cedar
manic rune
manic rune
wintry solar
#

card also refers to whatever object this calculate is on

sonic cedar
#

pardon

wintry solar
#

You’d want context.consumeable to see what consumable has been used

sonic cedar
#

ohhh

#

instead of using? or do you mean an additional context

wintry solar
#

So this is a joker looking for wheel uses right?

onyx sonnet
#

@sturdy compass sorry for the extra ping but how does the "kind" variable for boosters store its info?

sonic cedar
#

so it can double the probability

onyx sonnet
#

or is it an ID

wintry solar
#

So you’d do if context.using_consumeable like you have, then if context.consumeable.config.center_key == “key of wheel here”

onyx sonnet
#

Thank you!

sturdy compass
#

np

sturdy compass
#

Actually wait no, my apologies

#

You would want 'Arcana'

onyx sonnet
#

👍

kindred heron
#

They joker burns before saying its last words

#

Dont look at the top its my first time making mods

sonic cedar
manic rune
#

well, it's already dissolving so its not gonna say anything lol

sturdy compass
kindred heron
onyx sonnet
#

what am i doing wrong here?
im trying to increment the amount of selectable cards only in arcana packs by 1

sturdy compass
#

Unfortunately you might need to do a patch for that functionality

onyx sonnet
#

😨

#

hm

sturdy compass
#

Here are the two I have to change pack choice based on a modifier one of my cards changes

sturdy compass
#

Have you done anything with lovely patches?

onyx sonnet
#

Nope

sturdy compass
#

Hoo boy ok

#

I'm boutta open a whole new world for you lmao

onyx sonnet
#

I gotta drink some water before this

#

Hit me with it

sturdy compass
onyx sonnet
#

This is mostly gibberish to me but i more or less understand the general happenings described in the example

sturdy compass
#

So to give you a tl;dr of the tl;dr, Lovely patches are means of modifying or adding code to vanilla files

onyx sonnet
#

mhm,i got that

sturdy compass
#

to start making them, you either want to make a lovely.toml in the root directory of your mod or a lovely folder that contains multiple .toml files. It's up to preference

onyx sonnet
#

i was using another mod as a template for mine and it seems to already have a lovely.toml

wintry solar
sturdy compass
onyx sonnet
#

so do i just add your patches to the file?

manic rune
#

would i be able to use ★★★★★ in the joker's description lol

sonic cedar
sturdy compass
neat plover
#

still gonna ask how do i add one ante when a joker is sold

sturdy compass
woeful tusk
#

how can i edit the "ERROR" text? im learning.
please and thanks.

red flower
onyx sonnet
sturdy compass
normal crest
sturdy compass
#

I'd write out the patch for you but I'm boutta run out Emoti_Shrug

#

I can still provide assistance through text tho

jovial harness
# red flower can I see the patch? I thought it was pretty straightfoward
version = "1.0.0"
priority = 0

[[patches]]
[patches.regex]
target = "card.lua"
pattern = 'self\.children\.back = Sprite.*'
position = 'after'
payload = '''
if _center.backsprite then
    self.children.back = Sprite(self.T.x, self.T.y, self.T.w, self.T.h, G.ASSET_ATLAS['FinalBosses'], self.config.center.backsprite)
end
'''
match_indent = true```
Currently testing this but having attempt to index field 'atlas'
onyx sonnet
sturdy compass
#

alright I'll brb

frosty dock
jovial harness
#

And on the joker side, MODS.Joker{ key = 'okinamatara', rarity = 4, atlas = 'FinalBosses', pos = { x = 7, y = 0 }, soul_pos = { x = 7, y = 1 }, --TODO: Make her have her back sprite have a door. oh god how do i do this. Sprite is at { x = 7, y = 2 } --god i'm gonna have to figure out how to use lovely to make a patch for a cute easter egg. #suffering. cost = 25, blueprint_compat = true, backsprite = { x = 7, y = 2 }, calculate = function(self, card, context) if context.retrigger_joker_check and not context.retrigger_joker and context.other_card.config.center.rarity == 1 then G.E_MANAGER:add_event(Event({ func = function() context.other_card:juice_up(0.5, 0.5) return true end })) return { message = localize("k_again_ex"), repetitions = 4, card = card, } end end, }

jovial harness
#

oh my god it works

#

it was literally just "i needed a prefix" lmao

frosty dock
#

lol imagine the Balatro modding landscape with no forced prefixes

old bane
#

This line keeps on crashing, any idea why?

if context.end_of_round and not context.blueprint and context.game_over and (to_big(G.GAME.chips) / to_big(G.GAME.blind.chips)) >= 0.5 and not card.ability.extra.death then
jovial harness
#

And the way I implemented it means I can actually give other jokers custom backsprites too

old bane
manic rune
neat plover
manic rune
#

pretty sure it will work

#

if it works like ease_cash

neat plover
#

ok

kindred heron
#

How do i add multiple jokers?

jovial harness
#

What do you mean by "multiple jokers"?

kindred heron
#

made one joker