#💻・modding-dev

1 messages · Page 145 of 1

dim steeple
#

you're writing what the card local args are for writing localized text on the card

primal robin
#

It's a function which you MUST call when you're doing any rng-related stuff which depends on seed

dim steeple
#

e.g what it says here:

dim steeple
ionic verge
#

when do blue seals trigger?

rare bobcat
primal robin
#

And for getting random element from table you should use pseudorandom_element function

rare bobcat
#

Along with steel, mime, gold, etc

#

Held in hand at end of round stuff

dim steeple
frosty dock
#

also works through calculate in context.end_of_round with better calc ^

gaunt thistle
#

common better calc win

frosty dock
#

okay so I'm thinking i just "fuck it we ball" merge voucher calc

rare bobcat
#
target = "game.lua"
pattern = "{voucher = 'v_telescope', consumable_slot = -1}"
position = 'at'
payload = '''{voucher = 'v_telescope', `v_observatory', 'v_planet_merchant', 'v_planet_tycoon', consumable_slot = -1}'''``` isn't working either
#

I see it

zenith ridge
#

I spelled "individual" as "individul".

#

It works. I did it.

#

Thank you all.

rare bobcat
#
target = "game.lua"
pattern = "{voucher = 'v_telescope', consumable_slot = -1}"
position = 'at'
payload = '''{vouchers = {'v_telescope', `v_observatory', 'v_planet_merchant', 'v_planet_tycoon'}, consumable_slot = -1}'''``` is the code now
dim steeple
rare bobcat
frosty dock
#

wait you're trying to change the config of nebula deck?

rare bobcat
#

Yes

orchid thunder
#

Lol

#

Isn't that what override is for

frosty dock
#

you don't need lovely patches to do that

orchid thunder
#

Or ownership

rare bobcat
#

frosty dock
#

like you literally just do

rare bobcat
#

I will use my headphone cord as a whip on somebody

zenith ridge
#

I feel like I've totally done and I still need to make the art.

frosty dock
#
SMODS.Back:take_ownership('nebula', {
  config = {
    vouchers = {...},
    consumable_slot = -1,
  }
})
rare bobcat
#

Toml or lua for that

orchid thunder
#

Lua

frosty dock
#

lua

#

straight into your mod's main file

orchid thunder
#

So - 1 file for that

frosty dock
#

I should pay attention to other stuff going on next to what I'm working on some of the time

rare bobcat
#

Would this also do the thing I want to do with the fool or is lovely patches what I do for that

dim steeple
frosty dock
#

i could have told you an hour ago how to do what you were trying to do if I were paying attention

frosty dock
rare bobcat
#

Still isn’t working

rare bobcat
#

I forgot that I was doing this to put off the laundry I needed to do

#

That will take 5 minutes

whole jungle
#

Is there any documentation on how to write a toml patch?

frosty dock
whole jungle
#

Thanks

ionic verge
#

is there a way to detect a blue seal triggering?

frosty dock
#

easiest would be to patch into Card:get_end_of_round_effect()

rare bobcat
ionic verge
#

this is what im trying to do

frosty dock
#

oh that one you can actually take ownership of blue seal i think?

ionic verge
#

mhm?

#

how would i do that

#

cus i havent taken ownership of anything yet

rare bobcat
frosty dock
#

hm actually you'd have a hard time telling whether the blue seal filled up your slot or if they were already full to begin with

#

so maybe you do patch get_end_of_round_effect

ionic verge
#

ok how do i do that

frosty dock
#

you look at the code for blue seal, find a (preferably unique) target that you can use for your patch, and go from there

ionic verge
#

no like
how do i make a patch

rare bobcat
ionic verge
#

i dont know how to do that

rare bobcat
#

Not working whatsoever

frosty dock
frosty dock
ionic verge
#

i see

rare bobcat
ionic verge
#

thanks!

ionic verge
frosty dock
ionic verge
#

or is updating yesterday good enough for that

rare bobcat
#

Ah

frosty dock
#

updating yesterday is not good enough for a feature that was just merged

#

so yes you'll have to update

rare bobcat
#
  config = {
    vouchers = {'v_telescope','v_observatory','v_planet_merchant','v_planet_tycoon'},
    consumable_slot = -1,
  }
})``` any help on this not working?
weary jungle
#

newer calc

rare bobcat
#

It isn’t

#

Oh yeah the header

#

I forgot to add that back in

frosty dock
#

okay then anything but that code is the issue

frosty dock
#

headers are not cool

rare bobcat
#

I was just about to ask how the fuck to do that

#

Thanks

nova finch
#

im trying to upgrade Xmult and destroy the discarded cards if the first discard is a two pair
it upgrades Xmult but doesn't destroy the cards
can anyone help?

solar eagle
#

with an enhancement, what would cause the game to crash with card.lua:256: attempt to index local 'center" (a nil value) when applying?

        for i = 1, #G.hand.highlighted do --flips cards
            local percent = 1.15 - (i-0.999)/(#G.hand.highlighted-0.998)*0.3
            G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.15,func = function() G.hand.highlighted[i]:flip();play_sound('card1', percent);G.hand.highlighted[i]:juice_up(0.3, 0.3);return true end }))
        end
        delay(0.2)
        for i = 1, #G.hand.highlighted do --enhances cards
            G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function() G.hand.highlighted[i]:set_ability(G.P_CENTERS[card.ability.consumeable.mod_conv]);return true end }))
        end 
        for i = 1, #G.hand.highlighted do --unflips cards
            local percent = 0.85 + (i-0.999)/(#G.hand.highlighted-0.998)*0.3
            G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.15,func = function() G.hand.highlighted[i]:flip();play_sound('tarot2', percent, 0.6);G.hand.highlighted[i]:juice_up(0.3, 0.3);return true end }))
        end
        G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2,func = function() G.hand:unhighlight_all(); return true end })) --unselects cards
        delay(0.5)
    end```
this is the code that applies the enhancement, which i believe is ok since i took it from the base game's src
solar eagle
#

give me a sec

frosty dock
#

it only works for context.discard iirc

solar eagle
#
if card.ability.name == 'Glass Card' then 
  card:shatter()
else
  G.hand.highlighted[i]:start_dissolve(nil, #G.hand.highlighted)
end
end```
should work in theory
frosty dock
solar eagle
#

nope

#

mod_conv = "TWT_luckshit",

#

and the key is defined as "luckshit"

#

do i need to define a name?

frosty dock
#

m_TWT_luckshit

solar eagle
#

well

#

TWT is the prefix

#

OHH

frosty dock
#

centers have a class-specific prefix

solar eagle
#

i see

#

thank you!

