#đŸ’»ăƒ»modding-dev

1 messages · Page 34 of 1

spice scroll
#

ITS A STONE LUIGI

night pagoda
#

YEAH

#

I literally wanted to send a part with its a stone but you're faster

spice scroll
#

new blind: the chisel

#

blind score decreases for every $10

#

I CHISELED IT

night pagoda
#

Next: The Luger

spice scroll
#

so wait the function card:add_to_deck is inside the ref?

#

and one end instead of two?

frosty dock
#

you need to keep a reference from before your hook to call inside

spice scroll
#

oh i gotcha

frosty dock
#

else the function refers to itself and you get infinite recursion

spice scroll
#

i see yeah that was what was confusing me

#

so this is good?

frosty dock
#

looks good 👍

spice scroll
#

cool, time to reroll 80 times to test this

#

cutely makes it a common

frosty dock
#

debug:

night pagoda
#

wtf
i put G.E_MANAGER:add_event in set_blind and it goes mental and does the thing inside the event infinitely

spice scroll
#

okay this happened when i tried to buy a jimbo

night pagoda
#

oh yeah I did

#

I forgor

wintry solar
frosty dock
#

lol I'm dumb, I should have seen that

wintry solar
#

I think it needs an if name == X then

spice scroll
#

oh i see

frosty dock
#

too used to 1.0 add_to_deck

wintry solar
#

or some cleaner version

frosty dock
#

self.config.center_key == X, ideally

zealous glen
spice scroll
#

like this yea

night pagoda
#

hmmm yeah I do the event but no matter what delay I set the event doesn't seem to be delayed

#

oh nvm

#

I just put the delay in the wrong place, everything's okay

spice scroll
#

i may be stupid

wintry solar
#

what did you do

spice scroll
#

is that not how i establish the center key?

wintry solar
#

no it's done for you

spice scroll
#

oh so by center key it just means my j_whatever

wintry solar
#

mhmm

spice scroll
#

worth noting this is still 0.9.8

#

ok i think its working now

#

balanced jonkler

night pagoda
#

can I have delay inbetween those events that don't return true?

spice scroll
zealous glen
#

I had a different animation for changing the Blind score requirement

#

Oh since it doesn’t return true it’s executed repeatedly until it does, interesting

night pagoda
#

yeah

#

I exploited that basically

zealous glen
#

I wanted to have a repeating event but for a different reason

#

Since I had a Joker that changed the requirement, the event to change the UI could try to do it before the UI exists

night pagoda
zealous glen
#

So my idea is to have an event that would recreate itself until the UI existed

zealous glen
night pagoda
#

I figured I can create a step/frame counter and do something each X steps

zealous glen
#

There’s an event type called ease for this kind of event

#

Ease events need a table and a key to a numerical value in the table, and you tell them how long they should take

#

You can also choose from three default easings

night pagoda
#

ooh, are there any examples?

zealous glen
#

Yes

night pagoda
arctic veldt
night pagoda
zealous glen
night pagoda
#

ah, events witth trigger = 'ease'?

zealous glen
#

I think so

night pagoda
#

yeah, thanks!

#

will check them

zealous glen
#

I used it to move a Joker

#

But in hindsight that’s not the right way to move cards

zealous glen
night pagoda
#

I think the new one fits a bit more

zealous glen
#

I think it’s too high pitched :<

night pagoda
#

yeah that's why I think it fits more lol

#

it sounds more like a blind as an object

zealous glen
#

I like the original because it sounds more like paper

#

And it’s not too hard on the ears

night pagoda
#

yeah but blinds aren't paper they're plastic

zealous glen
#

Who’s to say they’re not dealing banknotes

night pagoda
zealous glen
#

That’s less painful but personally I still prefer the other one

stray warren
#

So would this code ensure that ghost cola doesn't show up until I change the flag when diet cola is sold?

cosmic niche
#

I am certain that I'm missing something exceptionally basic, because the game's crashing on startup.

#

line 161 is the line above the highlighted one in the first screenshot

crisp coral
#

don't return that

solemn coral
#

Has anything changed about the code for how to destroy a Joker in SMOD 1.0?

#

I'm copying the same code that exists in a 0.9.8 mod, but it's giving me an error that I think is related to the fact that it can't identify what self is inside the event.

#
G.E_MANAGER:add_event(Event({
    func = function()
        play_sound('tarot1')
        self.T.r = -0.2
        self:juice_up(0.3, 0.4)
        self.states.drag.is = true
        self.children.center.pinch.x = true
        G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.3, blockable = false,
            func = function()
                    G.jokers:remove_card(self)
                    self:remove()
                    self = nil
                return true; end})) 
        return true
    end
})) 
cosmic niche
#

Oops! The game crashed:
main.lua:5572: [SMODS XKCards "XKCards.lua"]:162: unexpected symbol near '='

#

It got me a different crash

cosmic niche
#
xk_chilidog.calculate = function(self, card, context)
    -- when scoring cards
    if context.individual and context.cardarea == G.play then
        return {
            chips = card.ability.extra.chips,
            card = card
        }
    -- Is it the end of the round?
    elseif context.cardarea == G.Jokers and context.after then
        if card.ability.extra.rounds_remaining <= 0 then 
            func = function()
                G.jokers:remove_card(card)
                card:remove()
                card = nil
                return true;
                end
        elseif card.ability.extra.rounds_remaining > 0 then
            card.ability.extra.rounds_remaining = card.ability.extra.rounds_remaining - 1,
            card.ability.extra.chips = card.ability.extra.chips - card.ability.extra.chip_mod,
        end
    end
