#💻・modding-dev

1 messages · Page 193 of 1

frosty dock
#

if next(SMODS.find_mod('id')) then

wintry solar
#

in what sort of situation?

orchid thunder
#

returning

#

that did not work

humble girder
#

you don't need to set message for mult/xmult, it'll just do it for you

#

actually there's one key where it doesn't do that, that might be it, idk

wintry solar
#

just return mult = ... and xmult = ...

orchid thunder
#

oh

#

i wonder why cryptid does not do this

wintry solar
#

🤷‍♂️

humble girder
#

isn't cryptid on some ancient version of smods

wintry solar
#

it was until earlier today yeah

humble girder
#

oh they updated, that's cool

orchid thunder
#

does this work with the talisman stuff

humble girder
#

still, generally i found using cryptid as a reference created more questions than answers

orchid thunder
#

this is adding something IN cryptid

humble girder
#

oh lol, good luck

minor furnace
#

huh, apparently if your Mult is negative, the UI doesn't display it

wintry solar
#

does it not?

minor furnace
#

it calculates correctly, but it doesn't show it

grim remnant
#

how do we retrigger jokers, anyways? we did see the optional_features flag and set that to true, but when we try and do something like this, having a joker with the edition retriggers all cards played, not the joker itself.

wintry solar
grim remnant
#

okay, the joker retriggers, but it's still retriggering any playing cards with it. tried a if context.cardarea == G.play and context.repetition and not (context.retrigger_joker_check and context.other_card == card) then on the playing card check, but it didn't work. uh. what do?

frosty dock
orchid thunder
#

can i used G.jokers.cards to access a cards config

vestal ore
#

what's this transparent blank pack used for in the boosters.png of base game? is this just a template?

frosty dock
orchid thunder
#

so if i do

if (card.area == G.jokers and G.jokers.cards) then
  if card.is_d20 == true then
     (Button Ui stuff)
  end
end``` 
would that work
frosty dock
#

what would the check for G.jokers.cards accomplish here? you're checking if an area exists after you've already assumed the card is in it

orchid thunder
#

fair point

wintry solar
vestal ore
#

idk why i didnt remember that

frosty dock
#

not card.is_d20 == nil never happens

orchid thunder
#

if its true then its not nil

frosty dock
#

not card.is_d20 is evaluated first and always a boolean

#

card.is_d20 ~= nil is what you're looking for

#

or not (card.is_d20 == nil) with parentheses

orchid thunder
#

i keep forgeting about ~=

frosty dock
#

but as it stands, not takes precedence

orchid thunder
#

hmm still didnt happen

grim remnant
#

question for the shader knowers in here: when it comes to making a shader, GLSL Editor HATES any mention of extern. which, given the name, we assume is because it's a command to make an external statement that GLSL Editor couldn't care less about. how could we like... substitute that?

(code is just pried from ionized.fs from the edition sample, will obviously be editing it to be unique once we have everything setup)

frosty dock
#

so the second check is just straight up unnecessary

crimson dune
#

Hello, I am currently trying to add a hook for add_to_deck as part of functionality for checking if any Joker has been added/removed (without using update). This would be used to check for the total Joker slots avaliable. Looking at some of the methods, while self.added_to_deck is used to check if it has not been added to the deck yet, apparently it's nil, thus yielding a crash involving an attempt to index global 'self' (a nil value) if I decide to add in a card (such as a consumable) using debugPlus.

local addHook = Card.add_to_deck
function Card.add_to_deck(from_debuff)
    if not self.added_to_deck then --This is where the problem has occurred
        print("Joker added")
        if jokers[self.key] then
            print("found Joker")
            for _, v in pairs(G.jokers.cards) do
                if v.key == "unik_happiness" then
                    print(v.key)
                    -- do s--t here
                end
            end
        end
    end

    local ret = addHook(from_debuff)
    return ret
end

Another note is that I loaded in the hook via NFS.load(mod_path .. "data/hooks/addremovecards.lua")().
Replacing Card.add_to_deck with Card:add_to_deck gives a runtime error involving self.ability in card.lua (line 784) being nil.

frosty dock
#

function Card:add_to_deck(from_debuff)

orchid thunder
orchid thunder
#

oh

frosty dock
#

nil just is not equal to true

orchid thunder
#

ok but still doent explain why it doesnt show up

frosty dock
#

similarly you need to pass self through to addHook, so local ret = addHook(self, from_debuff)

frosty dock
orchid thunder
frosty dock
#

that's a value set on your center, not the card itself

orchid thunder
#

then how do i access that

frosty dock
#

card.config.center is the center

orchid thunder
#

of

frosty dock
#

so card.config.center.is_d20

orchid thunder
#

ok nice to know

#

im a fucking idiot

#

i spelled config wrong

frosty dock
#

conifg

crimson dune
orchid thunder
frosty dock
#

that sounds like something is wrong with your ui code

humble girder
#

hope you packed a few days worth of rations

orchid thunder
#

i dont want that there

humble girder
#

i dunno if i correctly understand this, does Blind:set_blind with reset = true only recalculate debuff on playing cards? not even jokers? why?

#

is this only used when adding cards

#

...but why is every playing card recalculated when you add one card

placid frigate
#

I've been trying to make a modded challenge for a modded Joker but every time I hover it the game crashes and I don't know why it's happening

humble girder
#

drop a crash dump and maybe we can help

placid frigate
#

let me know if you also need my code

humble girder
#

first of all update your steamodded

#

it's truly ancient

wintry solar
#

that is the second time I've read a 12 as a 14 today

placid frigate
humble girder
#

yeah just fetch the latest main

placid frigate
#

the alpha?

humble girder
minor magnet
#

should i buff this?

#

i was thinking about having it gain 1X

#

instead of 0.5X

#

but 1X seems to be exclusive to legendaries

grim remnant
#

could go for x0.75 ala glass joker

minor magnet
chrome widget
minor magnet
#

it feels like glass joker atm

#

it is good for getting rid of stone cards

#

but it also feels a little weak

humble girder
placid frigate
#

I put the challenge and Joker in the same file

#

the Joker works fine in base

humble girder
#

your id will probably be wrong

#

pretty sure it's j_JOKERP5_P5JokerMod

grim remnant
placid frigate
humble girder
#

smods prefixes everything you create with your mod id

placid frigate
#

so it would be the top folder name down to the id?

humble girder
#

--- MOD_ID: JOKERP5 this, although i'm not super familiar with the old header

wintry solar
#

it'll be the first 4 characters if a prefix isnt defined

placid frigate
#

would do you mean?

minor magnet
# placid frigate

also you misspelled Thief in the mod_name, not relevant but it bugs me

placid frigate
#

lol thanks

humble girder
#

nah, theif is the new rouge

kind olive
#

been working on a surprise mod for my internet buddies and I FINALLY FIGURED OUT CODE INJECTION!

placid frigate
#

ok after changing the mod id ( and mod_name) it still doesn't work

humble girder
#

you have to change the joker id, not the mod id

#

to include your mod prefix

#

if your joker's key is foo and your mod prefix is mymod then the joker is j_mymod_foo

placid frigate
#

I see

#

j_JOKERP5_JOKERP5

#

so it would be that?

orchid thunder
minor magnet
orchid thunder
#

it says pull but i want it under the card not witht he sell button

minor magnet
vestal ore
#

how do i force a certain booster pack to be in the first shop of the run?

vestal ore
#

would it be a bad idea?

humble girder
placid frigate
humble girder
#

that's the symptom

#

the cause is this line

           {id = 'j_P5JokerMod', eternal = true, pinned = true}
  },```