frosty dock
rare bobcat
#
    "id": "QOL",
    "name": "QOL",
    "display_name": "QOL",
    "author": ["QOL"],
    "description": "QOL",
    "prefix": "QOL",
    "main_file": "qol.lua",
    "priority": 0,
    "badge_colour": "#000000",
    "badge_text_colour": "#FFFFFF",
    "version": "0.0.1",
    "dependencies": [],
}
SMODS.Back:take_ownership('nebula', {
  config = {
    vouchers = {'v_telescope','v_observatory','v_planet_merchant','v_planet_tycoon'},
    consumable_slot = -1,
  }
})``` should work, right?
#

or is something tweaking

solar eagle
frosty dock
frosty dock
rare bobcat
#

so it's 2 different files?

#

i feel like i'm missing something

frosty dock
#

yes, the json is just for the metadata

rare bobcat
#

So like <head> in html

frosty dock
#

qol.json

{
    "id": "QOL",
    "name": "QOL",
    "display_name": "QOL",
    "author": ["QOL"],
    "description": "QOL",
    "prefix": "QOL",
    "main_file": "qol.lua",
    "priority": 0,
    "badge_colour": "#000000",
    "badge_text_colour": "#FFFFFF",
    "version": "0.0.1",
    "dependencies": [],
}

qol.lua

SMODS.Back:take_ownership('nebula', {
  config = {
    vouchers = {'v_telescope','v_observatory','v_planet_merchant','v_planet_tycoon'},
    consumable_slot = -1,
  }
})
solar eagle
#

how would i display little bubbles alongside a card if it has an enhancement? like how the wheel of fortune displays foil, holographic, polychrome etc

rare bobcat
#

It works

solar eagle
#

is that the info_queue segment?

frosty dock
#

yeah

#

e.g. info_queue[#info_queue+1] = G.P_CENTERS.e_polychrome adds an info box with the description of the polychrome edition

solar eagle
#

can i define a custom one?

sturdy compass
#

Not entirely sure why but this does not seem to be patching in. Not getting any indication in console that it's failing either

ionic verge
#

is high or low numerical priority higher priority? (if that makes sense at all)

sturdy compass
frosty dock
sturdy compass
#

I have a debug message in that patch that's not firing off when it should. Unsure where/how to get a dump with patched smods files

frosty dock
#

dump would be at lovely/dump/SMODS/_/src/game_object.lua

sturdy compass
#

I do not have that folder then

frosty dock
#

oh wait that target isn't right

#

you're missing an = at the start

sturdy compass
#

within the quotes?

frosty dock
#

'=[SMODS _ "src/game_object.lua"]'

#

yes

sturdy compass
#

gotcha

#

Aight that did it. Thank you john smods

ionic verge
#

so...
what exactly should i be patching of the blue seal code to add the ability for it to level up hands directly

#

my first thought is to replace the if statement to also check for blue seals + full consumable slots, then throw a bone to my joker so it can do its magic

last mirage
#

your goal is for blue seals to level up hands directly rather than generating planets?

ionic verge
vagrant cedar
#

I think officially made the worst Joker in Balatro

ionic verge
#

can i kill him? do i have permission to grab the ceremonial dagger and put him next to it?

last mirage
ionic verge
#

mmmm

last mirage
#

just to avoid changing anything I don't have to

ionic verge
#

fair

#

so what's the bone id throw to my joker?

#

some kind of context?

#

or would i have to patch in something else to do that

last mirage
#

tbh I've just been looking into balatro modding as of the last 5 minutes 🤣

ionic verge
#

i see

#

how hard would it to set up a new context to use

#

and how worth while would it be to use that to detect when a blue seal is there but not able to create a planet card over other potential methods im not yet aware of

sturdy compass
#

Alright new weird issue. After updating SMODs this joker stopped working. This worked just fine a couple weeks ago and I guess it stopped recently. I put a debug message under the contexts and it didn't fire, so my guess is something changed with the retriggering contexts?

frosty dock
#

SMODS.current_mod.optional_features = { retrigger_joker = true }

sturdy compass
#

Ah how about that

ionic verge
vagrant cedar
frosty dock
#

should work just fine for this

ionic verge
#

is that in the utility functions page on github?

frosty dock
#

there's no complete docs on better calc features as of yet

ionic verge
#

mhm

#

just wanted to know how to set it up without imploding

frosty dock
#

i think the only trap you could run into is having your context trigger checks for a different context

ionic verge
#

mhm

frosty dock
#

but that's fairly easy to avoid by just making sure the context is different from anything that already exists

ionic verge
#

so do i just establish a context.thing = true ?

#

this is what ive got so far

frosty dock
#

what's initSteamodded doing here

ionic verge
#

oh its not needed?

#

just thought it was important bc of the example thing over at lovely's github

frosty dock
#

no that's just the patch steamodded uses to plant itself into the startup routine of the game

ionic verge
#

mhm

#

got it

frosty dock
#

duplicate calls of it probably make the game implode

ionic verge
#

noted

frosty dock
#

I'd go for something like this

[[patches]]
[patches.pattern]
target = 'card.lua'
match_indent = true
position = 'before'
pattern = '''if self.seal == 'Blue' and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit and not self.ability.extra_enhancement then'''
payload = '''if self.seal == 'Blue' and #G.consumeables.cards + G.GAME.consumeable_buffer >= G.consumeables.config.card_limit and not self.ability.extra_enhancement then
  SMODS.calculate_context({ blue_seal_failed = true, card = self })
end'''
ionic verge
#

oh so indent does actually matter

frosty dock
#

forgot a thing there, oops

frosty dock
weary jungle
#

how do i get a random number between 1-3?

frosty dock
#

indent matters in that match_indent is a required field for pattern patches

ionic verge
#

'match_indent = true'

frosty dock
#

you can use match_indent = false but it probably makes your dumps look ugly

#

i use it sometimes when I have to work around not being able to outdent

ionic verge
frosty dock
#

nvm it doesn't work exactly like math.random it needs both a min and a max

ionic verge
frosty dock
#

yeah

#

usually you want contexts you add to have your mod prefix in some form, just to avoid overlaps with other mods

ionic verge
#

i seeeee

#

makes sense

#

thanks for the help!

weary jungle
#

i have so much more dialog to write 😭

urban veldt
#

How hard would a Joker effect of "first hand of the round using Plasma Deck scoring" be?

weary jungle
#

probably pretty easy

#

maybe

#

this is a calculate moment

merry raven
#

"I could feel it in my potassium" 🔥 ✍️

frosty dock
#

context.final_scoring_step for plasma deck timing

#

then just check for first hand of round, idr what the exact G.GAME value is for that

urban veldt
#

Imma plan my mod out and then just do what's achievable

#

Hopefully I'll get all of it

ionic verge
#

well its kinda working, the joker does indeed make blue seals directly upgrade it when full

#

just

#

leaves a trace behind

#

heres the code

weary jungle
#

update_hand_text?

ionic verge
#

how

weary jungle
#

idk

frosty dock
#

🤔

#

not sure if this is weird timing or if steamodded isn't handling level ups correctly

ionic verge
#

well i think the main thing is its happening during end of round

#

when there's no hand displayed

#

kinda

#

also retriggering the card isnt copying the blue seal trigger

#

(like via mime)

true quarry
#

ok i'm super confused after a while of trying to work the card skin template mod, how do i do this

#

it keeps failing to load and gives me this error and i've tried to understand what i'm doing wrong but i don't know code well enough to figure this out myself

#

i've tried naming things in a billion ways and i also don't get what "prefix_key" means and that's probably part of it

placid frigate
#

how can i make a challenge to appear in the challenge section, I believe I have everything correct

random sleet
#

you might be able to return {extra = {func = function() update_hand_text(...)}, card = card, level_up = true, message = ...}

leaden wren
#

pretty happy with these so far
think the green on the left is a bit too saturated though

true quarry
leaden wren
#

there's frameworks to do it in a much easier fashion

#

that's probably more digestible

#

look into Malverk

#

this is the entire code for a malverk skin, for example

true quarry
#

dang that looks a lot simpler, where would i find malverk

leaden wren
true quarry
#

thanks a bunch

leaden wren
#

i don't entiiiirely understand how you use it to only overwrite one joker but you should be able to find a mod that does so somewhere in the discord

#

then just crib what it does

#

(if that's what you're trying to do, of course)

true quarry
#

also i assume overwriting one joker would just be pasting all the vanilla textures and then ur 1 edited joker on a sheet or something

#

though idk how that'd interact with other mods because i don't do this stuff often lol

leaden wren
#

not sure, i'd guess that it's moreso just putting it on the same place in the sheet then leaving the rest transparent

#

looking through the wiki quick

true quarry
#

where do u find the wiki, i should take a look at it too

leaden wren
#

there's none for malverk, i was looking at the smods wiki
but it turns out malverk isn't the right mod for this slydog

#

there's an Example folder on this mod page on how to make it compatible

true quarry
#

ahhh i see malverk is for the other stuff then, got it

#

i might still end up using it though at some point so that's fine

leaden wren
#

oh wow this one is Simple

#

so your mod directory should probably look like

assets
-1x
-2x
skins
-(your skin lua)
info.json (for steamodded)
#

and that should be it

#

of course, this is just me looking at the examples

true quarry
#

i am so glad people smarter than me made tools for this lmao, thank u again

clever bear
#

Is there a way I can make a suit skin change the name of the suit its over? I.E. King or Hearts -> King of [Skin]

wooden nexus
#

idk

tender gale
#

My question still remains, what is a simple way to program a Joker that lets Ace Straights wrap around

whole jungle
#

Do I have to override the function if I'm changing something in SMODS?

whole jungle
true quarry
#

so i've run into another issue this time lol

leaden wren
#

slightly changed it
funnier this way, i think

true quarry
#

deck skins lite crashes on startup if there's any lua files in the skins thing at all, even the examples

tender gale
leaden wren
true quarry
leaden wren
#

screenshot?

whole jungle
# tender gale Idk how to do that

No worries. I'm asking to see if it's possible to patch it with a toml file or if you have to override the function because I'm modifying that exact same function

leaden wren
#

that sounds like you didn't provide a value

true quarry
#

i also checked the readme for help but beyond changing the name it's not workin'

leaden wren
#

oh wait

#

are you trying to put them in deckskinslite's directory

#

you want them to be in their own mod

true quarry
leaden wren
#

e.g.

mods
-yourmod
--assets
--info.json
--skin
#

or whatever

#

i'm p sure

whole jungle
#

Anyone know if it's possible to write a patch for another mod's function, and if so, how you would do that?

true quarry
leaden wren
#

not sure of anything else

whole jungle
#

Won't take ownership just let me modify the properties on another GameObject?

#

I really just need to change one line in a function used by SMODS

leaden wren
#

not entirely sure then
that's just what i saw come up skimming through the docs

whole jungle
#

I don't want to have to change the whole function if I can help it, but I will if I need to

leaden wren
#

@frosty dock sorry for the ping if you're not the right person to ask
but minor bug
steamodded seems to handle negative money in calc_dollar_bonus visually fine, EXCEPT when numbers get so large that it turns to just actual values

#

(actually, should probably have filed this as a git issue...
eh, already pinged)

wintry swallow
#

a snippet of the most crackhead code i have ever written

tender gale
#

Is it okay to use code from other mods as reference if they have done something similar to your idea

leaden wren
#

this is the only source on it

#

so if you're copying an entire joker, you probably want to ask ahead

#

but if you're copying a function or whatever

#

something small

#

you're almost certainly fine

tender gale
#

Yeah that's what I meant

leaden wren
#

that's OSS babey

whole jungle
tender gale
#

I mean it'd be easier if I knew which file in Balatro contains the actual code for shortcut

#

It seems to be one of the most complicated Jokers if its effect is scattered throughout like ten different files

whole jungle
#

Do you have your environment setup?

tender gale
#

What does that mean (Sorry if this question sounds dumb)

whole jungle
#

The function you're looking for is get_straight in src/overrides.lua in SMODS and functions/misc_functions.lua from lovely

#

But, if you haven't downloaded those two yet, you won't find them 😛

tender gale
#

I have them both, I've already begun coding my mod, it's just this Joker I'm trying to make

whole jungle
#

The SMODS override rewrites the function, though, so... you'll probably have to rewrite it, too :/

#

Either that, or take ownership of the _straight PokerHandPart and add another check to that for a wrap-around straight

tender gale
#

Okay, I think this is too advanced for me

#

I've literally just started trying to make a mod, thanks for the help tho

whole jungle
#

A wrap-around Straight is... harder than an average mod

cerulean rose
wintry swallow
#

im smoking on that abusing the parser shit

whole jungle
tender gale
#

so if I do get around to making it, would I use Pokerhandpart or get straight function?

whole jungle
#

If you want the easy way to do it, just copy the get_straight function and remove the line of code that's stopping wrap-around if you have your joker

tender gale
#

Which part stops wraparounds, also, will it work if I copy the function from Overrides

leaden wren
#

considering shortcut seems to be baked in the solution is gonna be hacky no matter what

tender gale
#

So I've written local can_wraparound = next(find_joker('tes_mobius')), now I need to find how to make it wraparound

whole jungle
tender gale
#

I'm assuming it's line 191

whole jungle
#

Yeah. I think that line stops the search if you hit the last value in the list of ranks without finding a straight

#

I'm not a Lua dev, so I'm really stretching my programming knowledge, lol

tender gale
#

I just wrote some nonsense so i'll boot up balatro to see what the code doesn't like about it lol

#

Ok it worked up until I tried to discard a card

#

I mean i didn't manage to test if the function worked, it just didnt crah until then

whole jungle
#

Nice. It's always nice having things worrk until they don't!

tender gale
#

I found the problem, I wrote find.card instead of find_card

#

so far every mistake I've made has usually been some spelling error

#

I'm bad at typing lol

whole jungle
#

That does tend to be most of the errors for me, too

#

I'm too used to IDEs that stop me from making mistakes

tender gale
#

ok that wasn't it

#

It doesn't consider it a straight yet

#

judging by the shortcut and four finger code I'll have to add something, I just don't know what

whole jungle
#

No, removing that line isn't going to fix it. It'll need to have the ranks reset back to the original after that

#

Oh wait, maybe it should

cerulean rose
whole jungle
#

It's not a bad change, but it sadly doesn't work for me. I'm looking to add in a card that's any other type of card, and I had to rewrite the function to accommodate Rank wilds.

wintry swallow
#

i'm so sad that require doesn't work in smods mods

whole jungle
#

I also had to fix the hand thing to show as Royal Flush

tender gale
#

I'm gonna give up

wintry swallow
#

how does smods priority work actually

tender gale
#

not worth the effort

whole jungle
random sleet
#

looking for feedback from ppl better at math if this is too strong at X1.5 for an uncommon
(art by lyman tamariPlush )

tender gale
#

If you had 100 chips, then it would set that to 60 and gain 60 mult

#

I would say yes, definitely

random sleet
#

hmmmm

whole jungle
#

It's kinda like the one deck, but way less strong

random sleet
#

technically this is stronger than plasma

#

i think

tender gale
#

well with this, if you had 300 chips and 1 mult you would end up with 180 chips and 121 mult

whole jungle
#

Is it? You need to have a Chips build, and Chips builds are inherently less strong

tender gale
#

with plasma, you would have 150 chops and 150 mult, which I think is better

whole jungle
#

But, it does provide another avenue to make a chips build work

tender gale
#

yeah plasma is slightly better, but comes with x2 blind size

#

so this is OP

whole jungle
#

Yeah, but you go for mult builds with plasma

#

And the halving is done at the very end, which is a major contributer to it being strong

random sleet
#

you can put xmult jokers aftet this effect too tho

whole jungle
#

Buuut, being that it's a deck, maybe it is too strong

#

I assume this applies after card enhancements and hand effects, though?

random sleet
#

it applies on the joker

carmine burrow
tender gale
#

That's more confusing

carmine burrow
tender gale
#

and techincally wrong

random sleet
whole jungle
#

It's strong, stronger than most jokers. Maybe just lower it to converts chips to mult at a 1:1

random sleet
#

it just applies to its own mult

carmine burrow
#

ah

tender gale
#

What if it turned 50% of chips into mult at a 1x rate?

random sleet
#

other joker number changes work probably too

tender gale
#

And what if it gave x2 blind size to nerf it?

#

And what if it was a deck... oh wait

carmine burrow
whole jungle
#

So, basically, it does the Plasma effect

random sleet
#

ohoho no, thats not plasma deck, its transfusion!

tender gale
#

What if there was a red herring joker that just said +1 Joker slot

carmine burrow
carmine burrow
whole jungle
#

Also gives you something to sell for that one Boss Blind

tender gale
#

I only ever get violet vessel

carmine burrow
tender gale
#

the run killer

glass scaffold
#

is there example code for Hiker for modding?

carmine burrow
#

it seems like it just increases the other card's ability.perma_bonus by 5

tender gale
#

Hiker actually seems pretty simple

carmine burrow
#
        elseif context.individual then
            if context.cardarea == G.play then
                if self.ability.name == 'Hiker' then
                        context.other_card.ability.perma_bonus = context.other_card.ability.perma_bonus or 0
                        context.other_card.ability.perma_bonus = context.other_card.ability.perma_bonus + self.ability.extra
                        return {
                            extra = {message = localize('k_upgrade_ex'), colour = G.C.CHIPS},
                            colour = G.C.CHIPS,
                            card = self
                        }
                end
tender gale
#

If I finish this mod, I might get round to making the ZOdiac one

nocturne garnet
carmine burrow
wintry swallow
#

smells like incorrect behaviour

carmine burrow
#

i thought that in most lua oop libraries you'd use something like c_number.super.__new(self, v)

#

instead of self:super(v)

wintry swallow
#

nah, this is my own

carmine burrow
#

makes sense

carmine burrow
#

or self.super i would assume is the same

wintry swallow
#

oh that's a special value

wintry swallow
carmine burrow
#

wow

wintry swallow
#

self.super doesn't exist outside of the constructor

carmine burrow
#

i love lua

wintry swallow
#

i love lua so much

#

i need a proxy object here, actually

#

maybe even two

#

the weird functions (_unpack et al) are to maintain compatibility with every version of lua past 5.0 (which introduced metatables, which this uses to great effect)

carmine burrow
#

scary language imo. like at first i was like "wow this is really convenient and intuitive" and then every time i try to figure out how it works on a deeper level it's just The Horrors idk

#

javascript core

wintry swallow
#

the horrors are the best part of it

#

python actually enables much worse horrors but i don't know it

#

or well i do know python but i don't know the horrors

carmine burrow
#

i have heard that that's the case

tender gale
#

As someone who has just begun modding (and coding, really) I have no opinion on lua

wintry swallow
#

lua is fucking great

#

hands down my favourite language

wintry swallow
tender gale
#

ok anyone know how I would make a joker than turns scoring wild cards polychrome

wintry swallow
#

extremely normal thing

#

uh can't you like

#

hmm

#

i'd look at scary face here

carmine burrow
#

to check if a card is a wild card i think you use c.ability.name == "Wild Card"

#

and to turn a card polychrome i think you use c:set_edition({ polychrome = true })

#

where c is the card you want to modify

wintry swallow
#

yeah not scary face

#

midas mask

#

sorry

tender gale
#

ok thanks, i'll try it

carmine burrow
# carmine burrow i'd look at midas mask

what midas mask does is it first counts up all of the face cards and stores them in an array, does nothing if the array is empty, and iterates through everything otherwise

#

that way it can display the thing that says "Gold" only when it actually does anything

tender gale
#

so I've got this here, do I wrap it in a calculate function? If so the context should be card scored right

carmine burrow
#

it does the effect inside the loop

carmine burrow
#

do you want it to happen at the moment the card is scored?

tender gale
#

I want it to be like midas mask in that sense

carmine burrow
#

alright

tender gale
#

so (self, card, context.before)?

carmine burrow
# tender gale so (self, card, context.before)?

i think you'd do

calculate = function(self, card, context)
  if context.before and not context.blueprint then
    local wilds = {}
    for k, v in ipairs(context.scoring_hand) do
      if v.ability.name == "Wild Card" then
        wilds[#wilds+1] = v
        v:set_edition({ polychrome = true }, true)
        G.E_MANAGER:add_event(Event({
          func = function()
            v:juice_up()
            return true
          end
        }))
      end
    end
    if #wilds > 0 then
      return {
        message = localize('something or other'),
        colour = G.C.DARK_EDITION,
        card = self
      }
    end
  end
end
wintry swallow
tender gale
#

Thanks!

carmine burrow
tender gale
#

Nah I think its funny

carmine burrow
#

alright

random sleet
carmine burrow
tender gale
random sleet
#

its so slightly different i love it

merry raven
#

Where in the source code does it render the crystal thingy for the Soul card

#

I want to try the sprite overlay effect like it has

tender gale
merry raven
#

Oh damn that easy?

tender gale
#

yes

merry raven
#

What if I want to change the soul sprite mid-game? I plan for my Joker to change it whenever a certain condition is met

sturdy compass
#

I have tried to change the soul sprite mid-game via changing atlas coordinates, but for whatever reason it doesn't change until the entire card stops rendering

merry raven
#

Man

sturdy compass
#

My guess is Thunk never expected the soul sprite to change and therefor doesn't have a handler in vanilla to update the sprite frame by frame

random sleet
#

if you change pos or soul_pos it changes for every instance of that joker btw ( god i love pointers and references )

sturdy compass
#

wonky

random sleet
#

and yea once a sprite is readied for a card its left as-is, you have to handle that

merry raven
#

Wack

sturdy compass
#

I’d imagine it wouldn’t be too tricky to implement a handler for that, you’d just have to dig for where that soul rendering code is to begin with

merry raven
#

So who wants to be the first to invent proper soul sprite swapping

orchid thunder
#

How can I ha e an update run every second

#

I want to do something every second until I tell it not too

sturdy compass
#

I’d recommend taking a look at Cryptid’s code, specifically Jimball or The Clock. I have an implementation of it for my own uses as well but I currently do not have access to it

leaden wren
#

hmmm
trying to brainstorm how to add all broken cards back to deck

#

something something
if context.cards_destroyed then
add_card yadda yadda

#

but i don't know how to actually retrieve what just broke

leaden wren
#

Lobotomy Corporation (mod) does a version of it

sturdy compass
#

All being every destroyed card in a run or in a hand?

leaden wren
#

Price of Silence updates and plays every second

leaden wren
#

when it gets destroyed

#

i'm just not sure how to retrieve that

sturdy compass
leaden wren
#

ah, so just accumulate that to 1000

sturdy compass
#

Actually just 1 since dt is a float value

leaden wren
#

okay that's something

#

now to learn what that colon actually means in a broader sense

#

so i can get the full card's details

#

and add it as a thing

sturdy compass
#

The colon signifies a function the object class can execute

leaden wren
#

okay it just means it's adding itself as the first parameter

#

so it's effectively calling get_id(other_card)

sturdy compass
#

Yep

leaden wren
#

but that's happening in that context

#

i think i get it

#

now to find where in the documentation i can look at the list of permissible outputs...

sturdy compass
#

If it helps, context.cards_destroyed is a table of all cards that are to be destroyed

#

Or one of the contexts that has to do with destroyed cards, I forget if that’s the correct one

#

Check the Joker Calculation page on the SMODS wiki, I’m positive the correct one is listed there

leaden wren
#

i really want it to be this easy but i just know it's not going to be

sturdy compass
#

Ok I was right, context.cards_destroyed is a table/array of all cards that are to be destroyed. You could probably loop through that to get the cards back

leaden wren
#

this is the behavior i could least expect possible

#

like what

sturdy compass
leaden wren
#

It works
*kind of
*once

zenith ridge
random sleet
zenith ridge
random sleet
#

its undertale font idk

zenith ridge
#

Yeah, the uh name of that font.

#

I accidentally was referring to a different font Undertale used. 🤦‍♂️

random sleet
zenith ridge
#

It's neat that you were able to do that.

leaden wren
#

...okay, huh

#

this isn't doing anything

#

like, there's no log output when i destroy cards

#

Literally Forgot To Give Myself The Joker

violet void
leaden wren
#

...does glass_shattered not actually mean shattered glass cards?
this game eludes me.

crisp coral
violet void
crisp coral
#

💥

violet void
leaden wren
#

hmmm

#

won't it always return true

#

if not (X)

#

it's not perishable
so it isn't not perishable
so it, itself, counts

crisp coral
#

context.other_joker.config.center.key to see what it is

leaden wren
#

or am i insane

crisp coral
leaden wren
#

okay ic

#

god figuring out this card destroyed thing is gonna be the death of me

violet void
#

or can I just type "Egg"

crisp coral
violet void
#

Anyways ive figured out the issue

It kept activating because it had xmult as ability, I changed it to extra (like baseball)

leaden wren
#

...okay, apparently i was supposed to use these

#

okay, i think i get it now
now to figure out how to add it to deck

sturdy compass
#

I’d say for every iteration of the loop, do local new_card = v:copy_card(parameters) and do the typical add and emplace cycle from there

leaden wren
#

...huh, i thought copy_card would add it to hand but reading it seems more like it just returns an actually digestible version of that card?

random sleet
#

it just makes a new card object based on the old one iirc

#

so you then can add_to_deck and emplace it somewhere

leaden wren
#

huh, i was gonna use table.insert and just call it there

#

it's hard to read this game's code
grah

#

oh right i need to initialize it with add to deck or something

#

i miss SMODS.add_card now i actually have to figure things out

#

(since add_card seems to only work for non-"cards"), like tarots and jokers

fair comet
#

guys why doesn't overriding the localisation with take_ownership work properly 😭

SMODS.Consumable:take_ownership(
    'lovers',
    {
        loc_txt = {
            ['default'] = {
                name = 'The Lovers',
                text = {
                    "Enhances {C:attention}#1#{}",
                    "selected cards to",
                    "{C:attention}#2#s",
                }
            }
        },
        config = {
            mod_conv = 'm_wild', 
            max_highlighted = 2
        }
    },
    true
)
sturdy compass
#

loc_vars?

fair comet
#

wouldn't that use the default ones if I'm not overriding it?

leaden wren
#

not that i know of

#

loc_vars is what corresponds the positions of #1#, etc

#

to actual variables

#

so that you could, for example, insert game variables like odds base

sturdy compass
fair comet
#

I thought it would just use the config I provided since I'm changing the config

#

this is default loc_vars = {_c.config.max_highlighted, localize{type = 'name_text', set = 'Enhanced', key = _c.config.mod_conv}}

sturdy compass
#

I’m actually not sure, but I think it’d be worth trying to re-input it

fair comet
#

alright trying it now

leaden wren
sturdy compass
# leaden wren hmmmm

You’re creating two different copies. You should be setting a local variable to hold the copy and then go through the process

leaden wren
#

just changed that

#

hmmm
do i need to change the emplace to G.emplace, or something?

sturdy compass
#

I’m not sure G.playing_cards is a valid area to emplace a card

leaden wren
#

oh wait, is that the hand

sturdy compass
#

No, I think that’s the info of the full deck

fair comet
# sturdy compass I’m actually not sure, but I think it’d be worth trying to re-input it

Still saying nil for both, did I do this correctly?

local new_config = {
    mod_conv = 'm_wild', 
    max_highlighted = 2
}

SMODS.Consumable:take_ownership(
    'lovers',
    {
        loc_txt = {
            ['default'] = {
                name = 'The Lovers',
                text = {
                    "Enhances {C:attention}#1#{}",
                    "selected cards to",
                    "{C:attention}#2#s",
                }
            }
        },
        loc_vars = {
            new_config.max_highlighted, 
            localize{type = 'name_text', set = 'Enhanced', key = new_config.mod_conv}
        },
        config = new_config
    },
    true
)
leaden wren
#

it's a start. i guess?

#

they're just sitting there now

#

hmmm

#

i'm just stealing most of the code from marble joker

sturdy compass
fair comet
#

no worries

#

I'll keep trying things

sturdy compass
#

Best of luck

sturdy compass
leaden wren
#

god do i wish steamodded had a function for this

#

(no flak i'm just confused lmao)

fair comet
# sturdy compass Best of luck

I got it working, didn't know loc_vars had to be a function

SMODS.Consumable:take_ownership(
    'lovers',
    {
        config = {
            mod_conv = 'm_wild', 
            max_highlighted = 2
        },
        loc_txt = {
            ['default'] = {
                name = 'The Lovers',
                text = {
                    "Enhances {C:attention}#1#{}",
                    "selected cards to",
                    "{C:attention}#2#s",
                }
            }
        },
        loc_vars = function(self, info_queue)
            info_queue[#info_queue+1] = G.P_CENTERS[self.config.mod_conv]
            return { 
                vars = {
                    self.config.max_highlighted, 
                    localize{type = 'name_text', set = 'Enhanced', key = self.config.mod_conv}
                },
            }
        end
    },
    true
)
sturdy compass
#

Ah there ya go

fair comet
#

thanks for the help 🙂

leaden wren
#

i mean. i can move them around now?

#

i think this is actually working though?

#

they're getting destroyed and immediately recreated

#

they're just not uh. moving to the deck

#

GOD IT'S WORKING

#

for anyone message searching how to add cards to deck, destroyed cards or otherwise (since it's hard to find)

  calculate = function(self, card, context)
    if context.remove_playing_cards then
    
      sendWarnMessage('card destroyed', 'muuyo')
      for i,v in ipairs(context.removed) do
        G.E_MANAGER:add_event(Event({
          func=function()
          sendWarnMessage(inspect(v), inspect(i))
          card.ability.extra.resurrected = card.ability.extra.resurrected + 1
          local copied = copy_card(v)

          -- here's where the deck shenanigans happen

          copied:add_to_deck()
          G.deck.config.card_limit = G.deck.config.card_limit + 1
          table.insert(G.playing_cards, copied)
          G.deck:emplace(copied)

          play_sound('myo_greenzwin')
          return true
          end
        }))
      end
    end
  end
#

you want this

sturdy compass
#

Huge

merry raven
#

That is huge

wintry solar
#

Pretty sure you can just use SMODS.add_card right?

wintry swallow
#

the shit i do for balatro

#

i wrote this library to make writing my own mods easier

#

but uh hey that's like

#

real object orientation

#

in lua

crisp coral
#

real

wintry solar
#

What’s the need for this?

wintry swallow
#

mostly making it much easier on me to build custom systems

#

i don't expect anyone else to use it within balatro though it is a very useful tool for general use in lua

random sleet
#

doesnt smods already provide this

#

you can just make something that extends SMODS.GameObject

wintry swallow
#

not sure, but it's lua 5.4 compatible so i can take it outside of smods and make whatever i want with it even outside of balatro

random sleet
#

i guess

#

were i at home id show the code for joker Stamps

#

you can just make a new kind of SMODS object and register them like Jokers or Consumables or Seals or whatever

wintry swallow
#

that's neat that this scaffolding is already in smods

random sleet
#

yea i havent had much experience making whole new systems because im lazy

#

but its totally doable

rough furnace
#

also balatro has an object system built in it uses

#

however baaltro also has a ui system but that didn't stop me from making my own

random sleet
#

ok but like the balatro ui system

#

nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].

rough furnace
#

thats only if your modifying the ui

#

if your making stuff from scratch it's fairly reasonable

zealous glen
#

I think it has some auxiliary functions too

#

Like adding a child to a node

rough furnace
#

Should document that

wintry swallow
#

no other language lets me get this level of fucked up, except maybe python my girlfriend's been telling me a lot about python's metaprogramming capabilities

zealous glen
#

I think that it’s also easy to visualize in one’s head what the UI is going to look like just from its construction

rough furnace
#

writing things from scratch is a great way to understand how they work, can recommend

rough furnace
#

Making my own ui system made me have a lot of respect for how well thunks ui works. Like sure the code is a bit messy but it's super stable, flexible and looks and feels quite good

wintry solar
#

Yeah there’s a lot of weird stuff in the code but what thunk has done is very impressive

rough furnace
#

I mean a system written, maintained and ysed by only one person is likely to have a bunch of werid quirks to outsiders

#

I bet there's a bunch if weird stuff in DebugPlus that just makes sense to me

frosty dock
frosty dock
frosty dock
zealous glen
#

I don’t know how you could do better with an arbitrary graph

frosty dock
#

elaborate

zealous glen
# frosty dock elaborate

With vanilla ranks you can aggregate different nodes in the graph per rank since each set of nodes only connects to the next and previous ranks

#

With quantum ranks, it could be anything so you’d have to walk on the full graph

frosty dock
#

I know, but what do you mean by lazy DFS

zealous glen
#

So it gives up instead of going on

frosty dock
#

so how do I know a path of the desired length is actually a straight? the bipartite graph of cards to ranks needs to have a matching with n edges for that to be the case

zealous glen
frosty dock
#

in what graph

zealous glen
#

The graph of cards

frosty dock
#

oh alright, I was looking at the graph of ranks

zealous glen
#

But you need to avoid cycles

#

Which DFS should already do

#

Also with the original graph you could cache results

#

But I’m not sure about the arbitrary graph. I think you should but I don’t quite see it right now

frosty dock
#

yeah I think I see where you're going

#

can't have it be lazy because it should find longer straights if they exist

#

so I find longest paths in each component of the directed graph of cards...

zealous glen
#

There are no longer Straights

frosty dock
#

if I'm looking for 5-straights, I'm allowing 6-straights

zealous glen
wintry solar
#

Surely it should look for X-straights where X is the number of played cards?

zealous glen
#

No it should look for (find_card(“j_four_fingers”) and 4) or 5-Straights

frosty dock
#

if I'm including 5-straights when four fingers, clearly I need to include 8-straights when no four fingers

stiff locust
zealous glen
stiff locust
#

well shit

wintry solar
#

And what about for mods that look to increase played hand size and add longer straight support? It makes sense to build the functionality in at a base level

zealous glen
#

It’s just an argument

frosty dock
#

no what I'm saying is this

zealous glen
#

lazy_dfs(depth)

frosty dock
#

I already need the functionality for 4 fingers

#

to look deeper

zealous glen
#

And I’m saying it’s just an argument

#

For how deep you go before you give up

stiff locust
#

am i interrupting something

frosty dock
#

well if there's no straight this long then you're not going to get that deep before there's nowhere else to go

zealous glen
#

what

zealous glen
stiff locust
#

that's not good is it

frosty dock
#

the only time it gives up at 6 is when there's already a 5-straight

#

at that point I'm going out of my way to not find the extra card

zealous glen
#

Exactly

#

No need to find the extra card if nothing begets it

#

just give up

frosty dock
#

that's now what I'm saying but okay

tender gale
#

how easy would it be to have a joker that checks if your played hand consists of one three and two unrelated cards and transforms them into that three? for example if you played ace of spades, four of clubs and three of diamonds, you would get three three of diamons

frosty dock
#

Also I think there's still some issues here. Like what cards a card is adjacent to changes depending on what rank it's acting as

#

like what if I have a (A,2) (3,4) (5,6) (7,8) (9,T)

#

yeah so one would have to make some weird splitting graph that separates outwards vertices by rank

zealous glen
zealous glen
#

Actually maybe not

#

The “rank” of a card is only important as whichever edges are used

#

So it’s like

#

Duck-typing

frosty dock
#

yeah but the incoming edge decides which outgoing edges you're allowed to use

solar eagle
#

with info_queue i've found the appropriate format in localization files, however i'm not sure how to define my own custom bubbles. how could i do this?
i looked at the chocolate die in cryptid and found this:

        elseif not center.added_to_deck then
            for i = 1, 10 do
                info_queue[#info_queue + 1] = { set = "Other", key = "ev_cry_choco"..i }
            end
        else
            SMODS.Events["ev_cry_choco"..center.ability.extra.roll]:loc_vars(info_queue, center)
        end```