end```
I'm just trying to do a basic food joker type thing. That it keeps crashing in that elseif section that's meant to decay the effect makes me think that's what I'm screwing up, somehow
crisp coral
#

why are there still commas

cosmic niche
#

Because I still have a very loose grasp of lua, at best. 🙃
Thank you.

zealous glen
regal shoal
#
SMODS.current_mod.custom = SMODS.current_mod.custom or {}
SMODS.current_mod.custom.joker_deck = SMODS.current_mod.custom.joker_deck or {}
SMODS.current_mod.custom.joker_deck.jokers = SMODS.current_mod.custom.joker_deck.jokers or {}
SMODS.current_mod.custom.joker_deck.jokers["Joker"] = {...}

Everything I create in custom get overwrite by nothing... Is it normal ? Should I set custom data in Game Class instead ?
PS : I'm not creating jokers here, it's configs for jokers playing cards and wanted to save them here so it's easy for anyone to add their

#

It was not the case around ~10 version earlier, so I was wondering what changed

#

That can probably work but I just wanted to know :

G.mjst_config = G.mjst_config or {}
G.mjst_config.joker_deck = G.mjst_config.joker_deck or {}
G.mjst_config.joker_deck.jokers = G.mjst_config.joker_deck.jokers or {}
frosty dock
#

are you sure it gets overwritten? it might just be that SMODS.current_mod isn't available after load

#

you need to keep a reference to it if you want to keep using it

edgy reef
#

Either that or set it with the mod ID directly (i.e. SMODS.Mods.<mod id>.config).

frosty dock
#

SMODS.Mods[mod_id].whatever

edgy reef
#

Yes thank you

wintry solar
frosty dock
#

Setting the flag to false is unnecessary though? nil is also falsy

wintry solar
#

You still need to create it though otherwise it’ll error when creating the pool

#

iirc

zealous glen
#

That’s why you set it to false or true while creating the Joker

#

It depends if you’re doing yes or no

wintry solar
#

No it needs to be when the run starts otherwise it’ll be the changed value on any subsequent runs, right?

zealous glen
wintry solar
#

I think we’re talking about different aspects of it

#

The yes_pool_flag should be in the joker registration, but the pool flags needs to be in apply to run

zealous glen
#

It didn’t in 0.9.8

#

Unless there were shenanigans I didn’t pay attention to

#

Which could be the case given I was testing it with a custom consumable type

edgy reef
#

You couldn’t add it inside the function but you can add it into the config afterwards.

wintry solar
#

Hmmm I was sure it was in apply to run for cavendish

zealous glen
#

Maybe it was taken care of automatically

#

Which SMODS should do if it doesn’t maybe đŸ€”

night pagoda
#

how do I count the current amount of tags?

#

or what is the "cardarea" alternative of tags?

#

found it, #G.HUD_tags

night pagoda
#

👀

zealous glen
#

The Loss Blind when

long gust
#

what does it do

zealous glen
#

It makes you lose the Game

long gust
#

that doesn't have any effect

brisk pond
#

how do I check for room in the consumeables area?

#

for creating tarots (needs room)

maiden phoenix
brisk pond
#

thanks

maiden phoenix
#

Look at "Cartomancer" for a ref

night pagoda
#

what am I doing wrong?

#

trying to set up a finisher blind

crisp coral
#

somehow your G.GAME.bosses_used.bl_bunc_final_crown is true instead of a number

night pagoda
#

huhhh

#

okay I know why

#

it's because I didn't create a new run and tested in the old one instead

#

weird and also đŸ€Šâ€â™‚ïž

crisp coral
#

hooray

night pagoda
#

day 2 of waiting for add_to_pool

solemn coral
#

Is it possible to change the colors of some text using the loc_vars?

cosmic kernel
crisp coral
#

ping

#

the font i use is a modified version of 04b03

solemn coral
#

I tried including the parts that change the color of a string inside that string itself, but they just get printed literally. It looks like the color changes happen before the loc vars get swapped in.

#

So, would there be a way to make that part of the string gray if it's an "_" and red or black if it's the letter of a suit?

frosty dock
#

something like {V:1}#3#{V:2}#4#{V:3}#5#{V:4}#6#{}

#

then you can put your colors into a table at vars.colours

solemn coral
#

I haven't used vars.colors before, where would I make that table?

crisp coral
#

thats a THING

#

dudeeeeee

frosty dock
#

return { vars = { 'this is var 1', 'this is var 2', colours = { G.C.UI.TEXT_INACTIVE, ... } } }

solemn coral
#
loc_vars = function(self, info_queue, center)
    return {vars = {
        center.ability.extra.multGain,
        center.ability.extra.mult,
        center.ability.extra.progressList.spades and "S" or "_",
        center.ability.extra.progressList.hearts and "H" or "_",
        center.ability.extra.progressList.clubs and "C" or "_",
        center.ability.extra.progressList.diamonds and "D" or "_",
    }, colors = {
        center.ability.extra.progressList.spades and G.C.BLACK or G.C.UI.TEXT_INACTIVE,
        center.ability.extra.progressList.hearts and G.C.RED or G.C.UI.TEXT_INACTIVE,
        center.ability.extra.progressList.clubs and G.C.BLACK or G.C.UI.TEXT_INACTIVE,
        center.ability.extra.progressList.diamonds and G.C.RED or G.C.UI.TEXT_INACTIVE,
    }}
end,
#

Giving this a try, thank you!

brisk pond
#

what am I doing wrong?

#

it says J03_MiladyRef is a nil value

#

when I try to read the joker's text

frosty dock
frosty dock
crisp coral
frosty dock
#

G is not the same as G.GAME

brisk pond
frosty dock
#

the values you put in G directly go unused

brisk pond
#

so how can I access that table from the main file

frosty dock
#

💀

#

just use the same table in both places

#

G.GAME gets initialized in Game:init_game_object() if that's of use to you

frosty dock
night pagoda
#

AWESOME, you're the best!

frosty dock
#

yw

night pagoda
#

trying to use it, am I doing it correctly? (should never appear, but it appears anyway now)

frosty dock
#

just to be sure, what's the exact version you have?

night pagoda
frosty dock
#

oh I see

#

it has to be nil, not false

#

I should probably convert that

night pagoda
#

will try nil for now

frosty dock
#

try 0616b with false

crisp coral
#

have you fixed blinds loc_var params

night pagoda
#

nil seems to work, trying 0616b

frosty dock
#

oh wait params

#

nvm, I'm not sure what to do about that

#

I don't have access to an object of the Blind class in that context

night pagoda
#

yup false also seem to work now, ty!

frosty dock
#

aight nice

night pagoda
#

two blinds use it already, more to come

frosty dock
#

I just realized loc_txt.label on consumable types is completely redundant

night pagoda
#

uhhh
what should I return in add_to_pool to not replace the normal behaviour?

#

noticed that my blind now started appearing as a showdown/finisher despite not being it

#

or I can simply not return anything, maybe?

crisp coral
#

not returning is the same as returning nil iirc

night pagoda
#

what should I return then?

frosty dock
#

rn it just fully bypasses the normal check

#

hm i have an idea

zealous glen
frosty dock
#

I could pass through whether we're polling for a showdown boss

#

just as a utility

#

maybe it's cleaner to just look at boss.showdown and ignore if it doesn't match what's requested

cosmic kernel
night pagoda
#

I need to check if the current round wants/requests a finisher blind somehow

zealous glen
frosty dock
#

I can build that into the check

cosmic kernel
#

looks dope with the colors and the font

frosty dock
#

it's just that it would be restrictive of blinds that want to show up in place of either

#

I guess that's fine?

frosty dock
night pagoda
#

yup, one sec

frosty dock
#

also updated docs

night pagoda
#

doesn't seem to hijack my finishers anymore, good!

#

oh, I see, I can make it so it spawns as both types anyways, that's cool

#

ty aure!

brisk pond
#

what are functions that are executed just once as soon as you boot up the game and never later?

#

I need just one

night pagoda
#

can't you just put the whatever code you need outside of everything?

brisk pond
#

i tried and it doesn't work

#

The J03 table is needed to load the Joker's text. The function resetGlobalVars() is called whenever a new run is started, so if I start the run I can see Joker's text without errors. But if I open Collection and then I hover my Joker without starting a run, the game crashes as J03 is nil

brisk pond
#

if I start the game, start a run and see Joker's text, all is good.
if I start the game, open the collection and see Joker's text, game crashes

zealous glen
#

You didn’t answer the question

brisk pond
#

makes you earn money

#

and the amount of money changes depending on Joker's rank

#

rank starts at 1 and increments whenever you use a tarot

#

but I already coded that part

zealous glen
brisk pond
#

each new run sets all ranks at 1

zealous glen
#

But is it retroactive or not?

brisk pond
#

remember english is not my first language

zealous glen
brisk pond
#

point taken

zealous glen
#

I’m asking if it only counts while you have the Joker or if it counts before you acquire it

brisk pond
#

oh ok

#

if you use 5 tarots, then acquire the joker, the joker is rank 6

#

it is retroactive

zealous glen
#

You can set the values when you start a run but you shouldn’t need all those table entries, or at least it’s probably better to keep it into a subtable if your mod’s table

#

Or as always you can check if it exists or create it

#

Using table.key or (table[‘key’] = val and val) or something similar

brisk pond
#

thanks

frosty dock
#

hm I think that's something I need to consider just supporting

#

you can still populate the corresponding loc entry manually though

brisk pond
#

how?

frosty dock
#

you can just put unlock in your loc_txt

#

like

#
loc_txt = {
  name = 'Name',
  text = { 'Text' },
  unlock = { 'This is how', 'you can unlock', 'this card.' },
},
stray warren
wintry solar
#

are you 1.0 or 0.9.8?

sly forge
#

0.9.8 compatibility has been merged into Steamodded's main branch

#

everyone please test the thing until it burns up in flames

wintry solar
#

also includes better enhancement api, edition api, palette api and shader objects

sly forge
#

** don't use the enhancement api just yet please, it's not quite done

frosty dock
#

not me about to go to bed and gonna end up with 69 pings tmr

wintry solar
#

also ping @sly forge when you find bugs 👍👍👍

mellow sable
#

ok adding morefluff and codex arcanum to my modpack

#

I think this is because my 0.9.8 check for Aura is failing now

wintry solar
#

yes

#

I've had to remove aura when testing

mellow sable
#

probably same for betmma vouchers then

wintry solar
#

although that's a different error to waht I was getting

#

mine was where it was looking for the pos.extra on everything

mellow sable
#

I'll remove betmma since it also does something similar

#

let's see if it still works

#

ok it's going...

#

registering feels slower for the 0.9.8 mods

sly forge
#

yeah, there's quite a bit of logic. especially localization... it's a million proxies

mellow sable
#

ok finally another crash

#

something something PaletteAPI

sly forge
#

oh no, palettes

wintry solar
#

oh god not this crap

mellow sable
#

ok I'm going to try a smaller test

#

codex, morefluff, cryptid

#

same crash

#

those and bugfixed aura are the only mods

sly forge
#

ok, the palette API is bugged

wintry solar
#

yeah I got it

#

just testing on fresh settings

sly forge
#

attempted fix merged into Steamodded

wintry solar
#

you might need to delete your settings though now

#

or maybe not

#

the settings should be fine with the new version

mellow sable
#

testing now with the mega modpack

#

9.8 mods I'm trying are codex, morefluff, and cruel blinds

#

the game launched, huge

#

I have so many blinds

#

let's see if starting a run crashes my game

#

no it works

#

ink and color is still bugged for me for no reason :(

#

ok all it took is selecting a blind

#

and it appears to be talisman incompat with... codex?

#

time to disable the big number then

sly forge
#

yeah, unfortunately talisman is going to be a pain with other mods

mellow sable
#

lua metatables suck

sly forge
#

well, it let me implement localization. so it's not all bad

mellow sable
#

I need a screenshot with jimball and something from codex arcanum

#

just for the purposes of showing how powerful this update is

#

got a crash when hovering over the deck

#

it said C1 is nil

#

oh btw, 0.9.8 mods don't seem to have mod badges on their items

sly forge
#

hm. some 0.9.8 mods will not, but most should

mellow sable
#

yo I hit foil from this deck

mellow sable
sly forge
#

which mod doesn't add badges correctly?

mellow sable
#

codex and morefluff

#

at least in collection

sly forge
#

in my limited testing all mods did have badges

solemn coral
#

How do I upgrade the level of a played hand twice? I'm looking at the code for the Space Joker, and it looks like its level up code is just a boolean true or false.

if self.ability.name == 'Space Joker' and pseudorandom('space') < G.GAME.probabilities.normal/self.ability.extra then
    return {
        card = self,
        level_up = true,
        message = localize('k_level_up_ex')
    }
end
mellow sable
#

opening deck view is what crashes the game btw

#

I also have six suits

#

like hovering over it in a round

#

yeah, no badges

sly forge
#

actually I am not seeing badges now too, not sure what's going on

#

ok, I'll look at this later

wintry solar
#

I think it's how alchemical cards are created

#

the jokers have the badge

#

but the alchemicals themselves don't use base 0.9.8 features iirc

#

they're an entirely custom api

mellow sable
#

not for morefluff

wintry solar
#

huh

#

codex's work though

#

how strange

mellow sable
#

ok will misprint deck break the game?

#

no it's not affecting colour cards :(

#

it does affect the packs tho

#

colour cards are also useless rn

#

virtual joker's downside isn't working

#

so it's just free X3 Mult

sly forge
#

it looks like incompatibilities with mods I don't use cryptid are way worse than I thought...?

#

ok, but cryptid I just gave up on, it was really messing with things

wild gyro
#

wait how are you getting cryptid to work with 0.9.8 mods

mellow sable
#

new 1.0 update that can load 0.9.8 mods

#

I mean I have like 25 mods loaded @sly forge

#

not just cryptid

sly forge
#

I also have like 20, but they're mostly bugfixed 0.9.8 mods... I do use Bunco

mellow sable
#

wait it works now

#

:O

#

maybe just because I only had 1 joker

sly forge
#

I have way too many personal bugfixes in my mods. the good thing about being a programmer: you can fix your Balatro mods directly so you don't have to waste time complaining to the author

mellow sable
#

yep

sly forge
#

ok but in all seriousness, I'm up to help out any authors who want help

mellow sable
#

so far none of the crashes happened directly because of cryptid so đŸ€·â€â™‚ïž

#

ok playing a card is crashing now

#

I think because I didn't one-shot a blind

#

and yes I have a lot of mods on

#

ok no I think it's some weird interaction with the boss I was facing

#

The Mask from Cruel Blinds

sly forge
#

Bunco has a blind named The Mask too, right?

mellow sable
#

wait it's from bunco

#

my bad

#

that's the issue with no badges lol

#

Bunco 1.0 port btw

sly forge
#

ah, I see. I've been testing with Bunco 1.0

#

as 0.9.8 was too broken to continue on with...

#

it's another one I gave up on

mellow sable
#

ok let's try this challenge out

#

jimball challenge

#

hey deck view doesn't crash when it's all stone cards

#

sync catalyst tech

wintry solar
#

Math you can play with palettes now too

hallow forge
mellow sable
#

a lot

#

cruel blinds included

#

gaming

#

only jokers that actually matter are the first two

#

ok bye for now

zealous glen
fallen tendon
#

It should be at the end

hallow forge
#

To cancel out Cryptid

mellow sable
zealous glen
hallow forge
#

What’s a dog joker?

zealous glen
#

It’s just a joke but I do have a Dog Joker

hallow forge
#

[unwinnable, cuz The Tide + The Water]

solemn coral
#

I'm trying to make a joker that gives +1 hand size for every $10 you have. What would be the best trigger for making sure this joker updates whenever you gain or lose money?

solemn coral
# zealous glen Hooking to `ease_dollars`

It doesn't look like it's working for me

local Original_ease_dollars = ease_dollars
function ease_dollars(mod, instant)
    Original_ease_dollars(mod, instant)
    for k,v in pairs(G.jokers) do
        if k.name == "oneStroke" then
            G.hand:change_size(-k.ability.extra.handSize)
            k.ability.extra.handSize = math.floor(G.GAME.dollars / k.ability.extra.perDollar)
            G.hand:change_size(k.ability.extra.handSize)
        end
    end
end```
#