#

get the id right and the problem goes away

placid frigate
#

got it

#

i tried it with the egg joker (j_egg) and it shows up fine

frosty dock
orchid thunder
humble girder
#

do you not c what he's talking about

orchid thunder
#

Oh damn

foggy carbon
orchid thunder
#

-# no I'm an idiot

frosty dock
#

98% of lua programmers can't C

orchid thunder
#

Is it a c++ joke that I don't understand

hardy viper
#

c is fun

#

love me some c

#

debugger feels like magic sometimes tbh

chrome widget
#

The implementation of GLSL in Love2D aliases a lot of stuff and isn't fully equivalent

sturdy compass
#

Just got around to looking in here and saw the ping. Was this done? If not could you please tell me what the context is?

grim remnant
frosty dock
#

the thing is love doesn't use standard glsl

quasi comet
#

I can't seem to add mult to a playing card? I'm trying to make a consumeable that gives permanent mult to the card; but i've tried a bunch of different stuff and it never seems to give mult...

keen coral
#

error readout told me there's an 'unexpected symbol' on line 40 near '}'. does unexpected symbol typically mean a syntax error?

normal crest
#

your for, if and calculate are missing an end

tepid crow
#

does unexpected symbol typically mean a syntax error?
yes

keen coral
#

got it, ty! was guessing it'd be smth like that lol

crisp coral
#

yeah you're missing ends

topaz sun
#

Guys, how do I check the key of the card being sold in context.selling_card?

#

If there's even a way to do so

normal crest
#

context.card it looks like

#

context.card.config.center_key would get you the key

topaz sun
#

lmaooo sorry sir 🫡

frosty dock
#

xdxd all good

topaz sun
grim remnant
topaz sun
#

Holy... That's a goldmine

#

Thx

normal crest
#

don't worry, even if it looks like so, there still undocumented stuff

topaz sun
#

I mean, at least there is documented stuff

vestal ore
#

i'm in the process of making a booster pack, but the text here is not what is expected (it's meant to say Buffoon Pack), is there something i'm forgetting in loc_txt?

normal crest
#

another read the docs moment

vestal ore
#

fuck

#

thanks my brain wasnt registering that line of text

#

i looked over docs like 30 times LMAO

humble girder
#

why is everyone using old header and loc_txt instead of a localization file :v

normal crest
#

using old mods as a reference probably

grim remnant
frosty dock
#

also loc_txt is easier to manage getting started because everything about an object is in the same place. it just doesn't scale well, which is why most larger mods switch to loc files at some point if they don't start out using it

#

cryptid does use localization files obviously but it does also use the old header

#

and i might say one thing, if <2 months is already painfully old, imma show up with some back in my day etc

humble girder
#

number goes up too fast

#

i called 1220a that someone was using here ancient

#

pretty sure i started off a few months ago on a slightly older version

normal crest
#

the reason it feels old is because there has been so many changes within those 2 months

grim remnant
#

the issue isn't necessarily the time, it's the amount of updates in that timeframe. smods and talisman updated FAST there. ;P

#

psychic link achieved...

normal crest
#

I guess now you're 5 people instead of 4

frosty dock
#

better calc was one of the largest changes in terms of impacting mods that we've had in a while for sure

grim remnant
#

ik when we got started we spent like an HOUR trying to figure out why our sample mod wasn't working... Literally every time, it was that something was out of date. Even Lovely. ;P

frosty dock
#

most mods made the jump fairly quickly, but cryptid had the misfortune of being caught up amidst a major refactor of their own

humble girder
#

sooner or later something will have to be named a stable release

frosty dock
#

we're at a point where most mods are over old calc, so at the very least i'm preparing a beta release

normal crest
#

i envy the new modders in 2026 who will have stable releases, surely

humble girder
#

unless you know

#

thunk releases a dlc

#

that breaks all the patching smods relies on

frosty dock
#

there's been an ongoing debate of which will come first

#

the gameplay update or a stable smods release

normal crest
#

it'd be pretty funny if thunk reformatted his code drastically and every single patch breaks

humble girder
#

tbh if i were thunk i'd sit back and wait for better calc

#

literal mountains of free labour over here

frosty dock
#

I expect a decent amount of breakage in that update once it hits

hardy viper
#

thunk should drop the update in the middle of exams tbh

frosty dock
#

it's been cooking for a while and we'll probably wait a good while longer before it's finished

#

