#💻・modding-dev

1 messages · Page 144 of 1

weary jungle
#

to accurately time a card to do things

#

i want it to happen every like 5 seconds, and stoping after 1 min

#

but it isnt a joker, its a function thats called when gros mitchel/cavendish dies

whole jungle
#

So, you need an update loop on something else

weary jungle
#

yes

whole jungle
#

Well, is there a way to use that one little joker guy who talks during the goal screen?

hardy viper
#

nothing? that doesn't pause the thread

#

why don't you just use event manager for this im confused

#

it seems like it'd work fine for this and it's very well documented

weary jungle
#

it has to be like accurate

whole jungle
#

Why wouldn't it be accurate, though?

weary jungle
#

i heard it was dependant on game speed

#

is it not?

hardy viper
#

not sure but you can always just implement the delay yourself

whole jungle
#

I think they're trying to implement the delay

weary jungle
#

would this work

hardy viper
#

"delay = 0.0"

weary jungle
#

well its immediate so no delay

hardy viper
#

why are you calling delay

#

that's not even a luajit function to my knowledge and love.timer.sleep() would be better anyways

weary jungle
#

it was "after" but i changed it to immediate

hardy viper
weary jungle
hardy viper
#

oh wait huh

#

that would delay an event (wrong)

weary jungle
#

also love.timer.sleep() freezes the gsme

hardy viper
#

but since you didn't supply any events it did nothing

hardy viper
#

that's what sleeping does

#

i misunderstood the purpose of delay

#

but again you're using it wrong and you should just implement the delay yourself

weary jungle
#

delay works but its definitly not 5 seconds

hardy viper
#

yes because of gamespeed

hardy viper
#

cough

weary jungle
#

but i dont have an update

hardy viper
#

you don't need an update

#

events are updates

#

called every frame until they return true

#

not called if they have a delay

#

and the delay isn't past

#

so just make a bland event that'll return true once a certain amount of time has passed, and of course do something after that time as well

weary jungle
#

i might undestand

#

dont count on it

#

i ont think i understood

#

WAIT IM DUMB

worthy stirrup
#

Can I get some help with this

weary jungle
#

do you have an SMODS.Atlas{} for jokersheet?

worthy stirrup
#

Yes

weary jungle
#

can you send it?

worthy stirrup
#

I’ll get more code in a second, my laptop decided to update bc it hates me

#

My apologies

weary jungle
#

how do i make a joker move to the center of the screen like a consumable

wooden nexus
#
    key = 'nil',
    chips = 150,
    mult = 10,
    l_chips = 50,
    l_mult = 5,
    example = {
        { 'S_A',    true, 'm_SCB_blank_enhance' },
        { 'S_A',    true, 'm_SCB_blank_enhance' },
        { 'S_A',    true, 'm_SCB_blank_enhance' },
        { 'S_A',    true, 'm_SCB_blank_enhance' },
        { 'S_A',    true, 'm_SCB_blank_enhance' },
    },
    loc_txt = {
        name = 'nil',
        description = { '5 Blank Cards' },
    },
    visible = false,
    evaluate = function(parts, hand)
        local blanks = {}
        for i, card in ipairs(hand) do
            if card.config.center_key == 'm_SCB_blank_enhance' then 
                blanks[#blanks+1] = card
            end
        end
        return #blanks >= 5 and {blanks} or {}
    end,
}```
#

It's based on the bulwark code

worthy stirrup
wooden nexus
#

I changed it to stone like bulwark and regardless of what i do, it crashes with that nil value

worthy stirrup
# weary jungle can you send it?
--Creates an atlas for cards to use
SMODS.Atlas {
  -- Key for code to find it with
  key = "JokerSheet",
  -- The name of the file, for the code to pull the atlas from
  path = "JokerSheet.png",
  -- Width of each sprite in 1x size
  px = 71,
  -- Height of each sprite in 1x size
  py = 95
}
whole jungle
#

Crimson, why is your key 'nil'

worthy stirrup
#

heres the JokerSheet as well

#

Im trying to get the blueprint one

wooden nexus
#

it doesn't matter what i put the key to btw

whole jungle
#

That's fair

wooden nexus
#

I tried with my test key word and it still breaks

worthy stirrup
#

My joker art seems to become Jimbo after the number 2 in the pos for a joker card

--Creates an atlas for cards to use
SMODS.Atlas {
  -- Key for code to find it with
  key = "JokerSheet",
  -- The name of the file, for the code to pull the atlas from
  path = "JokerSheet.png",
  -- Width of each sprite in 1x size
  px = 71,
  -- Height of each sprite in 1x size
  py = 95
}

--- SKIP AHEAD TO NON WORKING PART ---

SMODS.Joker {
  -- How the code refers to the joker.
  key = 'AIJoker',
  -- loc_text is the actual name and description that show in-game for the card.
  loc_txt = {
    name = 'Ai Joker ',
    text={
      "Test"
  },
  config = { extra = { worth = 2 } },
  loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.extra_value } }
  end,
  rarity = 3,
  atlas = 'JokerSheet',
  pos = { x = 3, y = 0 },
  -- Cost of card in shop.
  cost = 10,
  calculate = function(self, card, context)
    return {
      message = "Scammed!"
    }
  end
}
}
solar eagle
#

probably because there's no art there

worthy stirrup
#

I wish there was a way to just make the text smaller so it doesnt flood chat

solar eagle
#

0, 0 is the top left

worthy stirrup
#

yea

solar eagle
#

so x = 3, y = 0 is the fourth joker from the left in the top row

#

make sure u have art there

worthy stirrup
#

this is the sheet

#

I have no idea what is causing this

#

it happens to every joker above the number 2

#

note, the first card is marked as 0

#

so techincally, it doesnt work for 4 or more cards

solar eagle
#

could just keep ur atlas to 3 cards per row

#

solves the problem

worthy stirrup
#

so, just make another row and move the cards there

faint yacht
#

...are you making sure that the content of the 1x and 2x atlases match, just differing in resolution?

worthy stirrup
#

They match

violet void
weary jungle
#

gros mitchel jumpscare

faint yacht
#

Hey, you can do fun stuff with what shows up whether a player uses Pixel Art Smoothing if the atlases in 1x and 2x have different stuff in the respective areas. 😛

violet void
#

I wonder why is that even an option tho, why not just x2

faint yacht
#

¯_(ツ)_/¯

pulsar flower
#

how would i add line breaks to my mod's description

solar eagle
#

\n i imagine

pulsar flower
#

that's what i tried but nope

wooden nexus
solar eagle
wooden nexus
#

oh ok

#

i have no clue what's going on

pulsar flower
solar eagle
#

try setting it to an array

#

{ "line1", "line2" }

#

no clue if this'll work

faint yacht
#

Descriptions via .json or the legacy header are automatically wrapped.

solar eagle
#

no way to manually do it?

faint yacht
#

If you want to go custom, though, use a localization entry.

pulsar flower
#

oh localization

#

the one thing i didn't set up clueless

tight thistle
#

my mod, of course

weary jungle
#

is there a voucher template

solar eagle
#

how would i access the current hand's chips to multiply?

#

i'd like to do something similar to xmult but i dont think it exists for chips by default

faint yacht
#

hand_chips and mult are globals that hold values for currently scored chips and mult respectively.

solar eagle
#

perfect!

#

and then would i have to create the animation or whatever it's termed as from scratch?

tight thistle
#

hello! i have a question for balance, is this too many rounds for the effect? for context, once the card "rots", it turns into another joker

#

would 4 or maybe even 3 rounds still give the player a fair chance to make a good amount of gold cards?

solar eagle
#

its a 1 in 4 chance

#

id say thats fine

tight thistle
#

okay! fair enough!

solar eagle
weary jungle
#

ease_dollars() probably

tight thistle
solar eagle
#

looks like it

solar eagle
tight thistle
#

i havent been able to look into the balatro source code to find much myself

#

ah, got it

solar eagle
#

found it under immolate actually

tight thistle
#

ohh yeah immolate makes sense

ionic verge
#

how do i get the number of joker slots i have?

normal crest
#

G.jokers.card_limit sounds right to me

#

But that's out of memory, could be wrong

#

Maybe G.jokers.config.card_limit

hardy viper
#

ya it's in config

solar eagle
#

ooh ok

#

lemme see

ionic verge
solar eagle
#

would i then do "Xchips_mod"?

cerulean rose
#

for old calc yeah

solar eagle
#

for wha

#

im new to balatro modding sry

cerulean rose
solar eagle
#

ahhh

#

yea thats what im usin

cerulean rose
#

then it's just xchips

solar eagle
#

would this be valid then? message = localize { type = "variable", key = "a_xchips", vars = { card.ability.extra.x_chips } },

#

i know a_xmult, a_mult, and a_chips exist by default

cerulean rose
#

you don't need to use message with bettercalc

solar eagle
#

ok

#

i am using oldcalc though

cerulean rose
#

then u need to use Xchips_mod

solar eagle
#

ok thanks

#

sorry

faint yacht
#

Xchip_mod, actually.

solar eagle
#

thank you all!

sturdy compass
#

Oh wow I got pinged a lot while I slept lmao

#

It's War I need to finish off. Some of the Spectral cards I couldn't access destroy methods til now due to SMODS taking ownership and implementing its own that I need to patch into

#

Interesting, I'll give this a shot Actually I'm not sure how this would translate to what I want since it's going through a pack opening state instead of just an animation

solar eagle
#

with making an edition, i'd like to fully replace how each card looks. poking at the smods wiki i found this:

draw = function(self, card, layer)
    
end,```
but i'm not sure how to tell it which image to draw and when. poking at the balatro source was not helpful unfortunately :(
#