I've tried a few variations on this code and none of them seemed to do anything

zealous glen
zealous glen
stray warren
solemn coral
#

By not working, I mean that doesn't have any effect, not on the hand size or the tooltip of the joker, but it doesn't crash or anything.

#

How do I find by key?

#

Just do G.jokers.oneStroke?

zealous glen
#

ah it was this I think

zealous glen
#

But do use SMODS.find_card

solemn coral
#

Ah, that would do it. Thank you!

#

Also, you don't need to ping me with every response. If I'm asking a question, I'm probably going to be checking back here for the answer often enough that the ping is unneeded.

wintry solar
# stray warren 1.0

pretty sure in your joker def you can add yes_pool_flag = 'diet_cola_sold' and then have the G.GAME.pool_flags.diet_cola_sold = false in the apply_to_run

stray warren
#

I'll try that when I get home. Thanks

crisp coral
zealous glen
#

I just like pinging people to make sure they see my responses v_v

solemn coral
#

It's not that bad an issue, it's just a bit annoying to see two or three pings in a row about the same subject before I even get a chance to check.

#

Pinging is fine for messages that are a page or two back in the history, but If it's within a few minutes or a few messages, assume I'm going to see your response.

zealous glen
#

To be fair I’ve responded to people after they’ve asked me something and they’ve just never seen the response