if 1.0.1 was a straightforward update for steamodded to adapt to, 1.1 might hit me (us? let's be fair, mostly me) like a truck

humble girder
#

depends on what even the update is

wintry solar
#

what if 1.1 is just built in the smods api

humble girder
#

maybe it's just an official joker pack

wintry solar
# sturdy compass Just got around to looking in here and saw the ping. Was this done? If not could...

I didn't, but here is the relevant part of the code

SMODS.calculate_context({modify_scoring_hand = true, other_card =  G.play.cards[i], full_hand = G.play.cards, scoring_hand = scoring_hand}, effects)
        SMODS.trigger_effects(effects, G.play.cards[i])
        for _, eval in pairs(effects) do
            if type(eval) == 'table' then
                for key, eval2 in pairs(eval) do
                    if key == 'add_to_hand' or (type(eval2) == 'table' and eval2.add_to_hand) then splashed = true end
                    if key == 'remove_from_hand' or (type(eval2) == 'table' and eval2.remove_from_hand) then unsplashed = true end
                end
            end
        end
frosty dock
#

just at a fundamental level

hardy viper
#

1.1 will have steam workshop mod manager deck buidler joker buidlker support on god!!

frosty dock
#

this is like two branches of a codebase diverging over the course of a year

spark remnant
#

I'm currently trying to create a joker that will trigger an effect for the first card of suit, what would the best way to do this be?

frosty dock
#

there can be a lot of backend changes just by means of thunk realizing the thunkiness of his code

normal crest
#

thunk installs an auto formatter

humble girder
#

🤔 the way Blind:set_blind is patched really doesn't lend itself to altering vanilla blind behaviour does it

edgy reef
hardy viper
#

98% of balatro modders cant press shift+alt+f

humble girder
hardy viper
#

tbh i prefer lovely patches when theyre not formatted since you can clearly see whats patched in and whats not

edgy reef
#

ok fair

hardy viper
#

we need a better way of doing ui

humble girder
#

formatting is by far the smallest issue around ui code

hardy viper
#

its actually atrocious

normal crest
#

yeah after running a formatter the UI definitions file goes from 6k lines to 10k

grim remnant
hardy viper
#

lmao

#

you know what would be hilarious

humble girder
#

bite the bullet, visual balatro ui builder

hardy viper
#

if in 1.1 thunk decided the code was too bulky and ran all the code through an uglifier to save on space

#

better yet

frosty dock
#

phuck no

hardy viper
#

precompiles everything

frosty dock
#

yeah let's just kill all modding up to this point for good

hardy viper
#

lmao

frosty dock
#

force everyone to use an in-house system

#

i quit if that happens

humble girder
#

i mean that just means all mods stay on 1.0.1 indefinitely until someone insane enough to reimplement 1.1 in smods comes around

hardy viper
#

im very surprised nobodys taken advantage of the unsafety with balatro mods

#

with how depraved people are these days

frosty dock
#

who knows

#

there's been people trying to distribute exe replacement mods on this discord

hardy viper
#

yeah who knows at that point

novel violet
#

sorry if this is a bit of a rookie question - i've never programmed in lua, i've only ever done very basic c++, and lua is pretty wildly different - is there a way to access each card in a played hand as an int value or something - how does it work? i can't seem to figure out how to use scoring_hand to make a joker trigger on, for example, the first and last card of any played hand

hardy viper
#

ah i see what you mean

sturdy compass
novel violet
#

sure i understand that but i'm thinking of their positions in hand rather

#

idrk how the game handles that either way

humble girder
#

context.scoring_hand[1], context.scoring_hand[#context.scoring_hand]

frosty dock
#

(yes, lua is 1-indexed)

sturdy compass
#

^

#

The horror

humble girder
#

it was a shock to myself as well

novel violet
#

i don't know how i feel about that

grim remnant
normal crest
#

it's really not that bad

#

the starting at 1 index

humble girder
humble girder
normal crest
#

i won't

spark remnant
normal crest
#

it took me like 3 seconds to get used to it

frosty dock
#

it's just breaking with a convention that really doesn't need to be broken

novel violet
sturdy compass
#

yuep

humble girder
novel violet
#

fantastic, appreciate it everyone :)

sturdy compass
#

That is one thing I do like about lua. Very easy and intuitive to get array lengths

fathom thunder
frosty dock
humble girder
sturdy compass
#

lmfao

humble girder
#

and a downright crime against humanity

frosty dock
#

it's just that arrays don't actually exist in lua, they're just part of what makes a table

humble girder
#

it's just a listmapobject that's all but none

frosty dock
#

under the hood, it consists of an array and a hashmap

spark remnant
#

honestly this biggest thing I've found I don't like in lua is not switch case

grim remnant
frosty dock
#

for preview, your best bet might be the game itself or setting up some dummy love game

normal crest
#

you can use debugplus watch shader feature

#

just watch shader Mods/your mod/assets/shaders/yourshader.fs and a card with the shader will pop up, whenever you save the file it will update

#

and any errors will show in the ingame console

humble girder
#

is smods considering at any point replacing the massive, horrible if/elseif chains that check ability names entirely with a reimplementation of balatro as smods objects

#

i'm at a point where i have to rewrite the base game blind code so hard that i might even be willing to contribute that bit

#

but i'd rather not start contributing it if the stance is to leave the spaghetti alone

#

similarly i've noticed that smods has a good reimplementation of booster pack code but for some reason the core booster packs are not patched to use it, even though it works even better than vanilla (vanilla booster pack code can't handle 7+ cards in a booster pack)

edgy reef
#

...Booster packs are set up to use SMODS API instead of vanilla.

#

Done via take_ownership_by_kind

humble girder
#

yes and no

worthy stirrup
#

Is there anything special needed to replace a vanilla texture with a modded texture

humble girder
#

the packs themselves use SMODS code but the UI after opening the pack does not

worthy stirrup
edgy reef
#

create_UIBox?

humble girder
#

something to do with that, yes, i'm looking at my patches right now

#

i had to patch out some vanilla spaghetti which made vanilla booster packs hit smods code instead

edgy reef
#

I have been wondering if booster pack states conflicting with SMODS booster UI could cause issues

humble girder
#

i don't have a dump right now that's not patched but i'm pretty sure this bit directs vanilla booster packs away from SMODS UI code in Card:open()

if self.ability.name:find('Arcana') then
    G.STATE = G.STATES.TAROT_PACK
    G.GAME.pack_size = self.ability.extra
elseif self.ability.name:find('Celestial') then
    G.STATE = G.STATES.PLANET_PACK
    G.GAME.pack_size = self.ability.extra
elseif self.ability.name:find('Spectral') then
    G.STATE = G.STATES.SPECTRAL_PACK
    G.GAME.pack_size = self.ability.extra
elseif self.ability.name:find('Standard') then
    G.STATE = G.STATES.STANDARD_PACK
    G.GAME.pack_size = self.ability.extra
elseif self.ability.name:find('Buffoon') then
    G.STATE = G.STATES.BUFFOON_PACK
    G.GAME.pack_size = self.ability.extra
end
#

the particular problem was that the vanilla UI code doesn't seem to have any flexibility for booster pack sizes so after 7-8 cards they just leave the screen

#

while SMODS booster pack UI code seamlessly handles cryptid amounts of cards per pack

#

would've been nice if i was sure about this, some comments sure would've been nice mr author "baliame" who committed it "last month" :V

humble girder
nova finch
#

how would i check how many jokers of a certain rarity there are in the joker area?

minor furnace
#

Can SMODS.Joker handle the soul effects like for legendaries? It doesn't immediately appear to be on the wiki, at least

humble girder
#

wdym the soul effects

minor furnace
#

or like hologram

humble girder
#

oh you mean sprite-wise

#

no idea

minor furnace
#

where the joker face sprite is separate from the body of the card

wintry solar
#

Yes

humble girder
edgy reef
edgy reef
minor furnace
edgy reef
#

Generally if SMODS needs vanilla logic to change they just use take_ownership and not touch the original logic since it's designed so we don't need to.

humble girder
humble girder
# edgy reef Also I wanna know more about this. SMODS is (at least supposed to) ensure that f...

seems to be cracking a bit around blinds, as far as I can see for example, in Blind:set_blind(), SMODS logic and vanilla logic would run if I were to take ownership of, say, the Eye
the point is kinda that we mostly have the framework to redo what vanilla does nicely, and i'd actually propose cutting down vanilla spaghetti, so not only take ownership but also provide a base take ownership (that reimplements the vanilla logic) and patch out ability.name == "foo" spaghetti

zealous glen
humble girder
#

reason I'm thinking about this is actually that I'm working on something that could potentially bring multiple blind effects into the fold but as it stands it is either insanely messy or all vanilla blinds have to be turned into SMODS blinds, which made me find this issue

zealous glen
humble girder
#

and this is my next point ^

zealous glen
#

I got multi Blind code from it (playing against multiple Blinds within one Blind)

humble girder
#

right now if multiple people do this I'd say it almost inevitably conflicts

worthy stirrup
zealous glen
#

Malverk is a texture pack manager mod

worthy stirrup
#

okay, thanks

zealous glen
west mason
#

Hello, im new to modding and i need some help. Is there a way to detect if a lucky card has failed to trigger any of its effects?

zealous glen
#

I do think that both adding an info queue to Blinds and passing the current Blind as a variable instead of a global would be good starts

humble girder
zealous glen
humble girder
#

this discussion isn't technically about blinds themselves

#

it's about moving the vanilla spaghetti logic into smods objects

zealous glen
#

I don’t think there’s much benefit to endless “as is” modifications that could be added to SMODS

#

I think only the ones that could be interesting to multiple mods are worth adding

#

Especially the ones that could cause conflicts otherwise

humble girder
#

as-is is very valuable because if any one mod wants to rely on as-is, right now, they have to reimplement stuff as-is, which in on itself conflicts with anyone's not as-is behaviour