so far i know i have to switch over the suits and ranks of the appropriate card - i know how to do this - but i'm not sure how to tell it what to draw

glossy kestrel
#

is there any case in which multiple things are sold at once I'm not thinking of?

tight thistle
#

holy cannoli pinkmoth

solar eagle
#

i dont think so?

#

unless there's a mod that allows selling multiple things at once, maybe

#

or something that sells all jokers/consumables in inventory

glossy kestrel
#

alright, thank you

glossy kestrel
tight thistle
#

nothing, just surprised to see someone i follow

glossy kestrel
#

haha

#

nice pfp

tight thistle
#

thank you!

glossy kestrel
#

what does it do in the game

tight thistle
#

oh i havent thought of an effect for it yet haha, my friend who made it though said something like
"1.2x Mult per heart played in a non-flush hand"
not sure what he meant by it, but it sounds pretty strong!

glossy kestrel
#

so kinda like a bloodstone x seeing double

#

that does sound fun

whole jungle
#

Is there a fast reload method for modding?

sturdy compass
#

I think holding 'm' with debugplus installed reloads, only problem is that it'll probably start spamming m's in your vscode when the window closes lol

whole jungle
#

Oh cool, thanks

worthy stirrup
#

bro, its still not working

--Creates an atlas for cards to use
SMODS.Atlas {
  -- Key for code to find it with
  key = "JokerSheet",
  -- The name of the file, for the code to pull the atlas from
  path = "JokerSheet.png",
  -- Width of each sprite in 1x size
  px = 71,
  -- Height of each sprite in 1x size
  py = 95
}

SMODS.Joker {
  -- How the code refers to the joker.
  key = 'AIJoker',
  -- loc_text is the actual name and description that show in-game for the card.
  loc_txt = {
    name = 'Ai Joker ',
    text={
      "Test"
  },
  config = { extra = { worth = 2 } },
  loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.extra_value } }
  end,
  rarity = 3,
  atlas = 'JokerSheet',
  pos = { x = 0, y = 1 },
  -- Cost of card in shop.
  cost = 10,
  calculate = function(self, card, context)
    return {
      message = "Scammed!"
    }
  end
}
}
#

its still showing up as jimbo

frosty dock
#

config and everything after it is inside loc_txt

worthy stirrup
#

omfg, i am an idiot, i do need to format it

#

thank you so much

#

Okay, two things, am i able to hide the "Crypto Jokers" tag when you hover over the joker, and how do i change only the sell price but not buy price

solar eagle
#

i believe the crypto jokers tag is just the name of ur mod

#

sell but not buy, not sure? it might be a joker property

worthy stirrup
frosty dock
#

yeah so?

#

let players choose if they want to see it

#

if they want it for other mods, chances are they want it for yours too

worthy stirrup
#

the whole point of this one joker is to look like the vanilla blueprint

#

its a scammer card

frosty dock
#

ok

#

you can set no_mod_badges = true on the joker

worthy stirrup
#

thank you

sturdy compass
#

Ok back to the grindstone. Now that Lovely 0.7 is out, how exactly do I set an SMODs file as a target?

sturdy compass
#

Sick, thank ya

#

I replaced the version.dll last night but idk if there's anything more I need to do

pulsar flower
#

is there something like hiker permanent chips but for mult?

#

not something i'm particularly excited to implement if it doesn't already exist in smods or something

sturdy compass
#

It does not exist. I also wanted something like that and had to do that myself

pulsar flower
#

aw

#

how'd you do it?

worthy stirrup
#

okay, ive worked up this, how could I make the little tab that joker has appear

  calculate = function(self, card, context)
    local other_joker = nil
      for i = 1, #G.jokers.cards do
        if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i+1] 
        end
      end
        if other_joker and other_joker ~= card and other_joker.config.center.blueprint_compat then
          card.ability.blueprint_compat = 'compatible'
      else
          card.ability.blueprint_compat = 'incompatible'
      end

    return {
      message = "Scammed!"
    }
  end
}
zenith ridge
#

I'm inclined to say rare.

Have you tested what happens if you have two in your slots and they activate at the same time?

sturdy compass
# pulsar flower how'd you do it?

Honestly just a few patches. I created a new variable in the Card object definition and then included that variable in get_chip_mult. The rest of what I did was making it visible in the card description via localization and more patches to playing_card loc_vars

violet void
pulsar flower
#

i'd keep it rare and without the hand penalty

#

hm if you have multiple then it could be an issue yeah

pulsar flower
#

i was thinking i'd have to mess with card calculation which sounds like a pain since bettercalc exists

tight thistle
#

speaking of mod badges, is there a way to add extra modded badges to jokers? i want to label the Jimbus Company jokers under "Sinner, Canto I, Canto II, Canto V, etc."

violet void
pulsar flower
#

ohhhhhh

#

i see yeah that's nice

runic radish
#

i have some fun joker ideas if anyone wants them

frosty dock
foggy carbon
#

First time I'm actually asking for balancing help

My plan for this joker is, every 10 rounds, the joker creates a Blueprint or Brainstorm, and then doubles the number of rounds that it takes before generating the next one.

Is this reasonable for a rare, or should I attach a probability? Does the answer change if the generated jokers are negative?

pulsar flower
#

sounds like it stops being worth it after the first one and even then 10 rounds is a really long time

frosty dock
#

if it's not a negative, I could reason with it being uncommon

worthy stirrup
#

how does blueprint do the little tab thing with it being compatitble, i cant find how its done, im looking through the code

zenith ridge
runic radish
#

maybe make it "Every round, has a 1/20 chance of making a blueprint" and call it the "Designer" or "The architect"

#

10 rounds is 3 whole antes

pulsar flower
#

now it sounds possibly busted

#

feels like really hard to balance

runic radish
#

could also give it a stupid hard unlock condition

wintry brook
frosty dock
#

I'd say uncommon and self-destructs to create a blueprint or brainstorm after 10 rounds

runic radish
#

like "have 3 blueprints"

worthy stirrup
zenith ridge
sturdy compass
runic radish
#

maybe, makes a blue print ever ante, has a 1/3 chance of self destructing each round

foggy carbon
#

ooh, I like that one

sturdy compass
runic radish
#

could try to blast through with tags, and stuff, but that also has a downside inherent

frosty dock
#

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

sturdy compass
#

oh lmao

runic radish
#

or maybe "Consumes $5 every round, after consuming $25, creates a blueprint"

#

tie it in to another mechanic

#

god if you get that as a rental that'd be brutal

foggy carbon
#