#

And sometimes I myself ask and by the time I look again the conversation has moved on and I didn’t get a ping for a response 100+ replies back

solemn coral
#

Fair enough! I guess it depends on preference and the size of the channel. I'm usually good at looking, so I don't need the ping, but I can understand it being different in other cases.

night pagoda
#

(blinds)

#

(for Bunco)

solid salmon
#

help

#
    if G.STAGE == G.STAGES.RUN then
        if self.ability.name == 'Scalper' then
            local sell_cost = 0
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] ~= self and (G.jokers.cards[i].area and G.jokers.cards[i].area == G.jokers) then
                    sell_cost = sell_cost + G.jokers.cards[i].sell_cost
                end
            end
            self.ability.mult = sell_cost
        end

SMODS.Joker {
  key = 'scalper',
  loc_txt = {
      name = 'Scalper',
      text = {'Adds {C:blue}+5 sell value of all other owned Jokers to Mult'}
  },
  rarity = 1,
  pos = {
      x = 0,
      y = 0
  },
  cost = 5,
  discovered = true,
  calculate = function(self, info_queue, center)
          if self.ability.bonus > 0 then
              return {
                  message = localize{type='variable',key='a_chips',vars={self.ability.bonus}},
                  chip_mod = self.ability.bonus
              }
          end
}```
crisp coral
#

your update function is missing two ends

#

and your joker's calculate function is missing an end

frosty dock
#

Also what are these arguments

remote coral
frosty dock
#

calculate(self, info_queue, center)??

crisp coral
#

moment

solid salmon
#

where

crisp coral
#

i got pinged

solid salmon
#

oh no

fallen tendon
crisp coral
#

til set_badges existed

sturdy glen
crisp coral
#

looking at 1.0.0 mods also helps

sturdy glen
#

what should i do for SMODS.INIT?

hallow forge
#

remove it

sturdy glen
#

ok

wintry solar
#

Aure, do you have any guidelines you follow when writing docs or am I free to just write them in my own style?

hallow forge
#

does anyone see anything wrong with this .toml, i can't tell why it's not working.

[manifest]
version = "1.0.0"
dump_lua = true
priority = 0

[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "G.FUNCS.discard_cards_from_highlighted = function(e, hook)"
match_indent = true
position = "after"
payload = '''
if G.GAME.blind and not G.GAME.blind.disabled then
    local hands = evaluate_poker_hand(G.hand.highlighted)
    if next(hands["Flush"]) then
        G.E_MANAGER:add_event(Event({trigger = 'immediate',func = function()
            G.GAME.blind:disable()
            return true
        end}))
    end
end
'''
sly forge
#

hm, was the patch at least applied?

hallow forge
#

i figured it out, now. still don't know what was wrong tho

frosty dock
spice scroll
#

making a joker that doubles seals is harder than i expected

#

should i even be trying to hook the card functions?

#

actually i think i got smth

spice scroll
#

ok i got all of them working but purple

hallow forge
#

I figured it out

fast badge
#

my point stands

hallow forge
#

No?

#

I definitely patched that file

fast badge
#

ahaa

#

then it was just localization that you cant patch

wintry solar
#

Does it need triple quotes around your pattern? I’ve had issues with that before

royal ether
#

is there a way to bold text?

spice scroll
#

what is the correct way to call the table of hands here?

#

found

#

this should be good

royal ridge
#

having a negative joker be debuffed, re-entering the game, and selling that negative joker does not properly remove a joker slot (unlike vanilla behaviour)

royal ridge
#

no i'm stupid

wintry solar
#

oh so it's fine?

royal ridge
#

still occurs on newest version

wintry solar
#

how are you producing this?

#

then I can replicate ad fix

royal ridge
# wintry solar how are you producing this?

play on orange stake, find a perishable joker in shop, change its edition to negative and then buy it
wait until it gets debuffed, exit and re-enter the saved game, then sell the joker

if you want a more grounded test without edition changing, play on anaglyph orange stake with RTGAME as seed, skip for the negative tag in ante 2 using the double tag, the second negative joker will be perishable and you can reproduce from there

you can also replicate this by having a negative joker be debuffed by crimson heart, exiting and re-entering, and then selling the debuffed joker

wintry solar
#

will investigate

crisp coral
#

check if any mods mess with card:save, card:load and card:remove_from_deck

#

i think those are the only functions that affect negatives selling

spice scroll
#

this doesnt reset the score counter to 0 x 0 after it triggers

royal ridge
#

(steamodded)

crisp coral
#

:oeuf:

#

oh my nitro ran out

royal ridge
#

removing edition.toml fixes the issue so it's something there

#

(obvious but whatever)

wintry solar
#

yeah I thought we'd caught all the debuff stuff

wintry solar
#

okay I've fixed it on my end, just need it merging with main dev branch now 👍

royal ridge
#

gg

solemn coral
#

I just tested this joker, and I found that while it technically works, selling it while in the shop instantly removes the extra slot it grants, meaning you can't replace it with whatever was in that slot.

#

Is there a way to tie an effect to happen at a later time, like when the shop is rerolled or exited, even if the joker that created that effect has been sold?

#

Currently I just hook into the Card:add_to_deck and Card:remove_from_deck functions and increase/decrease the shop slots by 1 in there

frosty dock
#

i guess you could use an event and wait to resolve it until the shop is exited or rerolled by setting a flag in the corresponding functions

solemn coral
#

Where would I store the flag? I don't want to leave it open to the exploit of "Sell joker, save and quit before rerolling/exiting shop, reopen game and it's forgotten the flag and you permanently get +1 slot"

frosty dock
#

G.GAME

solemn coral
#

I'll give that a try

#

Where do I find the function that rerolls the shop?

crisp coral
#

anything saved to G.GAME persists through reloads

crisp coral
solemn coral
#

I found end_round in state_events.lua, but the closest I can find for rerolls is calculate_reroll_cost in common_events.lua

#

Ah it was in button callbacks. Thank you!

brisk pond
#

how do I make the left text box?

crisp coral
#

in loc_vars, insert a table into info_queue e.g info_queue[#info_queue+1] = G.P_CENTERS.m_glass for Glass Card's description

#

you can find more examples in generate_card_ui of functions/common_events.lua

brisk pond
#

ok thanks

#

and another thing

#

is there a table with all the possibile {C:colors} I can use on this server?

#

I swear I saw it somewhere but I can't find it anymore

frosty dock
brisk pond
#

what if I want to add another color?

frosty dock
#

either you patch that function to include it, or you use colour vars instead

brisk pond
#

suppose I want to use #03F4A5, how do I add it?

#

or do I just type {C:03F4A5}text{}?

gilded blaze
#

use lovely patch

brisk pond
#

ELIF

frosty dock
#

{V:1}text{} and specify the color in loc_vars/loc_def (depending on steamodded version)

#

you can have your vars table look like this

#

{ 'some var', 'some other var', colours = { HEX('03F4A5') } }

brisk pond
#

I have to add here?

frosty dock
#
locked_loc_vars = function(self, info_queue)
  return { vars = { colours = { HEX('03F4A5') } } }
end
#

you need a different function for unlock text

brisk pond
#

ok, at I use {V:1}text{} in the unlock text?

#

I don't think because the game crashes if I do

#

I don't understand what you said

fast badge
#

Show your code

frosty dock
#

^^

fast badge
brisk pond
# fast badge Show your code

I want the Evolve text to have color #DB2109

SMODS.Joker { -- Hereward
  key = 'Hereward',
    loc_txt = {
      ['it'] = {
        name = '{C:red}Hereward',
        text = {'Crea una copia {C:dark_edition}negativa','del tuo {C:purple}Tarot{} piĂč','usato alla fine del round'},
        unlock = {'{}Evolvi{} il Jolly','precedente','per sbloccarlo'},
      },
      ['default'] = {
        name = '{C:red}Hereward',
        text = {'Create a {C:dark_edition}negative{} copy','of your most used','{C:purple}Tarot{} at the end','of the round'},
        unlock = {'{}Evolve{} the previous','Joker to unlock','this one'},
        },
    },
  locked_loc_vars = function(self, info_queue)
    return {vars = {colours = {HEX('DB2109')}}}
  end,
  config = {extra = {Rank = 10}},
  rarity = 2,
  pos = { x = 0 , y = 0 },
  atlas = 'Hereward',
  cost = 7,
  unlocked = false,
  discovered = false,
  blueprint_compat = true,
  eternal_compat = true,
  perishable_compat = true,
  linked_tarot = 'c_justice',
  calculate = function(self,card,context)
    if context.setting_blind then
      PT_ROBINHOOD.RoundStart(card,card.ability.extra.Rank)
    end
    if context.end_of_round and context.game_over == false then
      PT_ROBINHOOD.RoundWon(card,card.ability.extra.Rank)
    end
  end
}
fast badge
#

Wheres your V

fast badge
brisk pond
#

I wrote {V:1}Evolve{} and it crashed whenever I hover it while locked

#

lock_txt -> default -> unlock

fast badge
#



#

ïŒ·ïœïœŽïœŽïœă€€ïœ“ïœˆïœïœ’ïœ…ă€€ïœ”ïœˆïœ…ă€€ïœ…ïœ’ïœ’ïœïœ’ă€€ïœïœ’ă€€ïœŽïœïœˆ

brisk pond
#

of course

fast badge
#

ffs japanese keyboard

brisk pond
#

give me a sec

#

Ok this game is funny, now it doesn't crash but also doesn't color the text

fast badge
fast badge
#

nvm you have

#

dont mind me

brisk pond
#

oh wait

#

it does crash

#

sending the error

frosty dock
#

hm that might actually be a bug

fast badge
#

erm, what the sigma ⁉

#

SMODS and bugs ⁉

brisk pond
#

is there some example of somebody else doing it and not crashing the game?

frosty dock
#

I'm fairly sure it's a bug I need to fix

#

but try on the latest version of steamodded just to be sure

#

yours is outdated

brisk pond
#

i'm on 1.0.0

#

but I trust you

fast badge
#

0601a

brisk pond
#

how do i upload?

frosty dock
#

you're on a commit from June 1st

fast badge
#

git pull

frosty dock
#

just download the source again and replace the files, or git pull if you used git

brisk pond
#

which folder

#

remember I am an absolute idiot when it comes to doing things

frosty dock
#

don't, if you didn't use git to install

wintry solar
#

why is my deck preview pulling the atlas wrong?

fast badge
#

Skill issue

brisk pond
frosty dock
#

alright

brisk pond
frosty dock
#

you need to do it in Mods/Steamodded

brisk pond
#

i just open terminal and write git pull?

#

like this

frosty dock
#

yeah

brisk pond
#

done

fast badge
#

yippee

brisk pond
#
Oops! The game crashed:
main.lua:7015: nativefs not loaded and lovely --mod-dir was not in the save directory!
save dir: C:/Users/cerlo/AppData/Roaming/Balatro, lovely mod dir: C:/Program Files (x86)/Steam/steamapps/common/Users/cerlo/AppData/Roaming/Balatro/Mods
cannot read lovely --mod-dir, exiting

Additional Context:
Balatro Version: 1.0.1f-FULL
Modded Version: 1.0.0-ALPHA-0617b-STEAMODDED
Love2D Version: 11.5.0
Lovely Version: 0.5.0-beta5

Stack Traceback
===============
(3) global C function 'assert'
(4) Lua global 'set_mods_dir' at file 'main.lua:7015'
Local variables:
 save_dir = string: "C:/Users/cerlo/AppData/Roaming/Balatro"
(5) main chunk of file 'main.lua' at line 7020
(6) global C function 'require'
(7) Love2D function at file 'boot.lua:323' (best guess)
Local variables:
 c = table: 0x2286e1a0  {identity:false, version:11.5, accelerometerjoystick:true, modules:table: 0x2286e1c8 (more...)}
 openedconsole = boolean: false
 confok = boolean: true
 conferr = nil
(8) global C function 'xpcall'
(9) Love2D function at file 'boot.lua:362' (best guess)
Local variables:
 result = boolean: true
(10) global C function 'xpcall'
(11) Love2D function at file 'boot.lua:377' (best guess)
Local variables:
 func = Lua function '(Love2D Function)' (defined at line 355 of chunk [love "boot.lua"])
 inerror = boolean: true
 deferErrhand = Lua function '(Love2D Function)' (defined at line 348 of chunk [love "boot.lua"])
 earlyinit = Lua function '(Love2D Function)' (defined at line 355 of chunk [love "boot.lua"])
fast badge
#

boom! pipebomb

brisk pond
#

I knew it

fast badge
#

verify files on steam

frosty dock
#

lol no

brisk pond
#

@frosty dock destroyed my game

frosty dock
#

do you have a custom --mod-dir at all?

fast badge
#

a ha

brisk pond
#

gonna change this to:

frosty dock
#

I'll have to yell at @ejwu for that one, I think

brisk pond
#

remember I am an absolute idiot when it comes to doing things and I have no idea what are you talking about

frosty dock
#

I just need to know from you if you have configured any launch arguments on steam

brisk pond
#

no, i don't think

frosty dock
#

ok

#

will try to get this fixed, in the meantime you can install nativefs to get around that bug

brisk pond
#

where do I put these files?

#

@frosty dock don't leave me

#

@fast badge?

fast badge
#

I'm in fact leaving work rn so I can't

#

I'd assume mods folder

brisk pond
#

I'm sorry to have disturbed you

frosty dock
brisk pond
#

Sending the mod so you can check it without me sending all the code

frosty dock
#

something something lua_reload

#

try not using require

cosmic kernel
wintry solar
#

my god I am big noob

royal ridge
#

oh shit it's horus

remote coral
#

Beats by Clubs

brisk pond
#

i'm gonna faint

brisk pond
wintry solar
#

any UI wizards know how to get this selector to be in line with the tabs in the top right?

zealous glen
#

Or create a fake one and hope it works

frosty dock
#

load works

unkempt thicket
brisk pond
#

Cerlo's questions

wintry solar
brisk pond
wintry solar
#

potentially, although I haven't figured out the dynamic updating of UI stuff yet

glacial thicket
brisk pond
#

what is soul_pos?

unkempt thicket
wintry solar
#

the position on the atlas for floating sprites

brisk pond
#

is there some mod that uses it? so I can check it out

wintry solar
#

it's exactly the same as your normal pos but for a floating sprite in front of the card, like legendary jokers

brisk pond
#

how do I tell which sprite?

wintry solar
#

on your joker atlas

brisk pond
#

how?

wintry solar
#

the same way you tell which sprite the joker uses...

zealous glen
brisk pond
#

can you give a complete answer please?

brisk pond
wintry solar
#

put them in the same file like the base game does, individual image files isn't good practice really

night moat
#

Tested out my code on two different comps with no steam install and they both booted with the local save data. Success! Now to figure out how to distribute it :P

#

My goto is to compute some diffs and just write a python script to apply them, but idk how that would work out with antiviruses

solid salmon
#

by any chance does anyone know how to make +hand and +discard jokers

zealous glen
#

Ultimately it’s all built upon vanilla

#

I think usually the best way to approach modding is to see what exists in vanilla and then what exists in Steamodded

#

Then other mods

unkempt thicket
#

i got all the website stuff done for another mod compact👍

solid salmon
#

what does it mean by this?

frosty dock
#

you're probably better off using lovely with nativefs for a custom mods dir that's next to the executable

maiden phoenix
#

Unless it is meant to be spelt like that

unkempt thicket
#

shhhhh

solid salmon
#

hello

frosty dock
solid salmon
#

...

solemn coral
#

It means there's a syntax error somewhere in your code.

solid salmon
#

ok

maiden phoenix
frosty dock
#

the game is hardcoded to exit if steam is not running

#

however the steam lib is completely optional and the game otherwise doesn't care if it doesn't exist

solemn coral
#

Does anyone know how I would find the tag associated with the current blind? I'm trying to make this joker work (right now it's just hardcoded to return an Uncommon Tag no matter what)

solid salmon
#
    key = 'blue_joker',
    loc_txt = { 
      name = 'Blue Joker'
      text = {'{C:hand}+1{} hand'}
   },
   rarity = 2
   pos = {
      x = 0,
      y = 0
   },
   cost = 5,
   discovered = true
   calculate = function(self, card, context)
          if context.cardarea == G.jokers and not context.before and not context.after then
              local hand = G.GAME.current_round.hands_left + 1
              return {
                  message = localize {
                      type = 'variable',
                      key = a_hands
                      vars = {hand}
                  },
                  hand_mod = hands,
                  colour = G.C.HANDS
                }
           end
       end,

atlas = "blue_joker"
}

SMODS.Atlas {
  key = "blue_joker",
  path = "blue joker.png",
  px = 71,
  py = 95
} ```
#