zealous glen
#

Not necessarily

humble girder
#

tell me about the benefits of having effectively two systems in place (if it's not an SMODS object, fall back to if-then chains)

zealous glen
#

And again it’s not very valuable because there’s a myriad of “as-is” modifications and finite work, time, etc. not to mention maintenance and efficient implementations

zealous glen
humble girder
#

see that's also not guaranteed

#

we're relying on exact text matching, i guarantee to you the smallest change to any line will break half of SMODS

zealous glen
#

Yeah but keeping the vanilla implementation working is more likely to work

#

Because you don’t need to reimplement anything vanilla

humble girder
#

that's incorrect, it's more likely to (at all) follow what the base game does, but it's less likely to work, by reimplementing as-is you're pinning the version

zealous glen
#

But you don’t want to pin the version, you want to update it

humble girder
#

which does come with its own problem but it actually makes anything somewhat less likely to break

#

let us not actually pretend that all the lovely patches will continue to function if any vanilla update happens

#

it breaks on something as simple as thunk running a formatter

zealous glen
#

Some of them might break but I imagine most will only need to find the correct place to patch into rather than being reimplemented

grim remnant
#

okay, this is a silly as hell question. we think we have our shader looking more-or-less good enough for right now, but uh, how do we call it? this... this got mad for some reason.

humble girder
#

but your argument breaks down as soon as any effort needs to be made to follow an update

zealous glen
#

The effort to update SMODS to a Balatro update should be less if we don’t reimplement Balatro code

humble girder
#

or at least the way I see it everything hinges on undetermined amount of effort that needs to be made in case there is a vanilla update but you yourself just admitted that there is an unquantified possibility

#

also I'd like to point out better_calc effectively reimplements vanilla scoring which already may be subject to such a problem

#

even though it refers back to vanilla sometimes

#

die is already cast from where I'm standing ¯_(ツ)_/¯

zealous glen
#

better_calc at least makes sense as something that will see widespread use

#

Also it’s unlikely that thunk would heavily change scoring to the point that it needs to be refactored

#

By its nature, updates to scoring should be easy to be added in as they should go on top (as it’s not fixing anything that is likely change)

humble girder
#

let's also not pretend there's going to be a "middle ground" update, like the last patch, any upcoming update is either going to be 1.1 which fundamentally breaks everything, or something like 1.0.1f which is mostly a change to the extra value of joker defs

zealous glen
#

And as I said any update will break your proposal more than it would break the current methodology

humble girder
#

not really

zealous glen
#

Yes really

humble girder
#

and I was going to explain why but I suddenly inexplicably find it pointless

#

w/e

zealous glen
#

I mean I already explained why yes

humble girder
#

good for you 👍

placid frigate
#

ok so I got the challenge to work

#

i had to do id = 'j_1234_P5JokerMod_joker' with 1234 being my mod id and P5JokerMod_joker being my joker's key

grim remnant
#

okay, what are we not seeing here. it says "The shader's key, file name (without extension) and the shader name used in the GLSL file must be identical." but like. isn't this doing exactly that? so why is it giving this error?

humble girder
#
    key = 'faded_foil',
    path = 'faded_foil.fs',
}```
#

this works so I assume your path needs the extension

grim remnant
#

Ah.

grizzled trellis
#

hey guys so I wanna learn how to make a mod n shit because I think it’d be fun but I have like Jack Shit knowledge of programming outside of like the basics from an AP comp sci class which was just JS lmao
do ya’ll know of any resources I could use for like installing/learning lua and whatnot :]

foggy carbon
fathom thunder
grizzled trellis
#

thanks!! maybe should have thought of that

tall wharf
worthy stirrup
#

I get a crash on boot up with this mod, im trying to add a malvrik texture

fathom thunder
fathom thunder
#

?

tall wharf
#

computer do things in steps

#

n stuff

#

you kinda need basic programming knowledge to work

fathom thunder
#

yea im aware but what are you on about

tall wharf
#

please disregard my messages

fathom thunder
#

alright then

fathom thunder
grizzled trellis
#

aaaaah i'll figure it out what's the worst that can happen

worthy stirrup
#

ill send it in a sec

worthy stirrup
grizzled trellis
# fathom thunder

my computer when I somehow manage to delete system32 trying to add +4 mult

tall wharf
# fathom thunder alright then

ok i just recollected myself so what i meant is that i think jumping head first into programming something complicated is a bad idea without knowing fundamentals first

grizzled trellis
#

which yeah i'm probably way over my head lol but i'd like to try
wdym by fundamentals though, basic shit like how binary works, abstractions, etc. or more?

tall wharf
#

variables if else and loops

fathom thunder
# worthy stirrup

does it not crash when you remove your own mod? cuz that's a whole lot of mods that might cause a crash

worthy stirrup
#

it doesnt crash when i remove it

tall wharf
#

are you trying to loop through a string?

worthy stirrup
#

no

fathom thunder
#

ohhh

#

i see

grizzled trellis
fathom thunder
#

text is supposed to be a table

#

like how you did in TexturePack

worthy stirrup
#

how the hell did i do that lol

fathom thunder
#

happens to the best of us

tall wharf
worthy stirrup
#

two hours of my life trying to find the issue with my code

the evil brackets:

fathom thunder
worthy stirrup
#

okay, its no longer crashing but it doesnt show up lol

fathom thunder
#

like there's hardly any cases i can think of where it assumes that you already understand fundamentals

tall wharf
#

someone could just be like

#

"this is cool i wanna start writing some code too"

worthy stirrup
keen coral
#

officially finished my first custom joker 🥳

tall wharf
#

hdr balatro

tall wharf
#

the mod menu

#

hello mr john lovely

west mason
#

My first joker, i plan to make a few more or even a full mod themed around the Pokemon Trading Card Game.

worthy stirrup
#

wait, i think ive got it

white spade
#

What’s the latest steam modded version?

tall wharf
#

not 0.9

gaunt thistle
#

just time consuming at the end of the day

pseudo current
#

One question, is there a "balatro mod creator" mod? or anything like that?

gaunt thistle
worthy stirrup
white spade
#

Oops! The game crashed:
main.lua:1266: module 'lovely' not found:
no field package.preload['lovely']
no 'lovely' in LOVE game directories.
no file 'lovely' in LOVE paths.
no file '.\lovely.lua'
no file 'Z:\home\deck.local\share\Steam\steamapps\common\Balatro\lua\lovely.lua'
no file 'Z:\home\deck.local\share\Steam\steamapps\common\Balatro\lua\lovely\init.lua'
no file '.\lovely.dll'
no file 'Z:\home\deck.local\share\Steam\steamapps\common\Balatro\lovely.dll'
no file 'Z:\home\deck.local\share\Steam\steamapps\common\Balatro\loadall.dll'

Additional Context:
Balatro Version: 1.0.1n-FULL
Modded Version: 1.0.0~ALPHA-1420a-STEAMODDED
LÖVE Version: 11.5.0
Platform: Windows

Stack Traceback

(3) global C function 'require'
(4) main chunk of file 'main.lua' at line 1266
(5) global C function 'require'
(6) LÖVE function at file 'boot.lua:323' (best guess)
Local variables:
c = table: 0x00c0d8d8 {identity:false, version:11.5, accelerometerjoystick:true, modules:table: 0x00c0d928 (more...)}
openedconsole = boolean: false
confok = boolean: true
conferr = nil
(7) global C function 'xpcall'
(8) LÖVE function at file 'boot.lua:362' (best guess)
Local variables:
result = boolean: true
(9) global C function 'xpcall'
(10) 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"])

tall wharf
#

bro i need to get back to writing code

worthy stirrup
#

this is what i got

white spade
humble girder
worthy stirrup
#

it just hit me, i dont think i got the json file

gaunt thistle
#

It's funny that localthunk running a formatter would incur the modding apocalypse ratlaugh

tall wharf
#

I'm crying

tall wharf
worthy stirrup
#
--- MOD_NAME: Yonkagor
--- MOD_ID: Yonkagor
--- PREFIX: YNK
--- MOD_AUTHOR: Flote
--- MOD_DESCRIPTION: Hoping this works
--- VERSION: 1.0.0
--- DEPENDENCIES: [malverk]

AltTexture({
  key = 'YJoker', -- the key of the texture
  set = 'Joker', -- define the object type that you are retexturing, see wiki for full list of types
  path = 'Joker.png', -- the filename of your spritesheet, saved in assets/1x AND assets/2x
  loc_txt = { -- [NYI] Localization text for tooltips displayed in the texture selection screen - can be added to a localization file under [descriptions][alt_texture]
    name = 'Example Texture',
    text = {'Jokers are replaced by bananas'}
  }
  
})

TexturePack({
  key = 'YonkagorArt', -- the key of the texture
  textures = {'YNK_YJoker'}, -- a table of keys 
  loc_txt = { -- Localization text for tooltips displayed in the texture selection screen - can be added to a localization file under [descriptions][texture_packs]
    name = 'Yonkagor Based Jokers',
    text = {'Youre like pop music or something'}
  }
})
gaunt thistle
#

There is value in Lovely having a semantic patch which can match against the lua syntax tree

#

It would in theory be a lot less brittle, but you would also have a lot less flexibility in where things end up

worthy stirrup
#

ITS WORKING

gaunt thistle
gaunt thistle
#

Seriously???

#

I hope that's a fuckup

tall wharf
#

no they just removed it

pseudo current
#

@glossy dagger

white spade
#

I seem to be having an issue could someone help me?

tall wharf
#

it doesn't entirely kill the modding thingy

#

it will just take forever

glossy dagger
gaunt thistle
tall wharf
gaunt thistle
#

Yeah it doesn't kill it entirely but that is a serious hit to the modding community.

tall wharf
#

i feel like they know better than just messing that up

fathom thunder
#

yeah modding on java has been so embedded into like its history that just messing up modding on java is likely a terrible idea

gaunt thistle
#

Yeah but this is Microsoft, so who knows

fathom thunder
#

i trust that they aren't that stupid

#

or greedy

tall wharf
#

as much as they want to phase out java

#

they can't

fathom thunder
#

whichever one would lead to it

tall wharf
#

it will just kill the game

gaunt thistle
#

afaik mojang is pretty independent too

#

so it'll probs be fine

tired marsh
#

it was rlly difficult but it's fun

#

peeps in modding dev helped :D

tall wharf
#

even with official updates ceasing mods will still be around to add more stuff

gaunt thistle
#

yeah it means there will finally be a modern minecraft that everyone can target

#

(but why do that when 1.12 exists)

glossy dagger
tall wharf
#

1.12 is

gaunt thistle
#

sorry, why do that when 1.7 exists

tall wharf
#

7 years old

tall wharf
gaunt thistle
#

sorry, why do that when 1.19.2 exists

fathom thunder
tall wharf
#

you don't even get the new swimming

fathom thunder
#

sorry why do that when 1.8.9 exists

tall wharf
white spade
#

What exactly does it mean, no lovely in love game directories?

gaunt thistle
#

why play modern minecraft at all when beta 1.7 exists

fathom thunder
gaunt thistle
#

they wouldn't be getting that error message if they didn't have lovely installed

#

is this your code @white spade ?

tall wharf
#

i always play the latest releases if possible

gaunt thistle
#

modern mc is fine other than it running like crap on servers

#

I like it but I have a hard time finding the motivation to play it.

#

probably nostalgia since I bought the game in the beta era

white spade
tall wharf
#

i think it's also kinda crazy that you can upgrade mc words from alpha to latest version

fathom thunder
gaunt thistle
fathom thunder
#

theres no way its not boring

gaunt thistle
#

just trying to figure out what you're trying to do

glossy dagger
gaunt thistle
white spade
#

I downloaded lovely

#

I put version.ddl in the right version I don’t know what else is happening

tall wharf
gaunt thistle
#

also better than adventure is incredible

tall wharf
#

sure if you isolate an update it's like not a lot

#

but it compounds

gaunt thistle
#

0.7.1

white spade
#

That’s the issue I don’t know what’s going on

fathom thunder
tall wharf
#

i think 1.9 combat is alright

#

it is different

fathom thunder
#

nah 1.9 combat is terrible but later versions refine it so that its actually good

tall wharf
#

oh yeah true

#

agree

#

didn't shield use to suck in 1.9

gaunt thistle
fathom thunder
#

no clue i dont remember playing much back then

white spade
#

I have steam modded and lovely

tall wharf
#

fair

#

there are definitely overlaps of interests between this and Minecraft modding

merry raven
#

Balatro in minecraft when

stable agate
#

Wanted to put this here to ask for help (I have no idea where else I could);

I'm getting an error printout of " Error processing file Jokers.lua:489: unexpected symbol near '}' " when I'm trying to run this joker. If any of you could help, I would greatly appreciate it

shell belfry
#

does anyone know how i could find the ranks in both the two of a kind and three of a kind in a full house

runic pecan
#

Is +mult available in context.before now?

stray warren
#

Just return { mult = x }

minor furnace
#

I don't suppose it's possible to set a joker's enhancement gate to be a set of possible enhancements without patching? At least it doesn't seem that way based on the definition of SMODS.has_enhancement()

chrome widget
#

I.E. you mean it has multiple? That would be via using quantum enhancements

minor furnace
#

I mean if having one of two enhancements in your deck makes the joker findable in a run

proven stump
#

@stable agate You’re missing an “end” to close the calculate function

chrome widget
#

Oh I see what you mean

minor furnace
#

i.e. it becomes discoverable if you have a lucky card in deck or if you have a gold card in your deck

chrome widget
#
    for _, v in ipairs(G.playing_cards) do
        if v.ability.effect == "Lucky Card" or v.ability.effect == "Gold Card" then
            return true
        end
    end
end```
stable agate
chrome widget
#