I'm making jokers based on characters and this was supposed to be one based on Gadget from Rescue Rangers. Good with tech so builds things

runic radish
#

Yuri Joker: x1 multiplier for each queen played a hand (2 queens -> x2 multiplier)

zenith ridge
#

At least my first attempt at making a joker taught me how to crash the game on a card trigger condition through a joker.

runic radish
#

wait. that's really funny

zenith ridge
#

Card = self in the if seems to do it.

runic radish
#

"antimatter card." turns the leftmost joker negative at the end of the turn. Has a 1/100 chance of removing all cards from your deck each round

foggy carbon
#

I'd say make it so that each queen gives +1 mult for every queen played.

So if you play two queens, each one gives +2 mult.

If you play three, each one gives +3. etc.

runic radish
#

each hand

worthy stirrup
#

what is main_end in blueprint

outer dew
#

Trying not to bug since I leave and rejoin this server all the time to not clutter stuff up 😭
this is a basic question, how to I refer to my own modded cards when doing create_card

#

if context.selling_self and card.ability.extra.examplevar > 24 then
local new_card = create_card('ExampleName', SMODS.Joker, nil,nil,nil,nil,'examplekey')
new_card:add_to_deck()
G.jokers:emplace(new_card)
new_card:set_edition({negative = true}, true)

#

I assumed it'd be this

wintry solar
outer dew
#

everything else in the code works, like if I just spawned a normal joker it would work fine

#

but I wanna spawn in another custom card

cerulean rose
#

no, you should use SMODS.add_card

worthy stirrup
#

okay, i know im doing it wrong, i dont know what im doing wrong, i just need a bit of point in the right direction

  calculate = function(self, card, context)
    card.ability.blueprint_compat_ui = card.ability.blueprint_compat_ui or ''; card.ability.blueprint_compat_check = nil
    local other_joker = nil
    for i = 1, #G.jokers.cards do
      if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i+1] 
      end
    end
      if other_joker and other_joker ~= card and other_joker.config.center.blueprint_compat then
        card.ability.blueprint_compat = 'compatible'
    else
        card.ability.blueprint_compat = 'incompatible'
    end

    return {
      
    }
  end
}
outer dew
cerulean rose
#

check the docs

cerulean rose
outer dew
#

is it pinned anywhere

cerulean rose
outer dew
#

ty

worthy stirrup
#

so, just move the code to loc_var or just put card.ability.blueprint_compat_ui?

outer dew
#

oh this is helpful actually

cerulean rose
worthy stirrup
#

half the code i stole from joker

#

blueprint

#

not joker

cerulean rose
#

check what blueprint does in loc_vars

frosty dock
wintry solar
#

cna't wait for someone to 'at' patch one

cerulean rose
worthy stirrup
#

im actually so blind, i honestly cant find it, blueprint just doesnt look like it has one unless if its not under card.lua

cerulean rose
#

810

worthy stirrup
#
elseif self.ability.name == 'Blueprint' then
cerulean rose
#

good job you found it

worthy stirrup
#

thats the loc_var?

cerulean rose
#

yup

worthy stirrup
#

i thought there would be a loc_vars = {} near by

cerulean rose
#

remember to change self to card

worthy stirrup
#

i am so sorry for making it so much harder than it needed to be

cerulean rose
sturdy compass
#

oh how fun, a bunch of random patches I made just decided to stop working despite the lines not changing at all. cool. awesome

gaunt thistle
sturdy compass
#

This worked just fine before I updated to 0.7 joeshrug

#

It's more than just that one too. It's seemingly random which ones broke but they broke Emoti_Shrug

candid epoch
#

i wonder how would balatro look like coded with brainfuck

solar eagle
#

i've created some custom hands but i can't figure out how to flag cards as able to score

#
    if #hand < 5 then return false end
        for i = 1, #hand - 4 do
            for j = i + 1, #hand - 3 do
                for k = j + 1, #hand - 2 do
                    for l = k + 1, #hand - 1 do
                        for m - l + 1, #hand do
                            local rank1 = hand[i]:get_id()
                            local rank2 = hand[j]:get_id()
                            local rank3 = hand[k]:get_id()
                            local rank4 = hand[l]:get_id()
                            local rank5 = hand[m]:get_id()
                            
                            local suit1 = hand[i].suit
                            local suit2 = hand[j].suit
                            local suit3 = hand[k].suit
                            local suit4 = hand[l].suit
                            local suit5 = hand[m].suit
                        
                            if (((suit1 == suit2) and (suit2 == suit3) and (suit3 == suit4) and (suit4 == suit5)) and (rank1 == 12 and rank2 == 12 and rank3 == 12 and rank4 == 12 and rank5 == 12)) {
                                return true, hand
                            }
                        end
                    end
                end
            end
        end
        return false
    end,```
this is what i have for the evaluate (this one is intended to be a flush five, but for queens only). it detects the hand properly but none of the cards show as scoreable
cerulean rose
cerulean rose
candid epoch
solar eagle
# solar eagle ```evaluate = function(parts, hand) if #hand < 5 then return false end ...