I don't really understand

#

(btw I am a amateur)

solemn coral
#

Looks like you're missing a comma after the lines containing rarity and discovered

#

Anything inside curly braces { } is a table, and all values within tables have to be separated by commas

solid salmon
#
    key = 'blue_joker',
    loc_txt = { 
      name = 'Blue Joker',
      text = {'{C:hand}+1{} hand'}
   },
   rarity = 2,
   pos = {
      x = 0,
      y = 0
   },
   cost = 5,
   discovered = true,
   calculate = function(self, card, context)
          if context.cardarea == G.jokers and not context.before and not context.after then
              local hand = G.GAME.current_round.hands_left + 1
              return {
                  message = localize {
                      type = 'variable',
                      key = 'a_hands',
                      vars = {hand}
                  },
                  hand_mod = hands,
                  colour = G.C.HANDS
                }
           end
       end,

atlas = "blue_joker"
}

SMODS.Atlas {
  key = "blue_joker",
  path = "blue joker.png",
  px = 71,
  py = 95
}```
#

I added some commas but i'm getting the same error

frosty dock
#

So I just patched out the part where it quits the game

solid salmon
#

parchmentengineer?

solemn coral
#

I'm not sure, I'm working on my own code right now

solid salmon
#

ok

night moat
#

Luasteam is quite simple luckily

#

Any tips on setting up lovely and nativefs? Does loading nativefs first let lovely use a custom dir or something? Im unfamiliar with the software and Love2d are pretty limited

solid salmon
solid salmon
#

this is the error

spice scroll
brisk pond
#

can I change the soul_pos midgame?

#

do I have to use soul_pos = function?

outer hedge
#

how can i get the joke to score for only some ranks, i can't figure it out

narrow pollen
#

that feeling when you really want to code a joker's effect, but you don't have an inspiration for the design...

and then it hits you

crisp coral
#

odd todd even steven yaoi

outer hedge
narrow pollen
#

Name: The Climbers
Effect: If played hand contains hand of higher level, upgrade played hand once

outer hedge
narrow pollen
#

so if you play three of a kind with a leveled-up pair, it will level up three of a kind.

outer hedge
narrow pollen
#

no

#

if you had a level 1 full house, but a level 4 two pair

#

the next three full houses would automatically upgrade as if you got a space joker proc

outer hedge
narrow pollen
#

and yes, this would make pluto into a quasi-black hole

#

because every hand contains high card.

solid salmon
#

@lament zealot

#

I added your jokers to stupidity

#

But I need it to be tested

lament zealot
solid salmon
#

1.0

#

Also I need to make one more fix

outer hedge
lament zealot
# solid salmon 1.0

Does the mod have back compat. to 0.9.8, like the Vouchers mod? Otherwise, womp womp.

solid salmon
#

No but I'll check with betmma

#

Bettma said that the latest SMOD version seems to be able to support 0.9.8 mods

#

Imma sleep

brisk pond
#

how do I change soul_pos based on a function?

crisp coral
maiden veldt
#

is there any way to change the weights of booster packs? if so, how?

stray warren
#

Ok, so I was able to get ghost_cola to only show up after diet_cola is sold. But when Ghost Cola is sold, it can still show up again. However, if I just change the flag back, then Diet Cola can spawn again. How would I juggle two different flags to manage these separately but also together, so that when Ghost Cola is sold, neither can show up again?

--In my Ghost Cola joker definition
yes_pool_flag = "diet_cola_sold",


--Code for the diet cola flag
local BackApply_to_run_ref = Back.apply_to_run
function Back.apply_to_run(arg_56_0)
    BackApply_to_run_ref(arg_56_0)
    G.GAME.pool_flags.diet_cola_sold = false
    G.P_CENTERS['j_diet_cola']['no_pool_flag'] = 'diet_cola_sold'
end

-- Modifies the `diet_cola_sold` flag
local calculate_joker_ref = Card.calculate_joker
function Card:calculate_joker(context)
    local ret = calculate_joker_ref(self, context)

    if self.ability.set == "Joker" and not self.debuff then
        if context.selling_self then
            if self.ability.name == 'Diet Cola' then
                G.GAME.pool_flags.diet_cola_sold = true
            end
        end
    end

    return ret
end
crisp coral
solemn coral
#

Thank you so much!

#

Pulling that joker out of the scrap bin and giving it another shot

crisp coral
#

you may need to make it a tag object? i'm looking at the create_UIBox_blind_tag function here

solemn coral
#

All right. I've been poking around the tag code for that and other jokers, so I think I see how that should work.

outer hedge
#

I'm gonna make an "Old Passport" joker but idk what it should do

sly forge
#

hey, does anyone know why the game audio becomes weird when you play a big hand? in this save, try playing a full house at 1x speed and pressing Escape before the hand finishes scoring, the background music will be weird

narrow pollen
#

okay, so where in alpha do you define a joker's compatibility with blueprint and brainstorm? mine works, but gives "incompatible."

crisp coral
#

blueprint_compat in the joker def

narrow pollen
#

gotcha

lament zealot
wintry solar
narrow pollen
#

...jesus christ this is a powerful combo--

#

the modded joker upgrades a hand if it contains a hand type of higher level than the played hand type... and all hands played contain high card.

brisk pond
#

is there a way I can change soul_pos during the game?

#

I tried soul_pos = function() but it crashes

frosty dock
#

you can change the soul_pos table directly at any time, but it will apply to all instances of the sprite

#

otherwise you can mess with the sprite object

remote coral
brisk pond
#

every time I try to include the word function at the right of soul_pos the game cries

narrow pollen
#

and even if you have the perfect hand

crisp coral
#

not as broken as you'd think since Burnt Joker is a Rare

narrow pollen
#

i mean, it's a "broken if you get it" synergy

#

which isn't a bad thing

crisp coral
#

like blue seals are still faster imo

narrow pollen
#

just a thing that i kinda like about a joker i made

crisp coral
#

it is a synergy yea but it's not that broken

narrow pollen
#

well, i initially never said it was broken; just powerful. and i think even if it isn't broken, it's still powerful

#

a good core to build a run around

brisk pond
#

PT_soulPos(card) is a function that returns an integer based on card.ability.extra.Rank, which is the x pos in the sprite

frosty dock
#

you'll probably want to use an update function to track that dynamically

#

soul_pos is a table and not a function, that's just how it works

brisk pond
#

how do I write so that every istance of joker acts independently from each other?

brisk pond
royal ether
#

does it not change soul_pos or does the image not change

#

very important distinction

brisk pond
#

checking it now

royal ether
#

if its the latter, i think its because you need to do something with the soul Sprite object associated with the card

brisk pond
#

soul_pos changes, image doesn't change

crisp coral
#

because the Sprite is only created once when the card is created, any updates to the cards won't reflect onto the Sprite unless you modify it

brisk pond
#

ok, how do I change the sprite?

royal ether
#

honestly i got no clue because ive never worked with the sprite stuff

#

try looking thru card:set_sprites() and see how base game sets sprites

#

then modify it from there

frosty dock
#

should be something like card.children.floatingSprite:set_sprite_pos(...)

brisk pond
#

I did this and now it works

#

but a new problem appeared

#

when a new RobinHood Joker shows up, it has the latest updated sprite instead of the first.
When I rank up that new Joker it goes back to normal, which means I just have to call PT_soulPos when it spawns to solve the bug

#

so now the question is

#

how do I call a function when a Joker spawns?

zealous glen
#

set_ability

brisk pond
#

First image is what appears in the shop.
That Joker is Rank 1, and when I hover it (I put PT_soulPos(card) inside loc_vars), it comes back to Rank 1.
But when it first appears it shows Rank 2

#

After I hover it, it is Rank 1

zealous glen
brisk pond
#

how?

#

I read the message

zealous glen
#

It’s in the Steamodded docs

#

Just pass it when building the Joker

#

It’s a function

brisk pond
#

I don't know what the function does, I tried to read the game docs and I didn't understand

frosty dock
#

Card:set_ability() is called when the card is created

brisk pond
frosty dock
#

you put set_ability on the joker object itself, like loc_vars

brisk pond
#

i'm going insane

fast badge
#

I think that wont work

#

just a wild guess tho

#

hope that helps!

frosty dock
brisk pond
#

thanks, I really understood a lot from that

#

I'm gonna cry now

frosty dock
#

I'm referring to the arguments

#

the first argument passed to set_ability isn't card

brisk pond
#

got it

solid salmon
#

@lament zealot

#

I need the red joker and blue joker 1x png

solid salmon
#

Does anyone have the source code of a joker pack

outer hedge
royal ether
#

for messages, you can just have an extra card_eval_status_text before your return that does the message of the one that return doesnt do

sturdy glen
#

How can I make a joker multiply chips :p

gilded blaze
sturdy glen
#

thanks :)

gilded blaze
near ivy
sturdy glen
#

?

dim raptor
#

the question they asked was how to do it not if they should

outer hedge
royal ether
#

red isnt a message typwe

crisp coral
#

well you are. returning it

royal ether
#

also that

outer hedge
#

i put it in another function i remembered i call when the card gets destroyed

outer hedge
brisk pond
#

why this happens when I don't use tarots?

crisp coral
#

because you returned {}

brisk pond
#

thanks

outer hedge
brisk pond
#

like this

outer hedge
#

i think return true works but correct me if i'm wrong

outer hedge
brisk pond
#

i solved that problem by not using return, thanks

outer hedge
#

also i like this circle joker i made

2 and 7 come from 22/7 which is a unreasonably good approximation of pi

3 comes from 3.14 per obvious reasons

crisp elbow
#

Talisman with the 0.9.8 compat in the new SMOD update is still broken right?

#

cause Talisman does something that the other mods don't like

mellow sable
#

It depends on which 0.9.8 mods you select

#

I tested it before with Cryptid, Codex, and more fluff and it didn’t break

#

If you’re talking about the save reloading bug I fixed that yesterday

crisp elbow
#

I've been trying it currently with a mix

#

because Talisman just tends to crash Codex for me (i'm using the git version tho)

#

which is git cloned

#

at least I was testing with DX tarots

mellow sable
#

Unfortunately mod devs have to manually update certain parts of the code to work with Talisman

#

It’s a restriction in Balatro’s programming language that I can’t really make easier

#

If you don’t plan on breaking e308 you can stop the crashes by disabling the score unlimiter in settings and just using the animation skipper

crisp elbow
#

Ah cool

#

and I know Reverie doesn't work for sure

#
local function loadCursesModule()

    local js_mod = SMODS.findModByID("JeffDeluxeConsumablesPack")

    -- Load modules
    assert(load(love.filesystem.read(js_mod.path .. "source/curse.lua")))()
    
    -- Add curses
    setup_curses()
end

And for some reason this code chunk with DX Tarots is causing a crash on load

#

I believe I can make a small patch if all the other code doesn't get fucked

solid salmon
#

guys how do i make a card pack

regal wolf
solid salmon
#

like the buffon pack

#

hello?

lament zealot
solid salmon
lament zealot
outer hedge
#

this passport card might be a bit op

solid salmon
#

can someone make art for my jokers

zealous glen
#

You can

#

I believe in you

solid salmon
#

I tried

#

It ended up ugly

zealous glen
#

Keep trying

fallen tendon
#

You can use placeholder art for now

solid salmon
#

ok

#

is there a thread where i can learn how to make joker cards

stray warren
#

the steamodded documentation has a section on it I believe

gritty mortar
#

is there a way to add seals and enhancements to the debug menu coding in controller.lua like you can use Q to go between editions of foil through negative. i tried but i dont actually know coding just work off what i see in the files and such

sly forge
#

try the DebugPlus mod

gritty mortar
#

well thats pretty much exactly what i was looking for, when i searched for debug i didnt see it i guess it wasnt relevant enough for the search in the modding channel

solid salmon
#

How do I fix this?

stray warren
#

There's not really any way we can know how to fix that unless you provide some code or output logs

solid salmon
wintry solar
#

are you overwriting Card:update here?

stray warren
#

Yeah it doesn't look like you use a hook there

solid salmon
#

what hook?

zealous glen
#

To create a hook you create a reference to a function then overwrite it but include the reference inside

wintry solar
#

you overwrite the Card:update function from the base game

zealous glen
#

If you overwrite the existing function, everything that assumed it worked as it did breaks

#

Which in this case is the entire game

#

Rather, you want to add to it

wintry solar
#

but if it's just for individual jokers you can add them as arguments when you create it

solid salmon
#

can you some me the fix? (im still rather new at being a mod dev)

wintry solar
zealous glen
#

So first you save a reference to the original function in a variable

Then you overwrite the original but include the reference inside

wintry solar
#

just define it the same way you define calculate functions

stray warren
#

For example, in your above code:

local card_update_ref = Card.update
Card.update = function(self, card, context)
  --code here
  return card_update_ref(self, card, context)
zealous glen
#

Something like that. Whether you return the ref or not depends on what you want to do

#

Sometimes you call the ref first then edit the output, and return that

wintry solar
#

in fact

solid salmon
#

ok i'll test it now

wintry solar
#

what are your update functions even doing

solid salmon
#

adding hands to the current amount

#

like burglar but no consequences

wintry solar
#

I don't think you want to use update for that

solid salmon
#

then what?

wintry solar
#

add_to_deck(self, card, from_debuff) this would be better, right?

solid salmon
#

so i replace card.update with that

stray warren
#

@solid salmon do you know how to access the balatro source code for reference?

wintry solar
#

no

solid salmon
#

No

wintry solar
#

you define it in your joker like the calculate function

stray warren
#

Well, i'm not gonna distribute it, but I can send a link to a guide

wintry solar
#

I always find it fascinating seeing some of the people who decide to try and makes mods

stray warren
#

Gotta start somewhere, you know?

#

I still barely have a clue what I'm doing lol

solid salmon
#

I made 3 that works

#

(i think)

stray warren
#

Maybe one day thunk will release steam workshop support, or official modding support, something like that

solemn coral
#

It's been said before about so many skills, but the best way to learn how to make mods is to make mods

#

My first mods with my first games weren't that good at all, and I don't think I ever made anything worth publishing

#

But my experience there allowed me to do better the next time I tried modding a game, and that experience helped me for the next time, and so on

solid salmon
#
Card.update = function(self, card, context)
  return card_update_ref(self, card, context)
    if self.ability.name == 'Blue joker' and not (context.blueprint_card or self).getting_sliced then
        G.E_MANAGER:add_event(Event({func = function()
            ease_hands_played(self.ability.extra)
            card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize{type = 'variable', key = 'a_hands', vars = {self.ability.extra}}})
            return true end }))
        end
    end```