Use the pool function with this condition

minor furnace
#

that's fair

proven stump
stable agate
#

Got it

minor furnace
chrome widget
#

That's definitely harder than just using joker.in_pool() yeah

minor furnace
#

But it would allow me to define enhancement_gate = {'m_lucky', 'm_gold} in the SMODS.Joker declaration, on more than one joker

#

if I have more than one joker that could have multiple cards that clear the gate

chrome widget
#

I suppose, but the actual in_pool() code is so minimal that you really don't need to

minor furnace
#

oh wait

#

wow

#

nevermind you're totally right I missed that that was a field for smods.joker entirely

#

yeah I'm going with that then

#

thank you 🙏

#

me when I forget to read the docs, apparently

stable agate
normal crest
stable agate
normal crest
#

Okay let's start from zero

#

a joker that repeats all scored cards once would look like this

calculate = function(self, card, context)
   if context.repetition and context.cardarea == G.play then
     return { repetitions = 1 } 
   end
end
#

from that you can add your other conditions for those repetitions to trigger

#

or change what kind of cards get retriggerd, for example G.hand instead of G.play for cards held in hand (like mime)

stable agate
#

I'm learning. I see. So if I wanted the retrigger to only play with a full jack hand, would it look something like this?

    return { repetitions = 1 } 
  end
end```
normal crest
#

yeah, tho I'd put the jack counting inside the if context.repetition and context.cardarea == G.play to avoid extra calculations

stable agate
#

Would what I had here work for counting jacks?

                    local jacks = {}
                    for k, v in ipairs(context.scoring_hand) do
                        if v:get_id() == 11 then 
                            jacks[#jacks+1] = v
                        end
                    end
                    if #jacks == 5 then```
normal crest
#

yep that works

#

forget about what i said, just deleted it

#

lol

stable agate
#

Okay so

chrome prawn
#

Is there a way to make it so that a joker can check if a specific joker is next to it
I've trying to modify blueprints code to do it but I can't find a way to make it look for specific jokers directly next to it

normal crest
#

then just check if G.jokers.cards[index + 1] exists

#

or - 1 if it has to be to the left

#

and to check if it's a specific joker you can just do other_joker.config.center_key == 'j_modprefix_key' for example

stable agate
normal crest
#

that means you have syntax errors

#

since you're using vscode i recommend getting the lua extension

#

this one

stable agate
#

let me see if I can find it

normal crest
#

you have a random }) at the end from the remnants of the event too