and on the same track, i've added a planet card for it:

    set = "Planet",
    name = "embertwin"
    key = "Ember Twin",
    effect = "Hand Upgrade",
    pos = { x = 1, y = 1 },
    atlas = "cards",
    config = { hand_type = "GreaterPolycule" },
    cost = 3,
    generate_ui = 0,
    loc_txt = {
        name = "Ember Twin"
    }
}```
but when i try to unlock this card to view it in mod additions, the game crashes with
`functions/common_events.lua:2915: attempt to index a nil value`
looking in the game's source reveals that common_events has no such line 2915 so i am pretty lost
frosty dock
solar eagle
#

ooh ok

frosty dock
#

also hand[x].suit doesn't exist, it's hand[x].base.suit

solar eagle
#

oh noted

worthy stirrup
#

so sorry to bother again, but it should look like

  loc_vars = function(self, info_queue, card)
    return { vars = {card.ability.blueprint_compat_ui}}
frosty dock
#

also should return an empty table instead of false

cerulean rose
solar eagle
#

this is true

#

is there a good way to check if a card is wild?

cerulean rose
solar eagle
#

i assume there is

cerulean rose
frosty dock
cerulean rose
#

also you should check for rankless cards

solar eagle
#

lemme verify cards score first then ill set to checking wild n stuff

cerulean rose
#

SMODS.has_no_rank

solar eagle
#

the initial handling was more a proof of concept than anything

#

thank you all!!

ionic verge
#

how would i create a card with random enhancement, and potential for random editions and seals

frosty dock
cerulean rose
gaunt thistle
ionic verge
#

currently i got this but i also dont know where to go from here

#

(copied from certificate)

gaunt thistle
#

you'll unfortunately just need to play around with it until you get something that works

cerulean rose
#

use SMODS.poll_enhancement

frosty dock
#

I just tried changing the priority on better_calc.toml back to -10 and it just worked? no failed patches

sturdy compass
solar eagle
#

i was wondering about that

#

thank you again!

ionic verge
solar eagle
#

should i do a dash or underscore?

#

or would it just be PREFIXGreaterPolycule

frosty dock
#

underscore

solar eagle
#

perfect

solar eagle
ionic verge
solar eagle
#

the greater polycule name was a reference yes

solar eagle
#

ty

foggy carbon
solar eagle
#

Yes

#

the mod this is a part of is centered around queens

worthy stirrup
#

i feel so horrible annoying yall but i honestly am lost, i know i keep saying this but thank yall for yalls help. im gonna send the code in a message so i dont keep flooding chat

solar eagle
#

Mostly

worthy stirrup
#

I am probably over looking something small

solar eagle
#

what's the goal of the joker exactly?

worthy stirrup
#

look exactly like the joker

#

its a scam card

#

NOT JOKER

#

fuck

#

blueprint

solar eagle
#

and then it just doesn't work? or something else

#

cool idea tho!!

foggy carbon
solar eagle
#

thats really funny

worthy stirrup
#

i just need the little compatible tab to show up

cerulean rose
#

main_end is not defined

#

put the code you copied from 810 into loc_vars

foggy carbon
ionic verge
cerulean rose
ionic verge
#

mmm

cerulean rose
#

SMODS methods will never be : accessed

ionic verge
#

got it

worthy stirrup
#

okay, so like this

#

im brb, i need a drink

cerulean rose
#

should be

#

well the scammed part won't work

worthy stirrup
#

which part is the scammed part, i think i removed what ur talking about

ionic verge
worthy stirrup
#

game crashes when i hover over it

ionic verge
#

like this for editions?

sturdy compass
worthy stirrup
#

okay, it no longer crshes

#

but...

#

heres the code

cerulean rose
#

prolly cus u only set compatible/incompatible on calculate

worthy stirrup
#

oh, how do i make it so it checks when a card is moved

cerulean rose
#

just check on update

#

also blueprint is compatible with itself

worthy stirrup
#

so, just replace calculate with update?

cerulean rose
#

yeah

elder vapor
#

also blueprint_compat should be either true or false

#

not a string

ionic verge
#

uh oh
crashed when it was supposed to create a card

frosty dock
worthy stirrup
ionic verge
#

lemme grab the card description real quick if that helps

cerulean rose
ionic verge
cerulean rose
#

i meant you'll never do :SMODS

cerulean rose
# ionic verge

if you want editions and seals to have that chance, you shouldn't pull from the enhanced pool

#

cus you'll get editions and seals there too

ionic verge
#

oh wait, wrong pull

worthy stirrup
worthy stirrup
#

instead of the actual text

cerulean rose
#

ur still calling poll_enhancement tho

ionic verge
#

just wasnt seeing it in utility functions

#

yeah i know

cerulean rose
#

its under the edition section

wintry solar
#

I need to make a SMODS.poll_edition wrapper

cerulean rose
#

why

zenith ridge
# ionic verge

What's the chance the card can be negative? If it's any higher than one-in-a-million it'd be great for fishing for better Baron builds.

ionic verge
#

same chance as any negative joker to my knowledge

wintry solar
#

because filling functions with nil is a pain

worthy stirrup
#

how do i fix the UI error

zenith ridge
#

Now just have to survive long enough to get a negative, strength it up to king, steel it, and get red seal on it.

#

And duplicate it a lot. So, stars still have to align.

clear star
#

First time working on a joker, formatting look good on this one?

cerulean rose
#

the x at the bottom is lowercase

#

also descriptions generally don't end with a period

#

and scaling xmult jokers usually start at X1

whole jungle
#

X0 implies that it turns your mult to 0 🙂

zenith ridge
zenith ridge
ionic verge
#

i dont like how this is in card.lua
same crash as before, any thoughts?

zenith ridge
clear star
#

Look better?

ionic verge
zenith ridge
whole jungle
#

It looks fine, but super strong. Probably want it to be a X0.01 or even smaller increase or something.

clear star
#

As for speed, what sounds like it'd be close to vanilla balance? something like 0.01? Maybe like half the speed of constellation?

grave arch
#

Hello! I need some help! Working on a mod and I'm a beginner fr_love

I'm trying to figure out how to create a new special color which switch between 2 colors like there is in the vanilla game (in the GIF). I would like to use this color for some Joker text.

I know how to create a simple color - I did like this (pinata is the name of the Joker and surprise the name of the color) :

local hooklc = loc_colour
function loc_colour(_c, _default)
    if not G.ARGS.LOC_COLOURS then
        hooklc()
    end

    G.ARGS.LOC_COLOURS.surprise = HEX("f0a8cc")

    if not G.ARGS.LOC_COLOURS["pinata_color"] then
        G.ARGS.LOC_COLOURS["pinata_color"] = {1, 0, 0}
    end

    return hooklc(_c, _default)
end

Is there an easy way to create what I want? I'm looking into Balatro code but I can't find more informations. I know I can use {C:dark_edition} text {} (like in the GIF) but I want the colors to switch from red to pink (so I assume I need to create something new).

Thanks for your time, if you can help me! fr_angel

worthy stirrup
zenith ridge
#

Probably playtest it with .01. Go for a build with a lot of retriggers.

solar eagle
#

if i'd like to have a spectral card have a chance to trigger an effect, how would i do that in a way that allows the die joker (oops all sixes?) to work?

clear star
solar eagle
#

looking at the base game src i found this G.GAME.probabilities.normal/self.ability.extra.odds but im not quite sure how this behaves

worthy stirrup
solar eagle
#

ohh i got it

#

G.GAME.probabilities.normal is the 1 in the 1 in 4 or 1 in 2

ionic verge
#

is there something wrong with this line of code?

worthy stirrup
#

i am so confused, my code looks exactly the same

cerulean rose
#

idk then

worthy stirrup
#

thank you for the help atleast

ionic verge
#

specifically this one

#

at self:set_sprites

#

mmmm

#

ist crashing in set_ability

#

so its crashing at this line instead

candid epoch
ionic verge
#

so fucking real

worthy stirrup
#

I dont know what is causing Error UI

ionic verge
#

cus there's no set_enhancements and set_ability seems to be weird

#

how do i set_ability right

wintry solar
#

wrap the poll_enhancement in G.P_CENTERS[--here--]

ionic verge
#

thank you

worthy stirrup
#

Ememel, i need ur magic

wintry solar
#

👍

wintry solar
ionic verge
worthy stirrup
ionic verge
wintry solar
#

oh I can't read, that's not how you use poll enhancement at all

ionic verge
#

great

wintry solar
#

it takes a table of args

ionic verge
#

mhm?

#

oh wait so like

#

{guaranteed = true}?

#

(if i just want the guaranteed thing)

wintry solar
#

ref-table should be card.ability I think

wintry solar
ionic verge
#

so like this:

wintry solar
#

that looks better, yeah

ionic verge
#

yeah it worked

#

there might be another bug with other parts but it didnt crash in the same spot

worthy stirrup
wintry solar
worthy stirrup
#

oh, i thought that was for him

#

ill go ahead and give it a shot

ionic verge
#

now its crashing here, from presumably this block of code

#

ignoring set ability

wintry solar
#

it might require a key, I dont remember fully

worthy stirrup
#

omg how did i overlook that so many times

rough furnace
ionic verge
#

good point

wintry solar
#

it looks like it's struggling with your pseudorandom calls

ionic verge
#

mhm?

worthy stirrup
#

YES< FINALLY

#

IT WORKS

#

thank you guys so much

ionic verge
wintry solar
#

I dunno, but that's what on the line in your crash report

#

try throwing a key in your poll functions

ionic verge
#

well i set them to all have keys and it still crashed at the same point

cerulean rose
#

is there a way to determine the type of a game object?

ionic verge
#

or

wintry solar
#

can you send the full crash screen instead?

ionic verge
#

perhaps

#

theres key and type_key

rough furnace
wintry solar
#

you don't need type_key

ionic verge
#

ok

cerulean rose
wintry solar
#

I mean you shouldn't need a key

#

I just don't see where the crash would originate from

rough furnace
#

iirc

ionic verge
#

im trying something and if it doesnt work ill post the full crash log

#

ok yeah one sec

wintry solar
#

oh I am big 98%ing today

#

poll_edition isn't like the SMODS poll functions

worthy stirrup
#

should i do this or be using pseudorandom

    local randomIndex = math.random(1, #G.jokers.cards)
    local other_joker = G.jokers.cards[randomIndex]
ionic verge
#

i believe is psuedorandom is better

dim steeple
#

easier to test, validate etc

rough furnace
#

also means seeded runs are the same

worthy stirrup
#

so if i use pseudorandom, what card is picked is based on seed?

dim steeple
#

based on the seed, how many times the function has been called on the seed

worthy stirrup
#

okay, ill use pseudorandom

dim steeple
#

so if I did 3x psuedorandom, I might get something like 0.1, 0.4,0.7

if a start a new run on the same seed, that order will always be the same

#

determinism, even though not random, is super valuable

ionic verge
worthy stirrup
#

if i wanted to grab a random joker, how would i use pseudorandom to get it, as it only makes 0 - 1, yes?

wintry solar
#

it doesn't take a table, it has individual arguments

worthy stirrup
#

ohh

ionic verge
#

thats the amount of jokers you have

rough furnace
#

wouldn't you just use pseudorandom_element?

ionic verge
#

oh and apply math.ceil to it

#

or yeah that

#

thats much better

clear star
#
calculate = function(self, card, context)
  if
    -- Something triggers
    context.individual and context.cardarea == G.play and 
    not context.other_card.debuff and 
    not context.blueprint
  then
    -- Increase XMULT
    card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
    return {
      --  Notify upgrade?
      message = localize('k_upgrade_ex'),
      colour = G.C.CHIPS,
      card = card
    }
  end
  if context.joker_main then
    -- Joker Scores
    return {
      -- Give Score
      message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.xmult } },
      colour = G.C.MULT,
      Xmult_mod = card.ability.extra.xmult
  }
  end
end

Why is this not giving me an upgrade popup when it upgrades?

Relevant part being:

then
    -- Increase XMULT
    card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
    return {
      --  Notify upgrade?
      message = localize('k_upgrade_ex'),
      colour = G.C.CHIPS,
      card = card
    }
  end
clear star
#

But not doing castle's thing for this trigger.

wintry solar
#

message_card = card

clear star
#

Also, while I'm here, is there a dedicated ref table?

wintry solar
#

can also reduce your joker_main return to just

return {
  xmult = card.ability.extra.xmult
}```
clear star
#