#

so how do make this have give +1 hand

#

and make it for discards

solemn coral
#

Is that for Steamodded 0.9.8 or 1.0?

solid salmon
#

1.0.0

solemn coral
#

Do you want this to happen whenever you play a hand, or just passively increase the number of hands like the Grabber voucher does?

solid salmon
#

like grabber

solemn coral
#

Okay. So, to make it work like that, the easiest way to do that is to modify the value of G.GAME.round_resets.hands

#

Instead of making something that changes when the joker is updated or calculated, you'll want two functions - one that gives you +1 hand when you buy the joker, and one that gives you -1 hand when you sell the joker

solid salmon
#

ok

#

how do i do that

solemn coral
#

Wait hold up. You might be in luck

wintry solar
#

add_to_deck(self, card, from_debuff) oh look a handy function

#

take a look at the docs for the functions you can add to your joker

solemn coral
#

So, there's two ways to do this. There's the way that Ermel is suggesting right now, which is the correct way.

#

Alternatively, it looks like the game is set up so that if you have a joker that has a value of self.ability.h_size, it will automatically adjust the hand size for you.

#

This will work for literally just this specific effect you're trying to create here and no other effects, but it'll work.

solid salmon
#

i need to see an example from Eremel

solemn coral
#

Here, I can also share an example