stable agate
#

So remove those?

chrome prawn
stable agate
normal crest
#

remove your and context.other_joker

#

and also you need to check that other_joker isn't nil first, because if your joker is all the way to the right it won't find any other jokers

stable agate
#

Guess I should look more into what actually needs to use events. I got like, ten more jokers to code :feelshondaman:

chrome prawn
normal crest
#

also it's not finding anything because you're comparing G.jokers.cards[i] == self which is never true

#

use card instead of self

#

card is your actual joker, self is the center

chrome prawn
#

oh my god it finally works tysm

minor furnace
#

well, I think I've finally implemented everything I wanted for my mod

#

Now I can sleep

reef gale
#

Hey you guys know any good guide i have a idea that uses other joker that are in your hand and adds mult or something like like baseball with out using just uncommons

rose dragon
crimson dune
#

While I managed to implement much of the functionality for my Joker and "Positive" Edition (shader will come later), I'm still have trouble figuring out how to have the text change depending on the card type the edition is applied on. It should be "-1 hand size" on a playing card, "-1 Joker slot" on a Joker and "-1 Consumable slot" on consumables
I've mainly followed the lovely patches in SMODs for reference and have "partially" succeeded in terms of managing to get all 3 to have the same badge, but only the Jokers with the edition display the text.
Where should I patch or hook to have the text display for consumables and playing cards?