Do that still do the popup?

wintry solar
#

yes

clear star
#
then
  -- Increase XMULT
  card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
  return {
    --  Notify upgrade?
    message = localize('k_upgrade_ex'),
    colour = G.C.MULT,
    message_card = card
  }
end

So this should work?

wintry solar
#

should do yeah

runic radish
#

card idea: Estrogen Pill, turns all face cards into queens when scored

solar eagle
#

what would cause the crash attempt to index local 'card' (a number value), in relation to src/utils.lua:829 with adding an enhancement? 829 is if card.config.center.key ~= "c_base" and not extra_only then but im not sure what this is doing

#

my config is as so:

        extra = {
            chips = 20,
            x_chips = 2,
            mult = 10,
            x_mult = 1.5,
            bigbucks = 10,
            count = 2
        }
    },```
#

they are intentionally not applied in the base config value

wintry solar
#

how are you adding the enhancement?

solar eagle
#

via a tarot card

wintry solar
#

I mean the code...

solar eagle
#

oh sorry

#
    set = "Tarot",
    name = "Spironolactone",
    key = "spironolactone",
    effect = "Enhance",
    order = 23,
    pos = { x = 1, y = 0 },
    config = {
        mod_conv = "TWT_luckshit",
        max_highlighted = 2
    },
    cost = 3,
    atlas = "cards",
    loc_txt = {
         name = "Spironolactone",
         text = { "Enhances {C:attention}2{} selected cards to {C:attention}Luckshit Cards{}" },
     },
    can_use = function(self, card)
        return #G.hand.highlighted < 3 and #G.hand.highlighted > 0
    end,
    can_bulk_use = true,
    use = function(self, card, area, copier)
        for i = 1, #G.hand.highlighted do --flips cards
            local percent = 1.15 - (i-0.999)/(#G.hand.highlighted-0.998)*0.3
            G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.15,func = function() G.hand.highlighted[i]:flip();play_sound('card1', percent);G.hand.highlighted[i]:juice_up(0.3, 0.3);return true end }))
        end
        delay(0.2)
        for i = 1, #G.hand.highlighted do --enhances cards
            G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function() G.hand.highlighted[i]:set_ability(G.P_CENTERS[card.ability.consumeable.mod_conv]);return true end }))
        end 
        for i = 1, #G.hand.highlighted do --unflips cards
            local percent = 0.85 + (i-0.999)/(#G.hand.highlighted-0.998)*0.3
            G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.15,func = function() G.hand.highlighted[i]:flip();play_sound('tarot2', percent, 0.6);G.hand.highlighted[i]:juice_up(0.3, 0.3);return true end }))
        end
        G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2,func = function() G.hand:unhighlight_all(); return true end })) --unselects cards
        delay(0.5)
    end
}```
this is my tarot card code, mostly ripped from the balatro source
#

i have similar code set up to convert cards to queens which is working

#

but this is not and im not quite sure why

runic radish
#

Joker idea: Color Coded, adds blue seal to clubs, purple seal to spades, red seal to hearts, and gold seal to diamonds when discarded, disables cards with seals that don't match

clear star
wintry solar
clear star
wintry solar
#

update smods

#

oh

#

that's old calc

#

you should develop on new calc

solar eagle
#

why?

#

i've been happy with old calc

clear star
#

My group plays a bunch of mods on old calc, the intention was to add to the modpack

wintry solar
#

because it's old and won't be supported

solar eagle
#

when does this occur

#

and how would i migrate

#

the docs all show old calc still.

wintry solar
#

there's a specific calculate functions doc that is entirely better calc

solar eagle
#

i'm confused then

wintry solar
#

but if people want to stay on an old build, they can feel free

solar eagle
#

this is new calc?

cerulean rose
#

this is new calc

solar eagle
#

yeah that's where i got it

#

calculate = function(self, card, context, effect)
if on an SMODS.Enhancement, is this old calc or new? i am not sure at this point

wintry solar
#

that's old calc

#

new calc uses the calculate functions page on every object

#

no more jank depending on what you're working on

solar eagle
#

im so confused

wintry solar
#

no more having to check which variation of xmult, x_mult, x_mult_mod etc you need

solar eagle
#

im trying to follow the documentation but apparently its not consistent in itself???

worthy stirrup
#

i thought i was done with the scam card, but no, now it crashes on the catalogue

wintry solar
#

the other pages haven't been updated yet

#

but if you are calculating on new calc, the above page is all you need

worthy stirrup
solar eagle
worthy stirrup
#

it only crashes when you view it in the catalog, i assume because its trying to grab the joker next to it, how do i make it not do that

#

code if needed ^

solar eagle
#

what exactly do i define on my enhancement then

wintry solar
solar eagle
#

and then i just check the context?

#

ok

#

will try

worthy stirrup
#

how can i check if its in a game, because it tries to check next joker while its in the cataloug

solar eagle
#

check the cardarea i think

wintry solar
worthy stirrup
#

id prefer if i can do it only when a card is moved

wintry solar
#

this will be called every frame, you can just call it in loc_vars so it runs when you hover

worthy stirrup
#

so, is there just a way to do it only when a card is moved

cerulean rose
wintry solar
#

it's UI, you only need to do it when you hover the card

worthy stirrup
#

so just, replace it with what, or just move that part of the code to loc_var

wintry solar
#

move it to loc_vars, yeah

#

and also put a check for G.jokers in there

#

or the area check you already have

worthy stirrup
#

okay, so now its like this

wintry solar
#

you might get a main_end doesn't exist crash there

worthy stirrup
#

okay, it works but now instead of red and green, its just grey

#

and i think its safe to say, its not normally gray

rough furnace
wintry solar
#

move the main_end = ... after you set the compat_ui maybe?