solid salmon
#

ok

solemn coral
#

Okay I was wrong my way wouldn't have worked

#

h_size refers to how many cards you draw into your hand, not how many hands you have to play

#

You have to do this with the add_to_deck function, which I'll get an example for you in a second

solid salmon
#

zam

solemn coral
#

All right here we are

#
table.insert(stuffToAdd, {
    object_type = "Joker",
    name = "blueJoker",
    key = "blueJoker",
    config = {extra = {}},
    pos = {x = 0, y = 0},
    loc_txt = {
        name = 'Blue Joker',
        text = {
            "+1 Hand"
        }
    },
    rarity = 1,
    cost = 5,
    discovered = true,
    blueprint_compat = true,
    atlas = "jokers",
    
    -- All the stuff above the line is just the standard joker setup, use whatever your mod has already
    -- The stuff below this line are the relevant functions
    
    add_to_deck = function(self, card, from_debuff)
        G.GAME.round_resets.hands = G.GAME.round_resets.hands + 1
        ease_hands_played(1)
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.GAME.round_resets.hands = G.GAME.round_resets.hands - 1
        ease_hands_played(-1)
    end
})```
wintry solar
#
add_to_deck = function(self, card, from_debuff)
    -- function here
end,
solemn coral
#

I actually have to run now so I can't help you but theoretically you should be able to figure it out yourself from here

solid salmon
#

ok

wintry solar
#

yeah parchment got you

solid salmon
#

wait so do i just remove calculate?

wintry solar
#

well does your joker do any sort of calculation?

solid salmon
#
    key = 'red_joker',
    loc_txt = { 
      name = 'Red Joker',
      text = {'{C:red}+1{} discard'}
   },
   rarity = 2,
   pos = {
      x = 0,
      y = 0
   },
   cost = 5,
   discovered = true,
   add_to_deck = function(self, card, from_debuff)
        G.GAME.round_resets.discards = G.GAME.round_resets.discards + 1
        ease_hands_played(1)
end,
    remove_from_deck = function(self, card, from_debuff)
        G.GAME.round_resets.discards = G.GAME.round_resets.discards - 1
        ease_hands_played(-1)
end
}```
#