Heres the TOML code (in txt file so it can be visible on discord) and the lua localization below. I'll supply more toml or lua if needed

        Edition={        
            e_unik_positive={
                name="Positive",
                text={
                    "{C:red}#1#{} Joker slot",
                },
            },
            e_unik_positive_consumable={
                name="Positive",
                text={
                    "{C:red}#1#{} consumable slot",
                },
            },
            e_unik_positive_playing_card={
                name="Positive",
                text={
                    "{C:red}#1#{} hand size",
                },
            },
plush cove
#

thinking about refactoring my jokers into one file like this

random sleet
#

mine's all in one file :3

#

i just init the table directly

rose dragon
novel violet
#

fantastic idea just don't let your main file hit 7000 lines

#

worst mistake of my life

minor furnace
#

mine mad it up to checks notes 2912

novel violet
#

also a true story, the latest version (unreleased) of my super paper mario mod recently broke over 7000 lines in mod.cpp and i'm terrified of splitting it up. i tried doing it one time and i broke the game very many times in terrifying ways NiceSoftlock

minor furnace
rose dragon
minor furnace
#

guess I better pump my numbers up then

novel violet
#

holy shit i believe you and everything you say

minor furnace
#

time to triple the scope of my mod

plush cove
plush cove
novel violet
#

new lifehack just dropped: hold the enter button to create many line breaks a second. local thunk will go bankrupt in a matter of days

plush cove
#

ok noted

#

i'm still trying to figure out the best organization style lmao

#

cuz I'm still on the "joker files separated by rarity" scheme

minor furnace
#

you guys are separating your files?

random sleet
#

each joker or related set of jokers as its own file is probably "ideal"

#

i will look out at you idealists from my 90000 line joker file tho

#

and i will laugh

minor furnace
#

you either have to search your one file for the thing your looking for, or you have to search for that one file that contains the thing you're looking for

random sleet
#

its ok i know the order of all my jokers

sonic cedar
#

thunk coding if it was even worse

random sleet
#

also vscode lets me do this

minor furnace
plush cove
#

i am also using vscode

#

albeit vscodium

random sleet
#

its one big table that has keys and values in it

#

then it initializes them like SMODS.Joker(jokers[jokers[i]])

#

i have a bit of apparatus around how my mod registers objects but thats fundamentally what it does

#

only at 1864 lines in LooksLikeTheJokers.lua, smh

rose dragon
minor furnace
#

if it walks like a joker and talks like a joker

random sleet
#

all of my modules have stupid names

sonic cedar
#

it's a jester

random sleet
plush cove
rose dragon
plush cove
#

these are my four VSCodium jokers

minor furnace
#

what I should have done was check if vscode has a prettier formating for Lua (which it probably does)

plush cove
#

and there's also things like Stylua

rose dragon
minor furnace
#

I'm actually really surprised it doesn't have one

grim remnant
#

for the most part this works, but for whatever reason, having this edition on a joker causes every playing card scored to retrigger... what're we doing wrong here?

tall wharf
sonic cedar
random sleet
#

grumble grumble grubmel grumble grumbl fINE I GUESS i can just add these and not do the center overrides maybe they're not horriblew

#

(theve been disabled because i couldnt get a purely cosmetic feature to work thumbs )

random sleet
gaunt thistle
#

with no comments

random sleet
#

patch them into SMODS

gaunt thistle
#

just patch them into the engine itself

rose dragon
#

patch them into a dll file

random sleet
#

patch them into engine/ui.lua

plush cove
#

this is how i add all my jokers

random sleet
#

why fight the thunk

#

join in the chaos !!! jimbo_spin

plush cove
rose dragon
minor furnace
#

nope, this is the only way

rose dragon
#

im surprised nobody has made a modding api yet

plush cove
#

what if somebody did

#

and called it

#

idk

#

smokemodded?

minor furnace
#

nonsense, they'd never go for it

plush cove
main mica
#

trying to patch the temperance loc_vars in common_events.lua, however smods already alters it, how do I know what text patch?

#

this may sound really dumb but how do I peep at the code post-lovely? 😅

plush cove
#

lovely/dump

#

in your mods folder

main mica
#

Oh!

#

that's mighty convinient, thank you Eda Clawthorne!

dusk harness
#

Friends. I can now read the cards description of the cards in the shop. I have been fighting against that for like 3 weeks now. Im very happy. I think my twitch overlay mod is now actually fisable

main mica
#

try card.config.center.loc_txt.text

dusk harness
main mica
#

You need the table of cards in the shop?

#

thats G.shop_jokers.cards

dusk harness
#

Look at my repo on the SMODS.context_change hook

#

I did get the text. Its just a bit convoluted

rose dragon
#

is there a tool that adds the sheen animation to blinds?

manic rune
#

is this the best way to word it?

dusk harness
manic rune
rose dragon
manic rune
#

...i dont think so, or at least, i have never heard of it before

dusk harness
#

Does it need to be manually created?

normal crest
manic rune
normal crest
#

Played cards with
Spade suit give +5
Mult when scored

manic rune
#

Played
cards
with
Spade
suit
give
+5
Mult
when
scored

#

seems proper to me

normal crest
#

Lol

#

Anyway

plush cove
#

P
l
a
y
e
d

c
a
r
d
s

w
i
t
h

S
p
a
d
e

S
u
i
t

normal crest
#

that's my suggestion on what to do with it

normal crest
#

unless you're adding smt else

manic rune
#

fun fact, i actually started working on the pages stuff since one of my jokers finally managed to completely flood the screen vertically 💀

normal crest
#

Honestly the pages is a great idea

manic rune
#

to the point you actually cant even see the "Rare" badge anymore

manic rune
plush cove
#

o
7

normal crest
#

just make one page for each letter

manic rune
#

😭 thats wild

dusk harness
random sleet
#

oh shoot

#

im sorry

dusk harness
#

No worries

#

Still super info

manic rune
#

should this be turned on by default? if its unticked, then you would need to highlight a joker to turn its pages

grim remnant
manic rune
#

(idk why you would untick it, but just to make sure)

wintry solar
grim remnant
#

by completely, do you mean even the stuff inside of it? :o

modern wigeon
#

Hi! Do you guys know how to remove vouchers in the Betmma mod? I keep getting crashes when using the Real Random Voucher, so I wanna remove it from the mod. The Github page says that I can, but I have no idea how. Some help would be greatly appreciated :")

grim remnant
#

oh, that just worked altogether. huh.

tall wharf
manic rune
#

what the fack is that 😭

manic rune
#

inside the Betmma mod folder is like, multiple sub-mods that you can freely disable/delete

plush cove
# plush cove

ok it looks like the general populous doesn't like the idea

modern wigeon
#

Yeah, but I just wanna get rid of one Voucher from the mod

manic rune
#

oh

#

you should go into the code and do it manually then lol

modern wigeon
#

Oh God-

#

How do I do that? I have no experience in code-

#

The page says to do it like this, but I can't find that

manic rune
#

thats odd

modern wigeon
#

How'd you do that so easily? :0

manic rune
#

type this in your file explorer

#

then press the folders: Balatro -> config

modern wigeon
#

OH MY GOD, THANK YOU

grim remnant
#

you didn't know of the %AppData% shortcut?? :o

modern wigeon
#

Do I just delete the line of code now?

modern wigeon
manic rune
modern wigeon
#

Ah, gotcha gotcha

#

That's one thing I do remember from school lol

#

It still appears in the collection. Does that what I did just mean it won't spawn in anymore?

#

Nevermind!! It's gone now!!

#

Again, thank you so much!! It's been driving me crazy all day

#

Good luck on your Star Rail mod!!! <3

tall wharf
#

man i love honkai star rail

#

i wish there was a balatro mod for it

rose dragon
#

how do i pronounce toml?

#

this is really important

tall wharf
#

toml

#

depends on if you're British or not

#

if you're British it's toml

#

otherwise it's toml

#

@rose dragon

rose dragon
tall wharf
manic rune
manic rune
grim remnant
#

question; how can we make it so a line of text in a card's description only appears if a config setting is enabled? was thinking of adding an "Origin:" section since a LOT of our cards are obscure/obtuse references but wanted to have a setting to hide it for those that already know/just want the card's effect.

tall wharf
#

tho i wish they all don't look like star rail pass

manic rune
#

im not an artist so the art is being done by my friend rn

tall wharf
#

me

manic rune
#

but im making progress far faster than him so yeah 😭

manic rune
#

thats neat

tall wharf
manic rune
#

true true

tall wharf
manic rune
#

didnt know you are ngl

tall wharf
#

yeah

rose dragon
tall wharf
#

another one

chrome widget
#

What's the easiest way to enable the Plasma balance behavior outside of the specific context that it occurs in vanilla?

manic rune
#

i can only think of those ngl

manic rune
#

i went to hanoi (big city in my country) once and saw machines similar to those

#

cool asf but i didnt know how to play lol

grim remnant
manic rune
#

yeah so uh, how do i make it so the second row has only 4 objects again?

#

oh nevermind im freaking dumb, scrap that

scarlet spire
#

cryptid has a joker that triggers a plasma balance (Sync Catalyst), maybe try looking at that?

frosty dock
#

context.final_scoring_step

merry raven
#

Been stuck on this on and off, I'm creating a Joker that will split a Pair or High Card into equivalent pairs but with halved ranks, and I'm having trouble with handling the destruction of the original cards after it splits.

If I put a start_dissolve inside the event manager, then it'll create ghost cards when they get destroyed, and I'm not sure how to use context.destroying_card for this specific case, any insights?

iron iron
#

uhhhh this is really dumb but how do i add a round counter to my joker, ive tried to read the documentation and cant find anything

frosty dock
merry raven
#

It's for balancing reasons
If I split a 10 card, then the 10 card gets destroyed and turns into two 5 cards, currently the unsplit and split cards all go back to the deck

frosty dock
#

turn one 10 into a 5 and then copy it

merry raven
#

Ah

#

Interesting idea I'll think about it

frosty dock
#

seems like the cleaner way to do it

merry raven
#

Though my past attempts of trying to rank up and down a card hasn't been very clean, very painfully vanilla and prone to inconsistent crashes

frosty dock
#

storing cards in a card's ability table always seems a bit jank for saving. which is fine here i guess because there's no saving in the middle of scoring but I still dislike the idea

frosty dock
merry raven
#

Also for balancing reasons

#

It's splitting, not cloning

frosty dock
#

there's no practical difference though?

#

you're making two modified copies and destroying the original, I want to modify the original and then copy it once

merry raven
#

What are you confused about

#

Bah never mind then I'll try out your idea

frosty dock
#

if you take UnStable with no other mods that add ranks, its 1 rank has an ID of 17 and its 0.5 rank has an ID of 16, yet clearly 1 should half to 0.5 (with your current approach it will half to a 9)

crisp coral
merry raven
#

I am too tired to think right now

frosty dock
#

what I'm saying is IDs don't really mean anything

tall wharf
#

mr john steamodded

#

is it possible to calculate joker individual effect even if a card is debuffed

frosty dock
#

no

tall wharf
#

😔

#

so it just does not trigger at all

#

is this a failsafe implemented by smods

frosty dock
# merry raven Though my past attempts of trying to rank up and down a card hasn't been very cl...

I'd go with something like this for getting a rank that is closest to but above half the affected card's chip value (it takes advantage of the fact that the ranks table is sorted in ascending nominal order)

local new_rank
for _,k in ipairs(SMODS.Rank.obj_buffer) do
  if SMODS.Ranks[k].nominal >= playCard.base.nominal/2 then
    new_rank = k
    break
  end
end

then you should use SMODS.change_base to apply the rank instead of the jank card key manipulation you're doing

frosty dock
frosty dock
#

if it's on blind selected, count up in context.setting_blind instead

iron iron
#

yeah thats what i figured

tall wharf
#

how would i patch steamodded in lovely :P

faint yacht
faint yacht
#

Shows an example of how patching SMODS is targeted with Lovely.

iron iron
#

uhhhh does this code seem ok

tall wharf
frosty dock
iron iron
#

ahhhh

frosty dock
#

and i don't really like the reused local card, but seems good otherwise

iron iron
#

i was wondering why it wasnt working

humble girder
#

ahhhh

#

i just posted a PR for set_blind to respect ownership

#

and then i looked around and realized half the blind functions don't respect taking ownership

frosty dock
#

yeah blind functions are a mess

humble girder
#

well, i kinda need this so big patches incoming i guess

frosty dock
#

regex my beloved

humble girder
#

here's my question cause that's not clear to me

#

does lovely replace every match

#

cause yeah i could collapse that but it wasn't clear to me

frosty dock
#

yes, unless you tell it not to

#

it does mean you have to be extra sure of everything it will match

iron iron
humble girder
#

does regex match full lines or can it match partial lines

frosty dock
#

anything

iron iron
#

this one

humble girder
#

that's going to be extra fun if an elseif already exists

iron iron
#

thats an equal sign its just blurry

humble girder
#

alright well

iron iron
frosty dock
#

you're still using it like a global

#

for i = 1, (spn_strng) do

#

doesn't look very changed to me

humble girder
#

i'll be back in seven million years with something that regexes

iron iron
#

no i just took that ss from the earlier post

#

i did change

frosty dock
iron iron
#

i might be stupid...

manic rune
#

why is your square so good john

iron iron
#

i am in the 98% 😔

frosty dock
manic rune
#

i strive to be able to square as good as john

#

💔

humble girder
#

wait i can't regex this, what if the end is for something completely unrelated

frosty dock
#

i usually use regexed vscode search to make sure my patches aren't hitting weird things

merry raven
#

What is SMODS's way of finding the same suit between multiple cards

zealous glen
#

What do you want to do?

merry raven
#

I figured that I'd go back and revamp all my old vanilla ways of checking for ranks and suits to account for modded suits and ranks, and I wonder if SMODS has anything for checking similar suits aside from SMODS having a way to change suits

#

If not then I still use G.hand.cards[i-1].base.suit == card.base.suit where [i-1] is just for checking the suit of the left card of a selected card

zealous glen
#

I don’t think it’s hard to check if there are same or different suits

#

But it depends on the desired check IMO

manic rune
#

in the localization file, what would i need to do to detect whether uhhh, those tables have "boxes"?

frosty dock
plush cove
#

idk why i replied to that message

manic rune
#

i currently want to access such information from a function

frosty dock
#

the most "correct" way would be to make a table indexed by suits and call is_suit with each one and keep count

crisp coral
manic rune
#

oh shit, thanks

#

didnt know you can do that

crisp coral
#

god my phone os do sweaty

#

i cant type

manic rune
#

i can relate 😭

zealous glen
humble girder
#

lovely does not support zero-length lookarounds :v

zealous glen
#

Because I think the best way to do it depends on the desired result

zealous glen
frosty dock
#

end\n[ \t]*(?<a>if self\.name == '[^']*' and not reset .*?then) seems to catch the set_blind stuff exclusively

humble girder
#

so

#

I looked around

#

and it's pretty much okay to catch all of them except the one for The Pillar

#

end\n(?<indent>[\t ]*)if self.name == '(?!The Pillar)(?<ability>.*?)' I tried this but lookahead is not supported

#

technically it would be okay to catch the one for the pillar too

frosty dock
#

just match the pillar and fix the mess with a second patch

humble girder
#

it just looks weird

#

ah

#

fair enough

merry raven
# zealous glen <@338182307850616844> for example, when counting the number of suits, I do somet...

Oh I have a number of different effects that requires checking for suits and ranks

  • An enhancement that ranks up cards adjacent to it per hand played while it's in hand
  • An enhancement that changes 5 cards to its suit when played
  • An enhancement that ranks up 3 of the lowest rank cards in hand for every time this enhancement has been played before it gets destroyed in a 1 in 4 chance

Would that require vastly different methods of checking for suits and ranks or just cardfromhere.base.suit == cardfromthere.base.suit would be fine

frosty dock
#

usually just checking base suits is not fine due to cards with any/no suit

#

also smeared

zealous glen
#

Ranks is different

#

Because ranks

merry raven
#

Damn

iron iron
#

uhhhh im stupid so this works on every card sold lol

#

will change

merry raven
#

What's the proper way of doing so that can still cleanly support modded ranks or suits
Both for checking ranks and suits

iron iron
#

like having 5 of them will increase the value by 5 on all

frosty dock
zealous glen
#

I don’t think there’s an utility for ranks but you do have to beware

merry raven
#

Ah man

zealous glen
#

I do tend to handle all/bone suits/ranks separately for efficiency

#

But it depends on application

merry raven
#

And :get_id() is just an inefficient way of doing so?

frosty dock
#

it's no more or less efficient than doing it some other way. due to quantum enhancements, all jokers need to be asked if the card has no rank

zealous glen
#

It’s more about mechanics than efficiency

#

I think the efficiency is about minimizing the number of calls to find out a rank/suit

#

Which is application specific

merry raven
#

Ah

#

My main concern is just my code not supporting modded suits or ranks

#

Efficiency, I'll cross that bridge when I get there

zealous glen
#

I think the general algorithm is something like what aure mentioned

#

You keep a table of seen ranks/suits, either containing a Boolean, a number, or the cards (depending on application)

#

You might need some of the functions described in SMODS.Enhancement

#

To check for all/none suits/ranks

#

And handle accordingly

merry raven
#

If only is_rank() existed

frosty dock
#

that would become a thing if we ever do quantum ranks

random sleet
#

-# i'd make an argument for adding it now, and making it (more) "functional" later (that way ppl's code is futureproofed :? )

plush cove
#

ok so hypothetically

would it be possible to add gradients to mod badges? because i think that would be cool for Mistigris :3

random sleet
#

but then you'd have to go over all the basegame code that'd need to be swapped to it

plush cove
iron iron
frosty dock
#

[1], [2], [3], [4] are red, green, blue and alpha respectively

tepid crow
#

I mean a gradient doesn't have to be changing right?

plush cove
tepid crow
#

yeah that's an actual gradient then

plush cove
#

what'd be the best way to accomplish this within the limits of the game?

tepid crow
#

no clue lmao

frosty dock
#

oh a gradient in terms of space haha

#

good luck

manic rune
#

yeah so im tryna separate my description into boxes, but currently theres a bigass white background behind them too, how do i remove it?

manic rune
red flower
#

maybe what's making the background white is that you have the colour specified as background white

manic rune
#

really? i thought its the background for the new boxes

red flower
#

oh i just got what you were saying

manic rune
#

lemme see

red flower
#

I would probably try to copy how ortalab does it

manic rune