solar eagle
# wintry solar this
        if context.main_scoring and context.cardarea == G.play then
            print(card.ability.extra.x_chips)
            print("luckshit")
            local randcount = {}
            math.randomseed("luckshit")
            for i = 1, count do
                local rand = math.random(1, 6)
                randcount[i] = rand
                if #rand == 2 then
                    while randcount[0] == rand do
                        rand = math.random(1, 6)
                    end
                end
                --this makes sure that the second effect cannot be the same as the first.
                --however if the card is glitched by cryptid or something (making count higher), effects can repeat
                
                if rand == 1 then
                    return {
                        chips = card.ability.extra.chips,
                        message = localize { type = "variable", key = "a_chips", vars = { card.ability.extra.chips } },
                    }
                elseif rand == 2 then
                    return {
                        Xxhips = card.ability.extra.x_chips,
                        message = localize { type = "variable", key = "a_xchips", vars = { card.ability.extra.x_chips } },
                        --animation incorrect probably
                    }
                elseif rand == 3 then
                    return {
                        mult = card.ability.extra.mult,
                        message = localize { type = "variable", key = "a_mult", vars = { card.ability.extra.mult } },
                    }
                elseif rand == 4 then
                    return {
                        xmult = card.ability.extra.x_mult,
                        message = localize { type = "variable", key = "a_xmult", vars = { card.ability.extra.x_mult } },
                    }
                elseif rand == 5 then
                    return {
                        dollars = card.ability.extra.bigbucks
                        message = localize { type = "variable", key = "p_dollars", vars = { card.ability.extra.bigbucks } },
                    }
                elseif rand == 6 then
                    card.any_suit = true
                    return {
                        message = "Wild!"
                    }
                end
            end
        end
    end```
would this then be correct? or no
#

sry for wall lol

#

i dont know how to force discord to use message.txt

wintry solar
#

you don't need any of the message = ... in the scoring returns, but it should work yeah

#

I can't see anything obviously wrong

solar eagle
#

does newcalc auto do that?

wintry solar
#

yup

solar eagle
#

handy, though if i manually return does that override

#

misspelled "xchips" i think

wintry solar
#

if you manually return I think it stacks, you can override using a couple of different ways

solar eagle
#

what im doing should be fine for option 6 since it otherwise does nothing

wintry solar
#

yes option 6 is fine

worthy stirrup
#

thankfully no crash but no color

wintry solar
#

I think your check to avoid duplicate effects should be while randcount[1] == rand do btw

solar eagle
#

i dont want it to index out of bounds

wintry solar
#

wait actually this won't get more than one effect

solar eagle
#

why not

wintry solar
#

because you return in the first pass through

solar eagle
#

oh wait

#

true

#

i know how to fix this

wintry solar
#

you can replace return with SMODS.calculate_effect({table from return}, card)

solar eagle
#

that works too

wintry solar
#

or add them to a local table and return at the end

solar eagle
#

yea that was my idea

solar eagle
#

or what would i substitute

rough furnace
#

substitute the table you were returning

clear star
#
then
  -- Increase XMULT
  card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
  return {
    --  Notify upgrade?
    message = localize('k_upgrade_ex'),
    colour = G.C.MULT,
    message_card = card
  }
end

So updating changed this to function, but it's currently putting the upgrade on the playing card, but I want it on the joker. What am I missing?

wintry solar
# worthy stirrup

I think the blueprint_compat check is checking your atually blueprint like card rather than the copied one

solar eagle
wintry solar
solar eagle
#

oooooh got it

#

thank you!

wintry solar
#

to explain it, the table that you normally return get's plugged into this function later on, so you can do it manually too

solar eagle
#

i seeee

#

thank you so much!

cerulean rose
rough furnace
#

I don't belive vanilla centers are objects

#

I would personally justy only allow one type of data

cerulean rose
#

i have an entry that is the standard pack pool

solar eagle
# wintry solar this

if i wish to create a boss blind that does things to played cards (convert suit, change rank, etc) what context would i check for?

wintry solar
#

boss blinds use different functions to apply their effects

solar eagle
#

ooh ok lemme look at the docs then

wintry solar
solar eagle
#

modify_hand(self, cards, poker_hands, text, mult, hand_chips) -> number, number, bool
so i'd want to do this, return the base mult, chips, etc etc but mess with the cards then

#

thank you again!

worthy stirrup
wintry solar
#

you can throw the other card in the reftable of it

wintry solar
#

I've done ~30 blinds in there

clear star
#

Where on the wiki is the reference to message stuff. All I can find is "If you return message_card" but that doesn't really help me figure out what I can flag as the message target.

solar eagle
#

will check out ty!

wintry solar
#

yes

solar eagle
#

thank you so much

#

seriously

weak brook
#

hey eremel

#

trying to reference your ortalab code for a deck and its not working for some reason, not sure why

#

first off,
config = { hand_size = -1 },

#

this doesnt work

#

dunno why

#
    G.E_MANAGER:add_event(Event({
        func = function()
            for k, v in pairs(G.GAME.probabilities) do
                G.GAME.probabilities[k] = v * 2
            end
            return true
        end
    }))
end```

and this doesnt work either
#

did something change or am i just doing something wrong? seems liek this is the way to change hand_size and change other values on starting a run

wintry solar
#

those look correct to me

weak brook
#

yeah but for some reason neither result is happening in game

wintry solar
#

huh

weak brook
#

probabilities are the same, and my deck size is still 8

#

yeah

wintry solar
#

are you definitely editing the correct deck?

weak brook
#

yeah

rough furnace
#

and saved the fikle

weak brook
#

oh wait

#

i had the name value unchanged from a copy patse of a previous deck

#

but i didnt think that would change it, lemme see if it did

#

not the id, just this name value

#

huh. that was it

#

didnt realize the names were that important damn

#

sorry bout that

solar eagle
wintry solar
frosty dock
#

i think voucher calc is about ready

solar eagle
#

i looked at the examples moddedvanilla which has reimplemented gros michel and cavendish

#
      "{C:mult}+#1#{} Mult",
      "{C:green}#2# in #3#{} chance this",
      "card is destroyed",
      "at end of round"
    }
  },
  config = { extra = { mult = 15, odds = 6 } },```
these do not behave how i expect though, unless im misinterpreting what `#n#` does?
#

because #1# would be config.extra.mult, but then #2# is config.extra.odds
though for this to function, this has to be #3#

wintry solar
#

the #1# refers to the values you return in loc_vars

solar eagle
#

OHHHHHHHHHH

#

now i feel stupid

frosty dock
#

(yes that means you get repeated mult if you somehow find yourself in a situation where you redeemed two observatories)

#

why? because that means it's compatible with planets that have their own calculation that's independent of observatory

wintry solar
#

I think that's a logicaly expectation of having multiple observatories

rough furnace
#

retrigger observatory

frosty dock
cerulean rose
#

i'm trying to create a custom pool like cryptid's meme pack but modded cards aren't being added?

SMODS.current_mod.clubs = {
    SMODS.Centers.j_pencil_lass,
    SMODS.Centers.j_pencil_eclipse,
    SMODS.Centers.j_pencil_club,
}
if SMODS.Mods.YART and SMODS.Mods.YART.can_load then
    table.insert(SMODS.current_mod.clubs, SMODS.Centers.c_yart_rmoon)
end
SMODS.ObjectType({
    key = "clubs_pack",
    default = "j_gluttenous_joker",
    cards = {},
    inject = function(self)
        SMODS.ObjectType.inject(self)
        -- insert base game meme jokers
        self:inject_card(G.P_CENTERS.j_gluttenous_joker)
        self:inject_card(G.P_CENTERS.j_blackboard)
        self:inject_card(G.P_CENTERS.j_onyx_agate)
        self:inject_card(G.P_CENTERS.j_seeing_double)
        self:inject_card(G.P_CENTERS.c_moon)
        for i, v in ipairs(SMODS.Mods.StrangePencil.clubs) do
            self.cards[v] = true
        end
    end
})
solar eagle
#

looking at cryptid's src it returns an array colours but im not sure how to apply this

#

like the (lvl.1)

#

color that applies to lvl.1

#

or 2, 3, etc etc

frosty dock
#

though i think this should work if you've defined the jokers you're trying to add first

frosty dock
cerulean rose
#

i think that makes sense

#

each observatory procs X1.5 on the planet card

frosty dock
#

no i'm saying i want a review on the pr

rare bobcat
#

For doing a lovely patch, do you need code before or after or can you do just the code for the patch?