though im not exactly sure what it is doing
maiden phoenix
solar eagle
#

i do not

#

i assume this is what i've been missing?

stiff locust
solar eagle
#

got it

#

and then how do i call it?

stiff locust
#

well the way cryptid does it is by concatenating a string

#

"ev_cry_choco1" is the first entry then it loops through every entry with the for loop

solar eagle
#

mhm

stiff locust
#

you can do it like that too, or you can do it by looping through a list with all the names of the localizations in it

solar eagle
#

and that key is just a reference to the localized object?

#

ohhh ok this makes sense

stiff locust
#

are you on the uh

solar eagle
#

pretty similar to what im used to

stiff locust
#

json metadata

#

or are you on the smods header

solar eagle
#

json metadata

stiff locust
#

and i'm assuming you're still using the loc_txt for stuff

solar eagle
#

yea

#

its what i saw in the docs

stiff locust
#

ok in the json file make a new value called dump_localization and set it to true

orchid thunder
#

How can I use a joker to stop all sounds

stiff locust
#

remove all your other content mods, then boot up balatro and close it again

maiden phoenix
#

In your mod, you can add a localization folder, with a default.lua file and put

return {
  descriptions = {
     Other = {
        new_desc = {
                name = "New Description",
                text = {
                    "This is my awesome description!"
...
solar eagle
#

yea i saw this

stiff locust
#

that will automatically dump localization for your mod to localization/dump

solar eagle
#

and then just each key corresponds to the loc_txt object

#

WTF THATS SO COOL

maiden phoenix
#

Yea

stiff locust
#

the auto dump is super nice for starting it

solar eagle
#

ill just do it manually tbh im particular about formatting and i dont have a lot

stiff locust
#

i think you should still do it with the auto dump

#

itll be faster and ensures you don't mess anything up

solar eagle
#

thats the fun part

stiff locust
#

alright suit yourself then

solar eagle
#

this is common

stiff locust
solar eagle
#

the cry- prefix?

#

ohh yea

#

Edition etc

stiff locust
#

the set is the group they're in yh

#

and make sure you remove all loc_txt from your mod when you're done

solar eagle
#

yep

stiff locust
#

yeah thats everything

#

although i should warn you

#

info queues are kinda big

solar eagle
#

wdym

stiff locust
#

especially when the joker gets an edition or a sticker

solar eagle
#

i know

#

i have to define a new edition i added

stiff locust
#

oh if you're only doing the one thing

maiden phoenix
#

If your object has a child with an info_queue too, all children info_queue will show up

stiff locust
#

you dont need to do any extra localization stuff

solar eagle
#

well because of how i've structured the edition, it needs info_queues

maiden phoenix
#

(This sound weird lol)

stiff locust
#

you can just put the center for the edition in

solar eagle
#

otherwise the box doesnt render properly cause there's too much text

stiff locust
#

oh yeah that happens sometimes

#

while i'm here i am having an issue

solemn crypt
#

im going to start modding balatro what text editor should i use? VS Code? Sublime text?

stiff locust
#

vscode with the lua plugin

solemn crypt
#

just the one named Lua right no others

stiff locust
#

that would be the lua plugin

#

you want the lua plugin

solemn crypt
#

ok cool thanks

#

i have everything set up should i just download another mod and look at its structure and how it does things and stuff?

solar eagle
#

thats what ive been doing

frosty dock
#

yeah that's a good start. you can also look at steamodded docs

solar eagle
#

cryptid has been pretty handy since it does so much though it structures things slightly differently from regular steamodded

solemn crypt
solemn crypt
frosty dock
#

can also recommend ortalab as a reference mod

stiff locust
#

and if you have any specific questions you ask here and wait for one of the bigger fish to help you with it

solemn crypt
stiff locust
#

like what would be the best way to check if the played hand contains three 7s in a row

solemn crypt
#

so i put everything (lik all the code) in the main.lua?

solar eagle
solemn crypt
#

or just stuf that executes when mod is opened

stiff locust
#

ive tried a lot of things that either have triggered on every hand, or on no hands, regardless of how many 7s they have

frosty dock
#

you can structure your mod into different files too, but just putting everything in one file works just fine starting out

solar eagle
#

yea

#

the way i've split it out is put the separate files in a src folder

#

then in the main lua, this:

for _,v in pairs(NFS.getDirectoryItems(path)) do
  assert(SMODS.load_file('src/'..v))()
end```
solemn crypt
#

where do i find the cryptid mod is it on nexus

solar eagle
#

github!

stiff locust
#

i just put everything in one file cause i cant be fucked with all the extra file shenanigans

solemn crypt
#

yea idk ig ill just do that at the start too and maybe ill start making more files but idk

frosty dock
#

it's fine so long as you don't have like 10k+ line files

solar eagle
#

how does one define localized variables for a localization file?

stiff locust
#

you need to put them in a specific area for them to do that

#

under misc and under v_dictionary in misc

maiden phoenix
solar eagle
#

misc where

stiff locust
stiff locust
solar eagle
#

and then how are they referenced?

stiff locust
#

i'll just get a screenshot hold on

solar eagle
#

ty!

solemn crypt
#

what mod shouild i use for debugging?

maiden phoenix
#

Loop trough the scored cards, if you got a 7 and the next one isn't you reset the count to 0, if the count reaches 3 or above then gg

frosty dock
#

for simple dict entries (that don't need changeable vars), you can just put them in misc.dictionary

#

and reference like localize('my_key')

stiff locust
#

the vars are like the

solar eagle
#

well thats the thing

stiff locust
#

loc_vars

#

so you write #1#, #2#, #3# in the localization entry

solar eagle
#

yea i know this part

stiff locust
#

to make the values show up in those places

solar eagle
#

the problem is that idk how to reference the variable i want, since its a property of the edition

#

and it can change

stiff locust
#

it should just use the base variable

frosty dock
#

well we can't tell you if we don't know what property you're referencing

stiff locust
#

unless the edition changes globally

worthy stirrup
#

my code crashes if the card is at the very right side, and the UI tab has no color

wintry solar
#

You can call the editions loc vars function and use that

solar eagle
#

by boss blinds, jokers, etc etc

frosty dock
#

chat am i cooked

maiden phoenix
# worthy stirrup

It's because of the G.jokers.cards[i+1], do #G.jokers.cards - 1 instead

worthy stirrup
#

isnt that just always the right most card?

maiden phoenix
#

If you reach your last card and check for G.jokers.cards[i+1], it will crash because it doesn't exists

#

#G.jokers.cards - 1 stops before the last card in the loop

solar eagle
#

or you could do #G.jokers.cards to check every single one

#

since lua arrays start at 1 for some reason

maiden phoenix
#

Seeing other_joker, I think they're trying to do something with the card on the right of the joker

frosty dock
#

what you should do is you assume you're incompatible if you're the rightmost

worthy stirrup
#

yea, blueprint

solar eagle
#

ahhhh

worthy stirrup
#

its just the blueprint thing

solar eagle
#

i mixed up who was who

worthy stirrup
#

the issue is still alive

maiden phoenix
#

Can we see the crash log?

worthy stirrup
#

oh yes, sure, my bad

solemn crypt
#

when i open balatro its doing this:
I have enabled developer mode i think i did the thing with the if not _RELEASE_mode and stuff and i have a few mods

stiff locust
#

oh my god

#

I've been doing get_id() == "7" this whole time

worthy stirrup
#

Okay, i fixed the crashing but not the color missing

stiff locust
#

it works now

#

does anyone know a base game sound (or custom sound) i could use for when a joker doubles probabilities

#

i think it'd be cool if it made a noise

#

actually wait

#

i've got the perfect sound

#

so how do I play a custom sound

worthy stirrup
#

does anyone know why this isnt giving the UI color?

wintry solar
worthy stirrup
#

fixed it

stiff locust
worthy stirrup
stiff locust
#

i'm assuming i drop it in sounds folder

#

is there any specific format or is it just anything common

stiff locust
#

a joker

wintry solar
#

You can add sound = ‘soundkey’ to the return table assuming you have a message

stiff locust
#

there is no return table on it

wintry solar
#

Sounds are generally .ogg format

stiff locust
#

it doesn't return anything

#

can i still put a return table in without it messing things up

reef bane
#

Could someone help me diagnose a game crash?

wintry solar
#

Can you ss the code?

#

I’ll take a look

reef bane
stiff locust
#

i want the sound to play when the 1 in 7 hits (yes it's hardcoded and that is intentional)

wintry solar
#

Okay cool, instead of card eval status text just return your message, colour and sound

stiff locust
#

okay

#

but i'm not gonna replace the nope cause thats when it fails

wintry solar
#

Oh replace that too

stiff locust
#

oh what why

wintry solar
#

I guess you don’t have to

#

Anyway, before the else put your return table

#

After you’ve adjusted the probabilities

solemn crypt
stiff locust
#

does it have any prefixes

#

do i include the file extension

wintry solar
#

Just your mod prefix

#

Have you defined the sound?

stiff locust
#

not yet

#

I should do that

#

how to

worthy stirrup
#

why is there two...

wintry solar
#
SMODS.Sound({
  key = ‘key pls’,
  path = ‘filename.ogg’
})```
stiff locust
#

noted

#

and i put the sound file in the sounds folder in my mod right

worthy stirrup
#

what is causing two of them

wintry solar
#

assets/sounds iirc

stiff locust
#

ohk

gilded narwhal
#

Deck idea: odd hands provide the chips for a mega-hand, and even hands provide the mult, which are then multiplied again after every even hand

#

And to counter balance that ludicrous scaling you would start at ante 9 or smth

stiff locust
#

i believe you're looking for the meme suggestions thread

gilded narwhal
#

Lol I'm gonna implement it anyway

#

It would be funny

worthy stirrup
stiff locust
#

okay first sound test

#

something went wrong

#

i fixed it

worthy stirrup
#

please, what in gods name is causing two UI's

frosty dock
#

why do you have card.ability.name = 'Blueprint'?

worthy stirrup
#

at the start? because thats the only thing that gives it the color

frosty dock
#

well then you're making blueprint give you its UI

#

also we can't have nice things, there's no negative indexing

stiff locust
#

the sound is not playing but everything else works

worthy stirrup
#

what do i do then

stiff locust
#

i defined it here

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

and here's where it is meant to play

return {
                                message = localize("k_probability_tm"),
                                colour = G.C.GREEN,
                                sound = "probability_tm"
                            }

with or without tsun_ at the start of the sound = argument it just plays the regular message sound

#

and i made sure the file's there and it works

#

and it's an ogg

frosty dock
#

it definitely needs the prefix

stiff locust
#

okay well the sound still won't play

wintry solar
#

What smods version are you on?

stiff locust
#

uhhhhhhhhhh

#

this one

frosty dock
#

yeah no

#

that's too old

#

sounds on calc returns are a better calc feature

wintry solar
#

People still developing on old calc smh

stiff locust
#

i'm still waiting for cryptid to go to better calc

frosty dock
#

not even old calc, that's old calc - 1 week

frosty dock
stiff locust
#

that's nice to know

frosty dock
stiff locust
#

i suppose I will leave this joker as it is here then

#

it'll work on better calc so i trust it

#

that means it's done

#

and apparently people gamble on like, boats

solemn crypt
#

do i need too open and close the game everytime i change something to test it or is there an easier way?

stiff locust
#

so they get international waters and international laws for gambling

worthy stirrup
#

okay, i just did this and it works fine

#
  loc_vars = function(self, info_queue, card)
    card.ability.name = 'Blueprint'
    return { vars = {card.ability.name == 'Blueprint' }, main_end = main_end
  }
frosty dock
solemn crypt
stiff locust
#

hold tab

viscid field
#
ID = "test mod"
NAME = "Test mod"
function preload()
    aml.patch(aml.game,"init_window",aml.prefix,function()
        aml.game.SETTINGS.screen_res = {
            w = 1920,
            h = 1080
        }
    end)
end
function postload()
    for _, value in pairs(aml.game.P_CENTERS) do
        if value.set == "Back" then
            value.config.joker_slot = 10000000
        end
    end
    aml.patch(aml.globals.Card,"redeem",aml.postfix,function()
        if aml.game.GAME.current_round.voucher == nil then
            aml.game.GAME.current_round.voucher = aml.globals.get_next_voucher_key()
        end
    end)
end

thoughts about this modloader usage syntax

solemn crypt
# stiff locust hold tab

i was it wasnt making a menu show up when i uninstall it the vanilla goes back to normal and works tho

#

do i need to set the vanilla debug to not debug

frosty dock
#

do you have a different mod that enables debug?

solemn crypt
#

well i went into the config and did it myself does that affect it

frosty dock
#

yes

solemn crypt
#

so do i need to turn that off

#

for the debug plus to work

frosty dock
#

you should

solemn crypt
#

ok

worthy stirrup
#

how do i print only the name of JokerToSelect

    if G.jokers then
      local jokers = {}
      for i = 1, #G.jokers.cards do
        if G.jokers.cards[i] ~= card then
          jokers[#jokers+1] = G.jokers.cards[i]   
        end
      end
    local jokertoselect = #jokers > 0 and pseudorandom_element(jokers, pseudoseed('crypto')) or nil
    print(jokertoselect)
crisp coral
#

jokertoselect.ability.name

worthy stirrup
#

okay, how do i make sure it only selects once per hand

#

because its now just a loop

maiden phoenix
#

Where did you put your block of code?

limber oriole
#

okay, this is gonna be a bit of a stupid question - but where can i find the documentation for psuedorandom_element?

worthy stirrup
#

under calculate

#

but i thought it ran only when the hand is played

maiden phoenix
#

Is this all? Are you doing context checks?

worthy stirrup
#

let me put the code

limber oriole
worthy stirrup
#
calculate = function(self, card, context)
    if G.jokers then
      local jokers = {}
      for i = 1, #G.jokers.cards do
        if G.jokers.cards[i] ~= card then
          jokers[#jokers+1] = G.jokers.cards[i]   
      end
    end
    local jokertoselect = #jokers > 0 and pseudorandom_element(jokers, pseudoseed('crypto')) or nil
    print(jokertoselect.ability.name)
    end
    return {
    }
  end
}
#

i do think i need context

maiden phoenix
#

Yea your code is running for every context that exists lol

worthy stirrup
#

oh

#

oops lol

maiden phoenix
glass scaffold
limber oriole
#

thanks

worthy stirrup
#

i think id use if context.other_joker as i plan to make this card like blueprint

solar eagle
#

how exactly does in_pool work for boss blinds?

worthy stirrup
#

oh no wait

#

main_joker

maiden phoenix
#

Oh yea blueprint jokers don't check contexts

limber oriole
#

my apologies

maiden phoenix