the cards ae invisible

wintry solar
#

show all your code

solid salmon
wintry solar
#

you still have an update function...

#

so you're still overwriting it

solid salmon
#

yeah im just trying to make a chip version of swashbuckler

wintry solar
#

sure but the way you are doing it is wrong

#

and you're overwriting the base update function which I think is why you have no cards

solid salmon
#

oh

#

can you show me a quick fix then?

wintry solar
#

we literally just went through this

solid salmon
#

oh the ref

wintry solar
#

no put it in your joker

solid salmon
#

oh

#
  key = 'scalper',
  loc_txt = {
      name = 'Scalper',
      text = {'Adds {C:blue}+5 sell value of all other owned Jokers to Mult'}
  },
  rarity = 1,
  pos = {
      x = 0,
      y = 0
  },
  cost = 5,
  discovered = true,
  calculate = function(self, card, context)
    if G.STAGE == G.STAGES.RUN then
        if self.ability.name == 'Scalper' then
            local sell_cost = 0
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] ~= self and (G.jokers.cards[i].area and G.jokers.cards[i].area == G.jokers) then
                    sell_cost = sell_cost + G.jokers.cards[i].sell_cost
                end
            end
            self.ability.mult = sell_cost
        end
    end
end
}```
wintry solar
#

not as calculate

#

you need the right method

solid salmon
#

but i'm going the right way

wintry solar
#

yes

solid salmon
#

ok

#

what is the right method

wintry solar
#

hopefully your cards are back now though

#

look at the docs and figure it out

#

it'll be better for you to work it out yourself and understand it rather than just copy what you're told

solid salmon
#

it works

#

ok

wintry solar
#

it'll be sort of functional in calculate but it's not the right place for it

lament zealot
pine trellis
#

Hi all, new to modding here. I'm working on a simple mod that just replaces the planets, and I had the mod working fine in Steammodded 0.9.8, but now I'm trying to understand if in 1.0.0 if there's a way to take ownership of a consumable and only replace its name in loc_txt without also having to replace its text since I'm not altering the text value. I tried naively just setting text equal to the object within G.localization.descriptions like below, and that got me an error message of "functions/misc_functions.lua:1866: attempt to index field 'colours' (a nil value)"

SMODS.Consumable:take_ownership('c_mercury', {
    atlas = "Tarot",
    loc_txt = {
        name = "New Planet name",
        text = G.localization.descriptions.Planet.c_mercury.text
    }
})
solid salmon
#

i've done that

#

Guys i forgot how to add releases to github

crisp coral
#

i don't have an example on hand but try looking at some 1.0.0 mods

crisp coral
#

it's the g.localization.descriptions.Planet thing that's the issue

#

mb

pine trellis
#

tyvm Myst, I just found a good example in the SixSuits mod of how to override process_loc_txt in setting up a Planet that's working for me

solid salmon
#

i forgot how to add mods to github

pine trellis
# unkempt thicket i do this and it works

At least part of the problem I was having (I think, very new, don't know what I'm doing) is that the planet text definitions use some maybe variables like {S:0.8,V:1} in the text. Removing those stopped the game from crashing for me, my guess is that I needed to return some correct values in loc_def, but I also didn't get that to work because, again, no idea what I'm doing. Taking what I need from here works though https://github.com/Aurelius7309/SixSuits/blob/master/SixSuits.lua#L263-L288 (thank you person who wrote this) which seems to overwrite process_loc_text successfully for me, and that generate_ui = 0 part is also vital

brisk pond
solemn coral
#

I believe those are 1.0.0 only, yeah

brisk pond
#

great