solar eagle
#
        local levelone = G.GAME.hands["TWT_Polycule"].level or 1
        local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
        if levelone == 1 then
            planetcolourone = G.C.UI.TEXT_DARK
        end
        return {
            vars = {
                localize("TWT_Polycule"),
                G.GAME.hands["TWT_Polycule"].level,
                G.GAME.hands["TWT_Polycule"].l_mult,
                G.GAME.hands["TWT_Polycule"].l_chips,
                colours = { planetcolourone },
            },
        }
    end```
are there any mistakes im making here? game crashes with `attempt to index field 'TWT_Polycule' (a nil value)` at `local levelone = G.GAME.hands["TWT_Polycule"].level or 1`
leveling code is ripped from cryptid so it might not work for my case
#

but im not quite sure how to do it

rare bobcat
#

can target = "back.lua" pattern = "({localize{type = 'name_text', key = 'v_tarot_merchant', set = 'Voucher'}, localize{type = 'name_text', key = 'v_planet_merchant', set = 'Voucher'}," position = 'at' payload = "{localize{type = 'name_text', key = 'v_tarot_merchant', set = 'Voucher'}, localize{type = 'name_text', key = 'v_planet_merchant', set = 'Voucher'}, localize{type = 'name_text', key = 'v_overstock_norm', set = 'Voucher'}}" be the whole code?

#

That shouldn’t be saved as overstock norm

#

I don’t think

#

Irrelevant for what I need

solar eagle
#

or do i not need to define custom leveling code at all?

orchid thunder
#

im trying to create a new object type for a mod @proper stratus is making but i dont knwo what im doing wrong can someone help
they get applied kinda like seals

#

@ me when responding

placid frigate
#

hey i tried making a modded challenge and it's not showing up in game

wintry solar
#

it crashes on decks that apply vouchers

worthy stirrup
wintry solar
#

mhmm

frosty dock
#

i thought i accounted for that, guess i didn't test it?

wintry solar
#

oh that message positioning is unexpected

#

the calc works fine though

frosty dock
#

oh I see, the area doesn't fucking exist yet

wintry solar
#

curse my one handed typing

sage patrol
#

hello modders

#

where would one download mods

#

and how

#

im a bit stupid might need a little tutorial

devout pewter
#

There are example mods in the steamodded files

worthy stirrup
#

is there a keybind for a quick restart without having to close the game

wintry solar
#

hold M

sage patrol
devout pewter
#

steamodded is the modloader

worthy stirrup
#

omg, that is so helpful, thank you

sage patrol
rare bobcat
#
--- MOD_NAME: QOL
--- MOD_ID: QOL
--- PREFIX: QOL
--- MOD_AUTHOR: [QOl]
--- MOD_DESCRIPTION: QOL

----------------------------------------------
------------MOD CODE -------------------------
target = "back.lua"
pattern = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'},"
position = 'at'
payload = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'},
           localize{type = 'name_text', key = 'v_observatory', set = 'Voucher'}," ``` says unfinished string
sage patrol
#

virus detected on the file download

#

urm

devout pewter
rare bobcat
#

trust

devout pewter
#

read the installation manual, there's everything you need

#

for both lovely and steamodded

sage patrol
#

(im disabling it)

frosty dock
#

something ate my return

worthy stirrup
frosty dock
sage patrol
wintry solar
sage patrol
#

so i found lovely but where would one find steamodded

sage patrol
#

googoo

#

wow how did i miss that

#

man i need a youtube video

#

i do NOT know what this means

solar eagle
sage patrol
#

hor

solar eagle
#

granted, i am very new to this server but i think this channel is generally mod dev?

frosty dock
solar eagle
#

ok i dont know at this point

frosty dock
#

i guess i do the event only when the area doesn't exist yet?

wintry solar
#

yeah I guess so

worthy stirrup
#

im gonna eat dinner and come back to this

solar eagle
#
        local levelone = G.GAME.hands["TWT_Polycule"].level or 1 <----
        local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
        if levelone == 1 then
            planetcolourone = G.C.UI.TEXT_DARK
        end
        return {
            vars = {
                "Polycule",
                --localize("TWT_Polycule"),
                G.GAME.hands["TWT_Polycule"].level,
                G.GAME.hands["TWT_Polycule"].l_mult,
                G.GAME.hands["TWT_Polycule"].l_chips,
                colours = { planetcolourone },
            },
        }
    end```
why would this line break saying that it attempted to index a nil value
its a defined hand and ive added the prefix
#

am i accessing the wrong dict?

wintry solar
#

are deck jokers/consumables delayed in events?

#

might be easier to just wrap the voucher application in a similar event

frosty dock
#

oh i see

#

challenges actually do just that

#

but decks don't

wintry solar
#

there are also 2 identical blocks in apply_to_run on decsk for vouchers thunk

#

oh wai tno I cant read

#

there's voucher and vouchers

#

thunk pls

solar eagle
#

consumeable

rare bobcat
wintry solar
#

thats not how a toml file should be structured

solar eagle
#

pattern = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'},"
is the comma right before the end intentional?

tender gale
#

I'm pretty sure they don't use headers anymore

weary jungle
#

how do i dictionary

rare bobcat
solar eagle
#

you know fair

#

i am too

#

localization is annoying

rare bobcat
#

I just want easier perkeobservatory

#

And other stuff

#

Once I get this working then everything else should be the same and I just copy that

frosty dock
frosty dock
solar eagle
#

i have to lowercase it

frosty dock
#

btw why is this a reverse array

rare bobcat
solar eagle
#

TWT_polycule

#

printed out the list of all valid hands

#

and theres

#

Full House
Flush
TWT_polycule

#

and my dumbass put TWT_Polyclue

rare bobcat
#

The amount of times I’ve misspelled variables is cryptidmassive

frosty dock
#

that's nothing compared to editing lovely dumps

wintry solar
solar eagle
#

"why isnt the mult applying?"

typed "xxult" instead of "xmult"

rare bobcat
#

As I’ve said before, my mod’s first word was timmeh

wintry solar
#

It seems to spin randomly too, is that some discard card area jank?

frosty dock
#

lemme see about that

#

spinning randomly is discard area jank for sure

tender gale
#

How would I code a shortcut-like joker that allows you to play an Ace straight that wraps around? eg JQKA2

rare bobcat
#

I just need to know why my son ```--- STEAMODDED HEADER
--- MOD_NAME: QOL
--- MOD_ID: QOL
--- PREFIX: QOL
--- MOD_AUTHOR: [QOl]
--- MOD_DESCRIPTION: QOL


------------MOD CODE -------------------------
target = "back.lua"
pattern = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, -1}"
position = 'at'
payload = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'},
localize{type = 'name_text', key = 'v_observatory', set = 'Voucher'}, -1}"``` is breaking

#

That’s technically my son’s genetic code but my point still stands

wintry solar
#

I guess the discard calculation has the same issue too then? Probably should align the discard area in that case

rare bobcat
#

I found 1 easy thing

#

Misplaced comma

solar eagle
tender gale
#

{
"id": "qol",
"name": "QOL",
"display_name": "QOL",
"author": ["placeholder"],
"description": "Placeholder",
"prefix": "qol",
"main_file": "back.lua",
"priority": 0,
"badge_colour": "30758D",
"version": "0.0.1",
"dependencies": [],
}

solar eagle
#

how do i apply colors to text? my planet card returns colors in an array colours but im not sure how to apply them with {C:value}

rare bobcat
frosty dock
#

tbh idk why it's near the blind chip, i'm not sure discard calculation even did that

wintry solar
#

Thunk wtf is this for

solar eagle
#

discard_pieceofshit is my guess

rare bobcat
#

I just want my son off the zaza

frosty dock
wintry solar
#

I think we can just set these to be fixed values, right?

rare bobcat
#

My son is tweaking off that “unfinished string near line 13”

wintry solar
whole jungle
#

Get rid of the comma at the end of the file

#

JSON parsing doesn't like trailing commas

solar tide
#

Hello someone know how can put delay cause i want to give 2 gold wait 1 second the give 1 another gold ect...

#

how can i create delay for that

rare bobcat
wintry solar
#

Then put it in a toml file?

#

And structure it properly

sturdy compass
#

Ok whatever the patch order changes were made me so confused cuz I have no idea why this isn't working anymore

rare bobcat
#

Is the dark red and underlined the stuff that is wrong?

wintry solar
sturdy compass
#

Thanks for the tip. I said it last night and I'll say it again, you're a saint man

rare bobcat
#
pattern = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, -1}"
position = 'at'
payload = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, localize{type = 'name_text', key = 'v_observatory', set = 'Voucher'} -1}"``` isn't crashing but isn't working
frosty dock
#

okay this doesn't at all work how i thought it would

solar tide
#

pls someone can help me

rare bobcat
#

I think o figured it out

#

I

sturdy compass
# wintry solar

This seems to be working much better. Once again, thank ya

rare bobcat
#

Nope

weary jungle
#

first make the giving gold in an event

#
-- give gold
return true end }))  ```
rare bobcat
#

My son [patches.regex] target = "back.lua" pattern = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, -1}" position = 'at' payload = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, localize{type = 'name_text', key = 'v_observatory', set = 'Voucher'} -1}" has had his entire genetic structure redone multiple times

#

Please doc, can you do anything to help him be able to walk again?

weary jungle
solar tide
# weary jungle ```G.E_MANAGER:add_event(Event({trigger = 'after',func = function() -- give gold...
G.E_MANAGER:add_event(Event({
                        trigger = "after",
                        delay = 2.0*G.SETTINGS.GAMESPEED,
                        func = function()
                            ease_dollars(math.random(1,3))
                            return true
                        end,
                    })) 
                    G.E_MANAGER:add_event(Event({
                        trigger = "after",
                        delay = 10.0*G.SETTINGS.GAMESPEED,
                        func = function()
                            ease_dollars(math.random(2,3))
                            return true
                        end,
                    })) 
                    G.E_MANAGER:add_event(Event({
                        trigger = "after",
                        delay = 10.0*G.SETTINGS.GAMESPEED,
                        func = function()
                            ease_dollars(math.random(1,2))
                            return true
                        end,
                    })) ````
i  made that actually but all gold give at the same time,  and i want delay that
weary jungle
#

then add this function,

    local waitTill = PREFIXstart + time
    G.E_MANAGER:add_event(Event({trigger = 'after',func = function()
        return (love.timer.getTime() > (waitTill))
    end }))  
    return true
end```
#

and put a wait() inbetween the events, and it should work

solar tide
#

the time will be in seconds ?

rare bobcat
weary jungle
#

keep me updated, im like 70% sure this works

fair comet
#

hey guys, any good resources to get into modding Balatro? I'd like to try my hand at it.

solar eagle
#

i have been stuck for so long only to realize lua indexes start at

#

fucking 1

#

not 0

rare bobcat
weary jungle
solar tide
fair comet
frosty dock
rare bobcat
#

Do I have to commit sci-fi crimes to get my son’s dna fixed?

primal robin
frosty dock
#

i do still have the trick of just aligning them to something else

#

them being the messages

rare bobcat
#

I’ve run out of Chevelle references that don’t make me sound too much like a maniac

frosty dock
#

I'm not fully sure where though

weary jungle
#

oh this is gonna be a NIGHTMARE to unravel

rare bobcat
#

My son is a simple lovely patch but he is not working

#

A solid 5 lines

weary jungle
#

add prints

#

aways fixes everything

#

whats wrone with the code?

dim steeple
#

Thoughts on this?

rare bobcat
#
target = "back.lua"
pattern = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, -1}"
position = 'at'
payload = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, localize{type = 'name_text', key = 'v_observatory', set = 'Voucher'} -1}"```
weary jungle
rare bobcat
#

Oh hey it’s the jimbo records guy

weary jungle
solar tide
rare bobcat
#

How would that work with oa6

solar tide
#

its gives gold at the same time

rare bobcat
#

Is it just immune?

nova finch
#

Can anyone help?
I'm trying to make a joker where when the first discard is a two pair it upgrades Xmult and destroys the cards but remove = true isn't working for destroying the cards

dim steeple
rare bobcat
dim steeple
dim steeple
#

essentially, you get to keep it in your hand

weary jungle
#

sorry

zenith ridge
#

I don't understand what this means or how to apply it.

frosty dock
#

maybe i move it higher up and/or add some distinction between discard and voucher

sturdy compass
rare bobcat
#

I am genuinely tweaking rn

dim steeple
sturdy compass
#

I'm not even trying to access that tho???

dim steeple
#

but you need it...

#

Here's my json:

    "id": "Balatro++",
    "name": "Balatro++",
    "author": [
        "MrFletch"
    ],
    "description": "A custom version of Balatro with a few extra features.",
    "prefix": "btp",
    "main_file": "btpmain.lua",
    "priority": 0,
    "badge_colour": "#378065",
    "badge_text_colour": "FFFFFF",
    "display_name": "Balatro++",
    "version": "0.0.1",
    "dependencies": [
        "Steamodded (>=1.0.0~ALPHA-1217c)",
        "Lovely (>=0.6)"
    ],
    "conflicts": [],
    "provides": [],
    "dump_loc": false
}```
primal robin
rare bobcat
#
target = "back.lua"
pattern = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, -1}"
position = 'at'
payload = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, localize{type = 'name_text', key = 'v_observatory', set = 'Voucher'} -1},"``` what the fuck am i doing wrongg
sturdy compass
dim steeple
#

it reads every json

wintry solar
dim steeple
#

set your settings.json on the dir above

frosty dock
#

tried this just now, maybe it's a little too much

primal robin
#

Why not just hardcode some jsons or not check nested folders? Why it's checks every json in mod?

frosty dock
#

I'd like different positionings for discard and voucher though

frosty dock
# frosty dock

maybe this for discard and another same distance for voucher?

wintry solar
#

Yeah I think that’ll do for now, might have a play around with it tomorrow

frosty dock
#

that puts it about here

rare bobcat
#

I feel myself getting mad about needing help so I’m going to take a break

frosty dock
#

also yes it juices the deck

weary jungle
#

does gros mitchel and other related jokers go extinct when you lose?

gaunt thistle
dim steeple
#
target = "back.lua"
pattern = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, -1}"
position = 'at'
payload = '''localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, localize{type = 'name_text', key = 'v_observatory', set = 'Voucher'} -1}'''```
gaunt thistle
#

the comma will make a difference but the triple quotes will not

solar eagle
#

is pseudorandom a function i can call in my mod?

zenith ridge
#
    key = 'Jokers',
    path = 'Jokers.png',
    px = 71,
    py = 95,
}

SMODS.Joker{
    key = 'joker2',
    loc_txt = {
        name = 'Nice',
        text = {
            'Retrigger each',
            'played {C:attention}6{} and {C:attention}9{}',
        }
    },
    atlas = 'Jokers',
    pos = {x = 0, y = 0},
    rarity = 2,
    cost = 6,
    blueprint_compat = true,

    

    calculate = function(self,card,context)
        if context.individul and (
            context.other_card:get_id() == 6 or
            context.other_card:get_id() == 9) then
                return{
                    message = localize('k_again_ex'),
                    repetitions = self.ability.extra,
                    card = card
                }
        end

    end,

    

    config = { extra = { repetitions = 1 } },

}

I still can't get this thing to retrigger. Ali gave me the line

self.ability.extra > card.ability.extra.repetitions

but I really don't know how to apply that.

dim steeple
solar eagle
#

ok perfect

#

let me switch to that

frosty dock
solar eagle
#

use card instead i believe?

frosty dock
#

it refers to the card prototype ("center") and not the card itself

zenith ridge
sturdy compass
# sturdy compass Guh

I guess the question I'm trying to ask here is why is a .json that has nothing to do with my mod, but my IDE, preventing this patch?

frosty dock
#

hm i guess my thing is mergeable now with the messages aligned and all

dim steeple
gaunt thistle
dim steeple
#

it looks like the thing your patching is just setting values in a local variables array

rare bobcat
dim steeple
#

but whatever is reading those local variables might not be looking at the extra index added

dim steeple
wooden nexus
rare bobcat
#

and woudl [patches.pattern] target = "back.lua" pattern = "localize{type = 'name_text', key = 'v_telescope', set = 'Voucher'}, -1}" position = 'after' payload = '''localize{type = 'name_text', key = 'v_observatory', set = 'Voucher'} -1}''' work any better?

dim steeple
#

you're looking for this line in game.lua

        b_nebula=           {name = "Nebula Deck",      stake = 1, unlocked = false,order = 7, pos =  {x=3,y=0}, set = "Back", config = {voucher = 'v_telescope', consumable_slot = -1}, unlock_condition = {type = 'win_deck', deck = 'b_blue'}},
...```