#đŸ’»ăƒ»modding-dev

1 messages · Page 164 of 1

open aspen
#

imagine you divide all the numbers inbetween 0 and 1 into 4 quarters

prisma loom
#

wait hold on

#

I think

open aspen
#

all the numbers between 0 and .25 would be in one quarter

prisma loom
#

I undertand it now

dusk harness
#

hence why i added a light humour at the end

prisma loom
#

possible

dusk harness
#

kinda

runic pecan
prisma loom
#

holding

dusk harness
#

so lets normalize to numbers between 1 and 100

#

1/4 of 100 is 25 right

prisma loom
#

correct

dusk harness
#

if you were to choose a random number between 1 and 100

#

what are the chances you chose a number thats between 1 and 25

prisma loom
#

25 positive outcomes out 100 and game checks if generetaed number is 25 or lower (one of the positive outcomes)

frosty dock
dusk harness
prisma loom
#

100?

dusk harness
#

yes

#

whats 25/100

prisma loom
#

a bit convoluted imo but smart ppl knew better when coming up with this

#

ig

violet void
#

how can I get the set from card for example here? it only seems to work when I do it from the center rather than card

dusk harness
violet void
#

this

prisma loom
#

thanks for explaining folks, my head now feels bigger and smarter

runic pecan
#

I love it so much that this channel is essentially a big study group in a hall.

dusk harness
#

the condition could also have been reversed to be
dont do the thing if the random number is greater than the chances

sturdy compass
#

Asking this again, I've tried a bunch of different things since but still no dice

#

The things I've tried in question were adding .ability and .config to the values

runic pecan
#

What exactly do you want your joker to do with the stone cards?

sturdy compass
#

The joker allows them to keep rank and suit. I had this working but I'm trying to move the functionality to a take_ownership as opposed to the many lovely injections I had before for compat reasons

tepid crow
#

does the :update even get called? đŸ€”

sturdy compass
#

Would there be a reason it doesn't? It is an API method defined in the docs

wintry solar
#

You’re changing self and not card for starters

open aspen
#

modding this game is hella confusing

sturdy compass
#

are those values not of the enhancement though?

wintry solar
#

No, self is referring to the prototype object

sturdy compass
#

changing self to card is yielding the same result

wintry solar
#

It’s also not something that needs to be changed every frame

sturdy compass
#

Would calculate be more appropriate then?

wintry solar
#

It would make more sense to have an add_to_deck and remove_from_deck that effects cards already in G.playing_cards and then hook set ability to change the values of newly generated stone cards

sturdy compass
#

Alright I see that line of thinking. In that case, what would be the correct syntax to access those values on a card?

wintry solar
#

card.config.center.whatever iirc

sturdy compass
#

alright I'll give that a go then

#

Still no give with this implementation

#

wait I may be stupid

#

ok I kinda was but still no good. Forgot to make "card" in the second screenie "v"

merry raven
#

What's this do

sturdy compass
#

Supposed to give rank and suit back to stone cards

merry raven
#

Wait
I could have used card.config.center.always_scores this entire time to check for always-scoring cards

sturdy compass
#

Probably not because this implementation does not work lol

merry raven
#

Is that how it works with how you implemented no suits and no ranks

#

Aw

prisma loom
#

looks like this crashes the game

#

basically I need this joker to duplicate itself only at end of round with 1 in 6 chance

wintry solar
#

It’s somewhere in the card values, I don’t remember exactly where

wintry solar
#

And it’d be v.config


sturdy compass
#

Yeah I already changed to v.config

#

still no

wintry solar
merry raven
#

Bru

sturdy compass
#

lmao

merry raven
#

I could have used that instead of explicitly coding my Joker to only take in one or two cards

merry raven
wintry solar
#

It returns true if the card is marked as always scoring

wintry solar
runic pecan
ionic verge
#

moving this here bc i posted in wrong spot

prisma loom
sturdy compass
# wintry solar How are you checking it works?

Both visually and actually playing a stone card with the joker present. If I'm not mistaken, setting replace_base_card to false allows the base card sprite to render? Also playing still only gives +50 chips

wintry solar
#

Did you respawn your joker?

sturdy compass
#

yes

#

I've been trying on new runs as well

wintry solar
ionic verge
#

16/21 commons in a second test

runic pecan
ionic verge
prisma loom
#

So this part of the code creates an array of your jokers, then choses one and duplicates it and then adds to your deck

#

right?

prisma loom
#

Im working off of it

wintry solar
ionic verge
#

lemme show what code its replacing

runic pecan
wintry solar
maiden phoenix
#

Repetitions do not give the "Again" too if you just return repetitions

ionic verge
#

it replaces whats in blue, and the stuff above is what rarity is initially defined as to determine what rarity its gonna be

#

does smods also patch this?

prisma loom
#

what?

wintry solar
sturdy compass
ionic verge
#

hm
thats not what my patch is called

sturdy compass
#

cool lol

ionic verge
#

looks like i know where to look

wintry solar
manic rune
#

hmmm

#

is it possible to code an AI which automatically play balatro for u

#

đŸ€”

ionic verge
#

well i did find the file smods is patching

sturdy compass
ionic verge
#

and it is indeed messing with mine

runic pecan
# prisma loom yeah

If you only want to duplicate ITSELF, then you should just drag if #G.joker.cards < G.jokers.config.card_limit then...end up to right under if pseudo...then and skip the pool building, skip the pseudo invis choosing, skip the local chosen_joker line, change it from local card to local _card, replace chosen_joker with card,

manic rune
ionic verge
#

so should i be targeting the toml file to patch or should i search for one of these lines in common_events to patch

wintry solar
# sturdy compass Here's everthing that should be affected

The set ability stuff should be hooking the Card:set_ability function, not take ownership stuff I think
Other than that, can you run a eval dp.hovered.config.center in debugplus whilst hovering a stone card you already had after getting the joker?

wintry solar
#

But make sure it retains functionality or you will break custom rarities

ionic verge
#

yeah

prisma loom
#

I need to remove negatives

#

ic ic

runic pecan
#

Sorry, the problems I spotted in that picture is a little bit too numerous.

prisma loom
#

I just stich toghether diff parts of the code from vanilla and then try to figure out how to make it work

runic pecan
prisma loom
#

one sec

#

oh shhoot

#

forgor chosen joker at the start

frosty dock
#

what's that formatting

#

and why are we calling card_eval_status_text manually?

prisma loom
ionic verge
#

hey is there an easier way to modify the rarity probabilities (like making uncommons appear more often etc) with a voucher before i patch something that smods is also patching

frosty dock
#

Rule #1 of base game jokers: don't copy from base game jokers

frosty dock
prisma loom
ionic verge
#

ok so i dont have to make a patch then right?

#

cus id really prefer not to bork custom rarities

#

cool

prisma loom
wintry solar
#

You can’t blame that monstrosity on vsc

prisma loom
#

idk man, you asking tough questions

runic pecan
# prisma loom

Now fix the indentations.
You also don't need the k_no_other_jokers line since it always has itself to copy.

prisma loom
ionic verge
#

so for this id put something like G.GAME.rare_mod = [itself] * 4 in the redeem function, right?

ionic verge
frosty dock
runic pecan
frosty dock
#

you're using G.joker instead of jokers in one place

#

and you're emplacing the original joker instead of the copy

#

the context check should be condensed to if context.end_of_round and context.main_eval and not context.blueprint then (the last part only if you really don't want it to be blueprintable)

frosty dock
ionic verge
#

mhm

#

in any case, seems my code works now

#

feels like theres a lot more uncommons/rares now

runic pecan
ionic verge
#

can we stop riffing on a new coders indentation?

#

there was a point where it was constructive but thats well past

runic pecan
#

@prisma loom How is your calc code right now? Post the screenshot.

prisma loom
ionic verge
#

how do i have a deck automatically give a voucher at the start?

prisma loom
#

give me a minute

normal crest
#

Maybe the lua extension already does it, right click anywhere in your code, format document

frosty dock
prisma loom
#

💀

minor magnet
#

how would i make it so a joker adding multiple editions at once only triggers the sound once?

ionic verge
prisma loom
frosty dock
frosty dock
ionic verge
#

just copy this wholesale (and set the key up right)?

frosty dock
ionic verge
#

ooooh use config

#

ok

#

dur

frosty dock
#

voucher being a single voucher key or vouchers being a table thereof

ionic verge
#

got it

runic pecan
prisma loom
#

card eval line went down

#

my bad

ionic verge
#

so this

normal crest
ionic verge
#

good point

runic pecan
# prisma loom

And then _card:add_to_deck() and G.jokers:emplace(_card) instead of card:add_to_deck() and G.jokers:emplace(card).

prisma loom
#

whats the diff between _card and just card?

normal crest
#

You defined _card right above

prisma loom
#

just a name?

normal crest
#

Card is passed to the function, it refers to your joker

#

Yes just a name

prisma loom
#

ah ok

runic pecan
prisma loom
#

ohhhh

#

makes sense

prisma loom
#

but joker does nothing atm

#

at least it's not crashing the game lol

normal crest
#

Well it's a 1 in 6 chance

prisma loom
#

that's smth

prisma loom
ionic verge
#

two things
this kind of context will work in a back's calculate, right?
and how would i code it to increase the price of all jokers in the future, not just the ones in hand

sturdy compass
normal crest
prisma loom
#

"1.0.0~ALPHA-1302a-STEAMODDED"

normal crest
#

That's why

prisma loom
#

?

normal crest
#

Either update or don't use "context.main_eval"

#

Cus I think that's new

#

You have a very old version

#

So preferably update

prisma loom
normal crest
#

The smods folder yes

#

When updating

ionic verge
#

instead of calculate?

frosty dock
#

no as context instead not individual and not repetition

#

context.end_of_round and context.main_eval

normal crest
#

Is main eval just a replacement for not (context.repetition or context.individual)

prisma loom
normal crest
#

Crash log

prisma loom
#

one sec

#

Oops! The game crashed:
functions/common_events.lua:992: attempt to call method 'juice_up' (a nil value)

Additional Context:
Balatro Version: 1.0.1n-FULL
Modded Version: 1.0.0~ALPHA-1404b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.6.0
Platform: Windows
Steamodded Mods:
1: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.3.1, Uses Lovely]
2: Handsome Devils by Kars [ID: HandsomeDevils]
3: Item Remover by elial1 [ID: ItemRemover, Priority: -1]
Lovely Mods:

Stack Traceback

(3) LÖVE method at file 'boot.lua:352'
Local variables:
errhand = Lua function '(LÖVE Function)' (defined at line 553 of chunk [lovely debugplus.console "console.lua"])
handler = Lua function '(LÖVE Function)' (defined at line 553 of chunk [lovely debugplus.console "console.lua"])
(4) Lua field 'func' at file 'functions/common_events.lua:992'
Local variables:
(*temporary) = nil
(*temporary) = table: 0x3f2d7480 {alerted:true, _saved_d_u:true, original_key:bsplit, mod:table: 0x3ef52ca0 (more...)}
(*temporary) = number: 0.6
(*temporary) = number: 0.1
(*temporary) = string: "attempt to call method 'juice_up' (a nil value)"
(5) Lua method 'handle' at file 'engine/event.lua:93'
Local variables:
self = table: 0x3f689dd0 {start_timer:true, timer:TOTAL, blockable:true, trigger:before, func:function: 0x3f689d80 (more...)}
_results = table: 0x3f6d42e0 {blocking:true, pause_skip:false, time_done:false, completed:false}
(6) Lua method 'update' at file 'engine/event.lua:182'
Local variables:
self = table: 0x3f46c898 {queue_last_processed:7.9833333333333, queues:table: 0x3f46c8c0, queue_dt:0.016666666666667 (more...)}
dt = number: 0.00605363
forced = nil
(for generator) = C function: next
(for state) = table: 0x3f46c8c0 {unlock:table: 0x3f46c8e8, other:table: 0x3f46cd60, tutorial:table: 0x3f46c938 (more...)}
(for control) = number: nan
k = string: "base"
v = table: 0x3f46c910 {1:table: 0x3f6b0588, 2:table: 0x3f7cdbc0, 3:table: 0x3f689dd0, 4:table: 0x3f326920 (more...)}
blocked = boolean: false
i = number: 3
results = table: 0x3f6d42e0 {blocking:true, pause_skip:false, time_done:false, completed:false}
(7) Lua upvalue 'gameUpdateRef' at file 'game.lua:2524'
Local variables:
self = table: 0x3ee264b8 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x3f57a1e8 (more...)}
dt = number: 0.00605363
http_resp = nil
(8) Lua method 'update' at Steamodded file 'src/ui.lua:84'
Local variables:
self = table: 0x3ee264b8 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x3f57a1e8 (more...)}
dt = number: 0.00605363
(9) Lua field 'update' at file 'main.lua:996'
Local variables:
dt = number: 0.00605363
(10) Lua function '?' at file 'main.lua:935' (best guess)
(11) global C function 'xpcall'
(12) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '?' (defined at line 906 of chunk main.lua)
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])

frosty dock
#

it's mostly to avoid the use of negative context checks because they're very fragile

normal crest
#

And lovely too

prisma loom
#

kk

frosty dock
#

don't add multiple editions-? cards can only have one anyway

maiden river
#

is there documentation on custom sets? e.x. the cine cards in reverie

runic pecan
prisma loom
#

I added these launch options

#

and game doesnt launch now

normal crest
#

That's for linux

ionic verge
#

how would i have my deck increase the price of jokers in the shop by one?

prisma loom
#

`Oops! The game crashed:
functions/common_events.lua:992: attempt to call method 'juice_up' (a nil value)

Additional Context:
Balatro Version: 1.0.1n-FULL
Modded Version: 1.0.0~ALPHA-1404b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.7.1
Platform: Windows
Steamodded Mods:
1: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.3.1, Uses Lovely]
2: Item Remover by elial1 [ID: ItemRemover, Priority: -1]
3: Handsome Devils by Kars [ID: HandsomeDevils]
Lovely Mods:

Stack Traceback

(3) LÖVE method at file 'boot.lua:352'
Local variables:
errhand = Lua function '(LÖVE Function)' (defined at line 553 of chunk [lovely debugplus.console "console.lua"])
handler = Lua function '(LÖVE Function)' (defined at line 553 of chunk [lovely debugplus.console "console.lua"])
(4) Lua field 'func' at file 'functions/common_events.lua:992'
Local variables:
(*temporary) = nil
(*temporary) = table: 0x33838cc0 {alerted:true, _saved_d_u:true, original_key:bsplit, mod:table: 0x33227c40 (more...)}
(*temporary) = number: 0.6
(*temporary) = number: 0.1
(*temporary) = string: "attempt to call method 'juice_up' (a nil value)"
(5) Lua method 'handle' at file 'engine/event.lua:93'
Local variables:
self = table: 0x33a755a0 {start_timer:true, timer:TOTAL, blockable:true, trigger:before, func:function: 0x33545510 (more...)}
_results = table: 0x33c626a8 {blocking:true, pause_skip:false, time_done:false, completed:false}
(6) Lua method 'update' at file 'engine/event.lua:182'
Local variables:
self = table: 0x3394cb80 {queue_last_processed:13.683333333334, queues:table: 0x3394cba8, queue_dt:0.016666666666667 (more...)}
dt = number: 0.00607035
forced = nil
(for generator) = C function: next
(for state) = table: 0x3394cba8 {unlock:table: 0x3394cbd0, other:table: 0x3394d048, tutorial:table: 0x3394cc20 (more...)}
(for control) = number: nan
k = string: "base"
v = table: 0x3394cbf8 {1:table: 0x33832d18, 2:table: 0x33f51c48, 3:table: 0x33a755a0, 4:table: 0x337cb450 (more...)}
blocked = boolean: false
i = number: 3
results = table: 0x33c626a8 {blocking:true, pause_skip:false, time_done:false, completed:false}
(7) Lua upvalue 'gameUpdateRef' at file 'game.lua:2524'
Local variables:
self = table: 0x33306358 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x33c6abf0 (more...)}
dt = number: 0.00607035
http_resp = nil
(8) Lua method 'update' at Steamodded file 'src/ui.lua:84'
Local variables:
self = table: 0x33306358 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x33c6abf0 (more...)}
dt = number: 0.00607035
(9) Lua field 'update' at file 'main.lua:996'
Local variables:
dt = number: 0.00607035
(10) Lua function '?' at file 'main.lua:935' (best guess)
(11) global C function 'xpcall'
(12) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '?' (defined at line 906 of chunk main.lua)
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])`

ionic verge
runic pecan
normal crest
ionic verge
#

so is shop_jokers all jokers currently in the shop or all jokers that can be in the shop

runic pecan
ionic verge
#

for the record the idea is this:

runic pecan
prisma loom
#

still crashes :(

normal crest
#

Same crash log

#

?

prisma loom
#

let me check

#

Oops! The game crashed:
functions/common_events.lua:992: attempt to call method 'juice_up' (a nil value)

Additional Context:
Balatro Version: 1.0.1n-FULL
Modded Version: 1.0.0~ALPHA-1404b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.7.1
Platform: Windows
Steamodded Mods:
1: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.3.1, Uses Lovely]
2: Handsome Devils by Kars [ID: HandsomeDevils]
Lovely Mods:

Stack Traceback

(3) LÖVE method at file 'boot.lua:352'
Local variables:
errhand = Lua function '(LÖVE Function)' (defined at line 553 of chunk [lovely debugplus.console "console.lua"])
handler = Lua function '(LÖVE Function)' (defined at line 553 of chunk [lovely debugplus.console "console.lua"])
(4) Lua field 'func' at file 'functions/common_events.lua:992'
Local variables:
(*temporary) = nil
(*temporary) = table: 0x2216ccd8 {alerted:true, _saved_d_u:true, original_key:bsplit, mod:table: 0x21c38468 (more...)}
(*temporary) = number: 0.6
(*temporary) = number: 0.1
(*temporary) = string: "attempt to call method 'juice_up' (a nil value)"
(5) Lua method 'handle' at file 'engine/event.lua:93'
Local variables:
self = table: 0x21ec5ff0 {start_timer:true, timer:TOTAL, blockable:true, trigger:before, func:function: 0x2259de80 (more...)}
_results = table: 0x22647f60 {blocking:true, pause_skip:false, time_done:false, completed:false}
(6) Lua method 'update' at file 'engine/event.lua:182'
Local variables:
self = table: 0x2235c350 {queue_last_processed:17.066666666667, queues:table: 0x2235c378, queue_dt:0.016666666666667 (more...)}
dt = number: 0.00605156
forced = nil
(for generator) = C function: next
(for state) = table: 0x2235c378 {unlock:table: 0x2235c3a0, other:table: 0x2235c818, tutorial:table: 0x2235c3f0 (more...)}
(for control) = number: nan
k = string: "base"
v = table: 0x2235c3c8 {1:table: 0x21e1e858, 2:table: 0x21ec5ff0, 3:table: 0x2202c090, 4:table: 0x221aec48 (more...)}
blocked = boolean: false
i = number: 2
results = table: 0x22647f60 {blocking:true, pause_skip:false, time_done:false, completed:false}
(7) Lua upvalue 'gameUpdateRef' at file 'game.lua:2524'
Local variables:
self = table: 0x21d16400 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x223dfd40 (more...)}
dt = number: 0.00605156
http_resp = nil
(8) Lua method 'update' at Steamodded file 'src/ui.lua:84'
Local variables:
self = table: 0x21d16400 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x223dfd40 (more...)}
dt = number: 0.00605156
(9) Lua field 'update' at file 'main.lua:996'
Local variables:
dt = number: 0.00605156
(10) Lua function '?' at file 'main.lua:935' (best guess)
(11) global C function 'xpcall'
(12) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '?' (defined at line 906 of chunk main.lua)
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])

runic pecan
#

The crash log says you tried to juice up a nil object, which it can't.

normal crest
#

Its saying juice_up doesn't exist

prisma loom
#

ive deleted it now

#

it worked even with it

#

it shouldnt be the cause of the crash

normal crest
#

If you toggle your mod off does it load

#

Just move it outside mod folder

runic pecan
#

What timing/event does the crash happen?

prisma loom
prisma loom
#

should it?

normal crest
#

So it's crashing without your mod?

prisma loom
#

it crashes at end of round

#

when my modded joker should duplicate itself

normal crest
#

Could be a smods error too

#

I see the issue now tho

prisma loom
#

is it fixable?

normal crest
#

In your code change your card_eval_status_text to

return {
   message = localize("blah blah")
}
runic pecan
normal crest
#

I think the issue is you're using "or self" instead of "or card", but you can just replace that entire line with the return I sent

wintry solar
prisma loom
#

but if Joker is negative it creates 2 non negative copies of itself

maiden river
#

made the custom card area, but the card doesn't go in there yet

sturdy compass
wintry solar
#

Oh the drawing will specifically check for stone too

#

I don’t know why I didn’t think of that first

sturdy compass
#

oh bruh

runic pecan
wintry solar
#

You can probably just change the name value in the center

#

I don’t think that’ll break anything

sturdy compass
#

surely

prisma loom
#

Negative (original) stays + spawns 2 copies with no edition

normal crest
#

You might need to put your copying code in an event

prisma loom
#

but only if Im at 4/6 spaces in joker area

runic pecan
#
G.E_MANAGER:add_event(Event({
    func = function()
        _card:add_to_deck
        G.jokers:emplace(_card)
        return true
    end
}))```
ionic verge
#

how would i loop through all jokers in the game

#

its not G.jokers right? cus thats just the ones you have

frosty dock
#

for what purpose?

runic pecan
frosty dock
#

G.P_CENTER_POOLS.Joker works

ionic verge
frosty dock
#

uh

#

isn't there G.GAME.inflation or something like that

wintry solar
#

Can’t you hook set_cost?

#

Oh that works too

ionic verge
wintry solar
#

There is indeed something like that yeah

ionic verge
#

(and again its specifically for this)

runic pecan
#

*are increased

ionic verge
#

noted

runic pecan
#

What if there's a coupon tag used?

#

Or any other tag that would spawn a free joker.

ionic verge
#

i mean should just apply after this i feel

runic pecan
prisma loom
#

yes

#

done

runic pecan
#

Hold Shift and click Tab twice

prisma loom
#

done

runic pecan
#

And delete the last three lines before else

prisma loom
#

done!

runic pecan
#

Now post the screenshot.

prisma loom
#

yeah ig these were dupes

runic pecan
ionic verge
#

does the % operator exist in lua 5.1?

prisma loom
wintry solar
runic pecan
ionic verge
#

ok so thats not why code dont work

minor magnet
#

if i wanted to make a joker that destroys all debuffed cards in the deck, how would i do that?

ionic verge
#

so im using inflation right, right?

frosty dock
#

oh right vanilla

runic pecan
potent glen
#

Quick question about the documentation, how can I get the card being added in the playing_card_added context?
I've tried to access cards as an array like cards[0]:get_id() and it says cards is null, and when i access cards as a single variable like cards:get_id() the error message also says nil?

wintry solar
#

context.cards is the array

runic pecan
potent glen
potent glen
#

Also thank you @wintry solar and @runic pecan I'm probably missing both of those!

runic pecan
prisma loom
#

it works now

#

wtf

#

I didnt do anything

#

just tried to launch the game

#

once more

#

its fixed now!

#

everything works

potent glen
dusk harness
runic pecan
minor magnet
#

my jokers are getting incredibly creative, will probably release the mod soon

dusk harness
dusk harness
ionic verge
tepid crow
#

I have a joker with a foil tooltip (since it works with the Foil edition), but it gets the tooltip twice if the joker has the foil edition
I don't like the double tooltip, is the best way to prevent really to check if the joker has the edition?

dusk harness
runic pecan
tepid crow
ionic verge
#

sanity check
2 % 2 will return zero, right?

minor magnet
#

not sure which would be better

wintry solar
#

I don’t think any cards are debugged when you select a blind

runic pecan
#

Yeah, maybe change it to first drawn hand.

maiden river
#

I see in the smods docs that consumables have a calculate function
does it actually work with the joker contexts (like joker_main, before, after, etc.)?

minor magnet
#

on boss blinds they are debuffed from the moment you press the button

wintry solar
#

Huh

#

I suppose that makes sense

wintry solar
maiden river
#

hmm

#

mine isn't for some reason

#

lemme send the code

#
SMODS.Consumable({
    key = "boira",
    set = "Weapon",
    atlas = 'placeholder',
    loc_txt = {name = "Boira", text = {"Everyone's favorite weapon!"} },
    calculate = function(self, card, context)
        if context.joker_main then
            print("this ran!")
            return {
                chips = 10
            }
        end
    end,
})```
lusty epoch
storm kraken
#

what does this even do

maiden river
#

it's ten chips

lusty epoch
maiden river
#

I'm adding another slot for consumables

storm kraken
#

oh k

maiden river
#

but it doesn't work lmao 😭

ionic verge
#

ok why isnt this saying config exists

storm kraken
#

i didnt know you could use calculate on consumeables

ionic verge
#

it very much does

wintry solar
maiden river
#

oh

#

that would make sense, actually

#

is that something that smods covers or do I have to figure that out on my own

wintry solar
#

There’s a function you need to hook

tepid crow
old bane
#

how do i check what rank is being played in a Three of a Kind (and all other hands containing it, like a Full House and Five of a Kind)?

Cause I can guess how it works for a Three of a Kind, but for the Full House, I don't know how I would find out which rank there is more of

devout pewter
#

Hi, I want to make a Joker give x1.5 mult, increasing by x0.5 per card scored, if the played hand is a hearts flush. How would I go about doing it? I read some references in the smods wiki, but I'm horribly lost as to what I can do and can't do. Would anyone be kind and walk me through on how to do it?

#

Do I set a function as the xmult variable and check for the card scored context?

#

and then just call that xmult variable every time a card scores?

prisma loom
old bane
#

what does the crash say

prisma loom
old bane
#

can you show me line 175 of your code please, i can't see the line numbers in your screen shot

old bane
#

oh wait i think i see the error, you have vars == instead of vars =

#

what the code thinks you're doing is you're comparing vars to center.ability.extra.Xmult, which it can't do.

you have to have it so that the value in vars is your card.ability.extra.Xmult variable

wintry solar
#

There’s also normal brackets not curly ones

prisma loom
old bane
prisma loom
#

oh yeah its the brackets

wintry solar
#

Start a new run

maiden river
#
[manifest]
version = "1.0.0"
priority = 15

[[patches]]
[patches.pattern]
target = 'smods/src/utils.lua'
pattern = "-- TARGET: add your own CardAreas for joker evaluation"
position = "before"
match_indent = true
payload = "t[#t+1] = G.weapons"

my patch doesn't seem to be applied, although I think I'm doing it right, based on older messages

wintry solar
#

The target is wrong

maiden river
#

oh?

#

what should it be

manic rune
#

what's the difference between Xmult_mod and x_mult?

wintry solar
#

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

maiden river
#

that also makes sense

old bane
wintry solar
manic rune
#

oh, so if i use Xmult_mod then I'd need to manually make the message, while x_mult does that automatically basically?

manic rune
old bane
maiden river
wintry solar
#

You don’t need to do anything _mod anymore

old bane
#

When I play a Full House, how do I get the "more common" rank (aka the rank that I play 3 of)?

wintry solar
#

Look at the three of a kind part of the poker hands table

runic pecan
old bane
wintry solar
#

Yeah

prisma loom
#

I want odds to dynamically change in the descp of the Joker when its affected by smth like opps joker. Am I doing it right?

normal crest
#

oops all 6s modifies G.GAME.probabilities

#

so your joker is already compatible

#

if you want it to change on the description you should return G.GAME.probabilities.normal as a var in loc_vars

#

and change the joker description accordingly

marble flint
#

Namely, use #2# to for a second interpolated variable

ionic verge
normal crest
#

in the description #1# refers to the 1st value you return in vars, #2# to the 2nd and so on

prisma loom
#

ahhh

#

so thats why it shows me 1.5

#

just like my mult does

#

ic ic

#

Is there a way to give Joker a custom sell value?

#

not just half of its cost as it is on default

fringe ember
#

Do we have a quick/easy ref doc for contexts [like singling out, say, Heart face cards]? Dipping my toes into modding this game and I have never coded in Lua before, but got a background in Python and whatever language BG3 uses [I think Osiris?]

#

what I'm basically doing is making a companion mod to my skin mod

marble flint
#

Yeah, it's pretty easy

#

iirc there's Card:is_face() and Card:get_suit() (or something similar)

rough furnace
#

Card:is_suit iirc

#

(so wild cards work)

marble flint
#

ah, it's Card:is_suit('Hearts')

minor magnet
#

how do i check if card sold is a consumable

rough furnace
#

if you have the card you can check card.ability.consumeable iirc

minor magnet
#

ok alright

fringe ember
#

did i ruin my run just to get this shot for when i eventually release it? yes, yes i did

#

but i had to cause idk when i was able to get the opp again

#

anyway back to picking apart code to see how it works ✌

last sentinel
#

Anyone know how to change the "poker hand" in a calculation step? Or if its easier, get the chip/mult value for the current level of a hand? e.g. A joker "turns" two-pairs into 4 of a kinds, I want the chips/mult to change accordingly either by directly changing the hand or by pulling whatever the current 4oaK level is so i can add it to the 2-pair

wind turtle
#

how do I check what suit a card is?

violet void
#

card:is_suit

tepid crow
wind turtle
#

thanks

#

not suit i meant enhancement

#

im stupid and woke up pretty sick this morning forgive me

#

i need to check what enhancement a card has

marble flint
#

check card.ability (for playing cards)

#

in particular, card.ability.name is helpful

wind turtle
#

ok, is there a way to also do that for seals?

violet void
#

card.seal afaik

wind turtle
#

seemingly not

#

or maybe itll only do that if the seal exists?

#

or maybe its because i tried to do card.seal.name

violet void
#

just seal

wintry solar
#

Don’t use .name on anything

marble flint
#

card:get_seal(true) (the true ignores debuffs)

violet void
#

eremel I have one question i wasnt able to get an answer to, if youre available

fallen pelican
#

are most of the mod devs working with new calc already?

wind turtle
#

one final thing, how do I get what edition (foil/polychrome/etc) a card is?

violet void
#

do you know where I need to look for handling partial hiding for the cards? I need to add a check for my custom center

so far I only found the full hide

wintry solar
#

Hiding?

violet void
#

of the card info

#

when its not discovered

wintry solar
#

Oh

#

I don’t know, sorry

violet void
#

But I found out the issue is that it discovers the card instantly when they are generated in the pack rather than when I buy them

#

I tested with prints and it only happens with my center and not the other cards, I cant understand how they avoid it

#

wasnt successful following self.params.discover

wind turtle
prisma loom
prisma loom
#

One of my favourite ones! :D

marble flint
#

that sounds right

prisma loom
#

I'll add that rn

marble flint
prisma loom
#

this magic

marble flint
#

no, the in-game util

#

sorry

marble flint
#

Thanks

wind turtle
#

time to make a function!!! yay!!!

wintry swallow
#

using steamodded, if i create a new lua file can i just import it as a module ?

prisma loom
old bane
#

how do i detect the edition of a card? (for example, if a card is foil)

wind turtle
#

had to make this silly little function

wind turtle
wintry solar
wind turtle
#

but sometimes that'll be null

wind turtle
wintry solar
#

That’s a completely unnecessary function

wind turtle
#

without it the game crashed

wintry solar
#

Just make sure it has one first

#

card.edition and card.edition.key or nil

old bane
#

or like G.P_CENTERS.m_foil

wintry solar
#

e_foil would be the key for foil

#

That isn’t where your crash is

wintry swallow
#

line 359 pls

late shadow
#

forgot to include the numbers

#

wait

#

wrong thing 😭

#

i put the wrong sc, of a diff attempt

wintry solar
#

Your context check isn’t specific enough

late shadow
#

ahh ty

#

what am i missing ?

#

its supposed to be whenever a joker is ever added

#

so not like a specific context like at end of blind or shop etc

wintry solar
#

Well when do you want it to trigger

wind turtle
#

anyways the joker works now

late shadow
#

its looking for if any joker with meeb in its name is ever added

wind turtle
#

it gives 5x mult if you play two of the exact same card (seal, edition, rank, suit, and enhancement)

rough furnace
late shadow
#

its pretty much the same thing as baseball card, except instead of rarity it searches for if its any of a few specific jokers

topaz sun
#

How can i make those position indicators appear in Option Cycles in a mod config?

ionic verge
#

how do i check if its a boss blind it is with context (and preferably, what ante it is as well)

violet void
#

context.blind.boss by looking at Madness

and G.GAME.round_resets.ante I think

old bane
#

how do i check the name of a Joker and find a word in that Joker’s name? i think string find would work for the second part, but how would i get the joker name?

wind turtle
#

ok i was getting this error, idk why

#

i tried to send this ~6 minutes ago and there was some sort of outage lol

old bane
#

are you looping through an array? if so, make sure you have #(arrayname) so that it gets the length of the array

wind turtle
#

all my jokers that loop through an array work

#

it happens in one with No looping at all

#

the one that has a 1% to instantly end the run

dreamy thunder
#

im so lost, how would i make a config file and menu for my mod?

violet void
dreamy thunder
#

yh nvm the file

#

i got it

dreamy thunder
dreamy thunder
#

thanks

naive notch
#

Is it possible to create a joker whose effects are always active, even if you dont have it?

rough furnace
#

what is it's effect?

naive notch
#

I didnt have anything in mind, I was just wondering if it was possible

marble flint
#

Sure it's possible

#

mildly annoying but possible

mellow marsh
#

the mod i've been working on is nearly finished and i'm very excited to release it but i'm worried people are gonna blow me up for terrible code

#

i don't know if cross-mod compatibility is something a lot of mods tend to try to prioritize but i feel like my mod likely won't be compatible with very much bc of how many patches i have to do everywhere

tepid crow
#

cross-mod compat is usually better than you expect in my experience

#

though I would still recommend checking out Dim's modpack together with your mod to see if any obvious issues arise

marble flint
orchid thunder
#

how tf do seals work

#

im tryong to create a custom object that works like seals and i cant get it to work

wintry solar
#

why is this in a toml file

smoky talon
#

This is my first time doing anything with code, I’m trying to make my first balatro mod. I’m making a tarot card that turns 4 cards into queens, I used most of the code from the strength tarot card. whenever I launch the game it gives this error

wooden badge
#

@smoky talon Which line is 132 exactly in your code

smoky talon
#

The first one that says local suit prefix

wooden badge
#

It has a problem with the way you have declared one of those local variables, not sure exactly what though off the top of my head

#

what is string.sub?

#

If it spits out a string then I think it might not like how you’ve appended the underscore

smoky talon
#

I just copied the code for strength

edgy reef
#

G.hand.highlighted[i] is the problem

smoky talon
#

I see

wooden badge
#

Oh completely missed that

#

Yeah the line above isn’t really doing anything

smoky talon
#

Delete it?

wooden badge
#

Well the point is that you are looping through the elements in the highlighted hand array so the ‘I ’ indexing is necessary to access it

smoky talon
#

I deleted it and now it says this (sorry for the weird pics lol, I’m using discord on my phone)

#

I can readd it if needed

wooden badge
#

Hang on

smoky talon
#

K

wooden badge
#

Gonna switch to my laptop

#

Phone is crap for typing

smoky talon
#

Fair

wooden badge
#

you need to assign the element G.hand.highlighted[i] as a local variable

#

probably card if you copied it straight from Strength, seeing as the following line is using an undefined object called 'card'

smoky talon
#

How do I do that?

wooden badge
#

just say local card = G.hand.highlighted[i]

#

and then card is referenced properly in the next line

wintry solar
#

@maiden phoenix added the default 'Again!' message, what was the other problem?

wooden badge
#

you realise that without a reference to an i anywhere within your for loop you can't actually iterate through the array?

maiden phoenix
smoky talon
wintry solar
#

which context was the juicing in?

wooden badge
#

and delete the one above that is the problem

maiden phoenix
#

Anything that usually uses card = card, for my case it was repetitions and G.hand individual

wooden badge
#

the G.hand.highlighted[i] on its own needs to go

#

because it doesnt know what to do with it

smoky talon
#

I deleted that and now it says this

wooden badge
#

show your code now

#

because its syntax issue

smoky talon
tepid crow
#

do you not have discord on your computer/laptop btw? why are we taking pictures of the screen instead of screenshots, or better yet, code blocks

smoky talon
#

I don’t have it on Mac

tepid crow
#

(you're missing an end)

smoky talon
#

I can get it if I need to

wooden badge
#

yeah there is an end missing for the elseif

#

you should be wary of how you indent things to keep track of nested branches

#

i personally hate single line if branches unless they are dead short

smoky talon
#

It works now

#

Never mind

#

The game opens but the card does nothing

wooden badge
#

what do you want it to do?

#

oh right sorry you did say earlier

#

missed that

smoky talon
#

it should convert up to 4 cards to queens

#

im on my mac now too btw

wooden badge
#

well where is it actually doing the conversion?

smoky talon
#

so screenshots should look better

wooden badge
#

I think the set_base function handles that?

smoky talon
#

i assumed that what i had was doing it but it seems that just declares rank suffixes instead of changing them

wooden badge
#

but you've just assigned loads of variables and passed them through if branches, there is no process actually doing the conversion

smoky talon
#

i see that now

wooden badge
#

You'll need to fiddle with your if logic in order to check if the highlighted card is NOT a queen

smoky talon
#

any idea how i actually do the concversion? can't seem to find it in the source code

wooden badge
#

and then turn it into one

#

i've just checked strength now and seen you've copy and pasted a portion exactly - strength doesn't really do what you want to

smoky talon
#

its the closest base-game card to what im trying to do, so i figured it could help, but it seems not

wooden badge
#

well it will, but you need to understand what it is actually doing and edit appropriately - you can't copy exactly and expect it to work

smoky talon
#

thats why im here lol, to find out what im siupposed to do

wooden badge
#

have you ever coded at all before?

smoky talon
#

not much

#

just a little bit

wooden badge
#

ok, it is worth understanding principles but there is no reason why you can't learn doing this

smoky talon
#

alright

wooden badge
#

so if you look at line 129, the rank_suffix definition is doing what strength is meant to do so you probably don't need the stuff on the right of the equals for that

smoky talon
#

like this?

wooden badge
#

yeah and you will just need an if check like if rank_suffix ~= 12 then rank_suffix = 'Q' . It's a little improper to have rank_suffix as an integer and assign it as a string after, but the string is what is going to go in set_base. if you want you can have two separate variables handling that

#

card:set_base(G.P_CARDS[suit_prefix..rank_suffix]) I believe this actually does the conversion

smoky talon
#

it works

#

it feels so staticany way to get the animation though?

#

my keybaodr messed up lol

#

any way to get the animation for the transformation?

wooden badge
#

well set_base doesn't handle the animation, just the mechanic. If you look back at the source code and check the function Strength's code resides in (use_consumeable) then you will see line 1102-1109 handles the animation

last sentinel
#

Whats the best way to dynamically change the extra.mult in a joker's config within the calculation function?

wooden badge
#

well 1106-1109 does the animation

#

1102-1105 juices the tarot used

wooden badge
#

are you trying to update the mult value on a joker after osmething happens, like spare trousers and fortune teller?

last sentinel
#

Sorta, it doesnt increase mult though i need to set it to a value, i guess id just be changing mult then not extra

#

The joker adds the chips and mult depending on the hand played,

simplified example: I need to have 4 mult for a full house and 2 for a three of a kind. I have all the logic figured out and the mult and chips i want to be added stored in a variable i just need to directly add the mult and chips

frosty dock
minor magnet
#

chat is he perfect yes or yes

frosty dock
#

yes

last sentinel
#

he's everything

wintry solar
#

what is the squeaky sound

minor magnet
smoky talon
#

the animation kinda works, it just spins around 3 times tho, really funny and fits the mod though so im keeping it

#

thanks for all the help

#

ill probably be back for more help later lol

wooden badge
#

are these mult and chip values what are shown on their planet cards?

minor magnet
wintry solar
minor magnet
# minor magnet

originally he didn't even give mult but I wanted to make him just the littlest bit useful so you have a reason to buy him other than love

old bane
#

if i wanted to get variables from another joker would i do something like
context.other_card.ability.extra.varname
or
context.other_card.config.extra.var

wintry solar
#

he's great

modern kindle
last sentinel
wooden badge
#

when do you want to mult and chips to be given, during the main joker calculation phase?

#

like when it goes ding ding ding ding along the line

last sentinel
#

ideally before but along the line ding dong works too

wooden badge
#

Right so for that you need to be in context.cardarea == G.jokers and context.joker_main and then return the vars you've shown

#

but obvs they are default zero

#

so maybe in context.before you'll want them to update according to the hand played

wintry solar
#

you don't need a cardarea check in joker_main

old bane
#

is there documentation on like what each context does?

wintry solar
last sentinel
#

sick okay was already doing as such so hopefully that in joker_main should work

wooden badge
#

you might not need it but it will still access

last sentinel
#

alright we went from crashing on start to not working

#

I call that progress

wooden badge
#

it most certainly is

#

you'll need to update their values in context.before

#

if you havent already

mellow marsh
last sentinel
#

oh so update vars in both context.before and joker.main?

fringe ember
#

-# i'm so braindead, i didn't realize there was a modding for dummies part of the smods docs

wooden badge
wintry solar
#

you can update them in joker_main

#

it doesn't matter where you update them

wooden badge
#

if you want a message to push before scoring then it will need to be in before

#

but yeah technically you can update them wherever

#

but i'd assume you'd want to notify the player of the new values before scoring like something like spare trousers or runner does

wintry solar
#

it would depend on what the effect actually is

fringe ember
#

Asking a dummy's question, but I assume the atlas pos is measured in pixels? Like if there's 2 cards in a row horizontally, Card A would be 0,0 anc Card B 72,0

#

and then Card C on a new line 0,96

timid parrot
#

Nope

marble flint
#

nope! it's measured in full cards

last sentinel
#

nah thats why you need px and py to define the pixel width and height

marble flint
#

so, 0,0, 1,0, 0,1

last sentinel
# wintry solar it would depend on what the effect actually is

I'm basically wanting the game to "treat" one hand as if its another. i.e. I played a two pair but i want the chips and mult of a full house. I'm adding the chip and mult difference between the two hands to the chips and mult, therefore id want it to be added likely right when the hand is played

#

still not getting anything changing though. is it literally just self.vars = {value_1, value_2} or should i be calling something else?

fringe ember
#

i am so glad i asked

fringe ember
wooden badge
last sentinel
#

Yeah i already am

wintry solar
#

you should probably alter them before any joker calculation is called at all tbh

wooden badge
#

like at what point is this happening

#

because I've never used this way before

last sentinel
#

at the very end, within calculate/context.before

#

very new to lua/smods so please share any better ideas for getting it done lol

wooden badge
#

so are you sure that that third line is behaving properly, like you know that mult_to_add and chips_to_add are the correct values

last sentinel
wooden badge
#

for debugging you can just put prints in on variables to see what their values are

#

it will show in the console

last sentinel
#

ooh word

#

but tried putting just like integers direct into the self.vars call and it still wasnt doing anything so something else is afoot

#

but will try that

wooden badge
#

yeah I don't think that self.vars thing works because it's not telling the game to insert those values into the hand score anywhere,

#

also I'm not sure why you are referencing the getting_sliced context, I think that is only for start of round destruction

#

like dagger and madness 'slicing' a joker for its effect

#

you'll need context.cardarea == G.jokers as well as a check

last sentinel
#

makes sense, building this on the foundation of a Buffoonery joker so they probably had that in theirs for some other purpose

wooden badge
#

with the before context

smoky talon
#

how do i make a tarot card that upgrades the last played hand by 4 levels?

wooden badge
#

the inner if check will only need to check one or the other because it can never be both

#

like if it is a two pair then it most certainly isn't a full house ever

#

by this i mean you just need to check if it is a two pair right?

#

You can rid of the 'if not full house' check

wooden badge
smoky talon
#

i know, just wondering what function to use, cant seem to find the one that does the upgrading in the source code

#

ive been looking

timid parrot
#

Probably gonna require some injections

#

Also w o w 4 levels for a tarot card?!

smoky talon
#

its gonna be a bit broken lol

last sentinel
# wooden badge You can rid of the 'if not full house' check

theres crashes without that check, pretty sure with how the processing of the paired cards works after that. thats also from the Buffoonery joker and there was a specific note that that was necessary to prevent crashes đŸ€·â€â™€ïž

wooden badge
smoky talon
#

alright

fringe ember
#

tossed it on gh just so i don't forget to later

wooden badge
#

@last sentinel so if im understanding, you want a played two-pair to become a full house by converting the unscored card into one of the two-pair ranks randomly?

last sentinel
#

Yes, thats what the Buffoonery joker did so its where im starting, and that has been working with what i have. Eventually want it to work for other played hands. More importantly though I want the game to recognize the hand as a full house either by directly recognizing the hand(which i think would take some patches or other injections to change the hand mid-play), or adding to the chips/mult to reflect the hand it becomes (which is where the mult_to_add and chips_to_add is coming from)

wooden badge
#

also in that single/index for loop you have value and idex the wrong way round - pairs produces index and value in that order

smoky talon
#

i copied the orbital code related to upgarding the levels and when i try to use it it says this

#

oh wait i should remove the orbital part

wooden badge
#

copying orbital's code verbatim is never going to work

smoky talon
#

i knew that, i just wanted to see if it did something so i could go from there

wooden badge
#

the source code should give you ideas of how a particular mechanic is programmed, you have to figure out your variables and the steamodded API basics yourself

smoky talon
#

k

wooden badge
#

you need to read what it is doing, make sense of it and then adapt it into your 'world'

#

I suggested orbital tag because it is something that levels up hands that aren't planets, so it will give you a jumping off point

old bane
#

so i have it so that certain Jokers have "types" (controlled by a variable in their config.extra/ability.extra) and I want to make it so that a Joker gets disabled if there are other Jokers of that "type", how would I check for that?

wooden badge
#

which mod is buffoonery from?

last sentinel
#

buffoonery is the name of the mod, Pertinent Argument is the joker that I got the unscored card two-pair/full house convert thing from

grand sage
#

hello I'm trying to make a mod and whenever I open the game with my mod active it gives me this error can anyone help me?

fringe ember
#

first initial thought is file naming/folder structuring

#
if context.joker_main and Card:is_suit('Hearts') and Card:is_face() then

            return {
                mult_mod = card.ability.extra.mult,
                message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
                
            }
end```
#

why do i have a feeling this is cataclysmically wrong

#

basically trying to get scored Heart faces to x2 mult

open aspen
#

does it not work?

wooden badge
#

what is the Card object?

#

because that looks taken directly from those functions' definitions in the source code

fringe ember
#

i have no clue

wooden badge
#

that won't do

fringe ember
#

i don't know lua like. at all

#

i know python

#

and a smidge of osiris

#

but not lua

wooden badge
#

it is using Card as the argument of the is_suit and is_face function, but it probably isn't declared anywhere in your code

#

you need to replace Card with the actual card elements you are trying to process

#

within context.individual and context.other_card as the actual playing card in question

#

im assuming you want it to work like bloodstone does

fringe ember
#

Yeah

#

Basically Bloodstone but with the face card caveat

#

and the not chance

wooden badge
#

and not inside joker_main because that takes place when all the jokers are being evaluated normally

#

use if context.cardarea == G.play then instead

fringe ember
#

i am still that one gif rn

#

hold on

#

i'm sorry for being a pain lmao but. new territory for me

wooden badge
#

so if context.cardarea == G.play then first

fringe ember
#

before or after joker_main

#

and that block

wooden badge
#

you will never need joker_main because your joker does nothing during the main joker phase

#

you need to read thishttps://github.com/Steamodded/smods/wiki/Guide-%E2%80%90-Joker-Calculation

GitHub

A Balatro ModLoader. Contribute to Steamodded/smods development by creating an account on GitHub.

old bane
#

how does four fingers make a hand a flush/straight? I would like to make it so that when i play all four suits it counts as a flush instead

wooden badge
#

reference bloodstone's source code as well

#

it comes down to entering context.individual which makes the playing card being evaluated context.other_card

#

its all there in the doc

#

step 4/5

#

goes through how cards are scored

fringe ember
#

o7 thanks

tall wharf
#

I've been trying to come up with an algorithm that basically allows you to play up to 14 cards in a row for straight

lucid owl
#

can card_eval_status_text() be made immediate? or should i just go for an event?

old bane
#

i can tell, my head hurts >_<

tall wharf
#

i think for you you just have to check for each card if it's in a suit

old bane
#

and then how would i change the current played hand into a flush (i think after that I would just have to make the scored_hand equal to the full hand so that all cards are scored)

marble flint
fringe ember
#

Getting this error on starting up. Swear I saw someone else having the same problem but it disappeared

#

It's funny cause it worked before I tried to muck around with theeeeeeeeeeeeeeeeeeeeeeee

#

joker code

grand sage
#

yeah im getting the same error as you

old bane
#

which file do i find the evaluate_poker_hand_ref function or poker_hand_list in balatro?

weak gate
#

can I change a joker's loc_txt.name... Aha, Larswijn said "don't do it lol" so that's a no

tepid crow
weak gate
tepid crow
#

oh I was helping that guy out with his code

weak gate
#

well I want a card to have a dynamic name, depending on how it was spawned

tepid crow
#

I asked him to change something in his calculate function, he changed something in his loc_vars function

weak gate
#

very curious

tepid crow
weak gate
#

a lot more, like "Jimbo's Assistant", "Egg's Assistant", etc

#

Hmm, what if I put a #1# in the name...

#

That does work

#

(if I do feed the correct variable as the first one in loc_vars, that is)

tepid crow
#

oh you can actually do that? was wondering if you could lol

marble flint
#

wait you can do that?? time to go simplify some code, lol

tepid crow
#

oh it works for jokers but not for decks

#

weird

weak gate
#

Very interesting
Heh, procedurally generated jokers... Well, ones with complex behaviors would be too much work, but making one that gives random amounts of chips, mult, etc...

tepid crow
#

well it's lot harder to have procedurally generated descriptions

#

(colours are a bit annoying)

nova finch
#

is there an easy way to chck for when a food joker is destroyed?

smoky talon
#

Im trying to fix one of my jokers. It is supposed to spawn 3 negative copies of a specific consumable. I am building off the code of a joker tutorial, and the way it is written is set to spawn a random consumable in the category, which i replaced with drugs (dont ask), and I cant find a way to make it spawn a specific one. Im also trying to adapt perkeo's code to duplicate it twice because spawing it 3 tims makes 2 jokers instead, but i cant figurre out how to make it target a specific consumable to copy

limber mist
#

What's the best practice for destroying a playing card?

dusk harness
#

ok time to work on the mod again,

#

if i put it inside of

if not G.STATE_COMPLETE then
end

it does nothing,
but if i dont it crashes and says that center is a nil value

#

i might also not be in the right callback for this

runic pecan
dusk harness
#

i get an infinite print loop with no data

nova finch
runic pecan
dusk harness
#

because the update_shop function keeps on getting called

runic pecan
runic pecan
dusk harness
#

gime a sec

#

gonna check the contents of G.shop_joker.cards

#

yeah there is

#

but like im saying because the update_shop function is getting called as long as your in the shop i get infinite loop

runic pecan
dusk harness
#

but i dont need the key if i can get the content from cards

#

the proble, is the infinite loop

#

i only want to update what my program knows once a pack is opened or when a reroll happens

#

i can probably hook on the reroll/pack open events for those, but the problem stays when i come back in the shop from a boss or a pack

runic pecan
#

Maybe don’t use update_shop?
I’m sure there’s something like generate_shop (not sure if that’s its name)

dusk harness
#

theres a variable called load_shop_joker

#

in Game

tepid crow
#

what are you trying to do?

#

access shop jokers on shop load/reroll?

dusk harness
#

right now yeah

#

trying to understand all of that so that when i get to actually writing the logic for what i wanna do i dont need to figure out that plus how to do the rest

tepid crow
#

my plasma sleeve also needs to do that for the shop prices

#

instead of the whole

if CardSleeves then
    G.E_MANAGER:add_event(Event{
        ...
    })
end

you can just call your own function (the event is important if you care about the price as I've found out lol)

weak gate
#

What's the simplest way to change the joker limit for my whole mod?

tepid crow
dusk harness
tepid crow
dusk harness
#

perfect meet you there

tepid crow
weak gate
tepid crow
#

you should be able to hook the starting values function, can't remember what it's called right now

verbal surge
#

how would one add custom modifiers into a challenge deck? I assume it's by modifying the G.GAME.modifiers[id] and adding custom function to that but there's nothing in the game files that I know that utilizes this exact thing, would love to have an idea on what the .modifers[id] expect in this context

tepid crow
old bane
#

how can i get the base mult for a particular hand? like for example, say i want a joker to give chips equal to the current hand's mult, and vice versa. I want it to be able to scale with the levels of hands, and not just be the level 1 value

EDIT: I figured it out but i'm getting an error that says "attempting to compare number to table" when doing G.GAME.hand[NAME].mult

weak gate
tepid crow
weak gate
#

game was angry about me writing
G.jokers.config.card_limit = 10
directly at the top of my main.lua heh

tepid crow
#

yeah cuz G.jokers wouldn't exist yet (since you're not in a run)

#

you could also hook the "start a run" function and set that card_limit afterwards

weak gate
#

aha

weak gate
#

aha, get_starting_params() function in misc_functions.lua seems like the best place

#

thank you kindly

#

er, ignore the comment

runic pecan
#

Would this work?
Or should I drag get_odds definition to the center?

old bane
#

so for some reason, any cards to the left of cards being scored will be ignored when using this code, any one know why?

if context.cardarea == G.play and not context.end_of_round and not context.before and not context.after and not card.ability.extra.active then
            
            local poker_hands = evaluate_poker_hand(context.full_hand)

            for i=0, #G.play.cards do
                context.scoring_hand[i] = G.play.cards[i]
            end
...
marble flint
#

so yes, you should pull it up

runic pecan
marble flint
marble flint
# runic pecan

don't even put the function in extra, just reference it sirectly on the center definition

#

functions in config will not get saved and loaded (nor will metatables)

marble flint
old bane
#

ah okay

grand sage
#

Hello I was wondering if my code is right as i am trying to make a card that has a similar effect to cavendish while following the guide for example mods yet every time my mod fails to collect data for atlas I was wondering if there was anything glaringly wrong my code I need to fix.

marble flint
grand sage
old bane
marble flint
#

big mood

old bane
#

is there a context that'll allow me to set a mult_mod/chip_mod before cards start scoring so I can at least sneakily change the value to the base mult and chip value

marble flint
old bane
#

so like

scoring_hand = "Flush"

or no

#

or like context.scoring_hand.mult = x and context.scoring_hand.chips = y

marble flint
#

we're not super familiar with that part of the scoring process unfortunately

lucid owl
#

what context could be used to upgrade a card if a played hand is more than 35% of the blind requirement? i think my code is correct but the context isn't, and that's why it's not triggering

lucid owl
old bane
#

okay, so i found some stuff. I won't report too much on my findings, as I don't actually wanna put the source code here (rules, duh), but basically I might just have to use a lovely injection to get this thing working and inject into the code that finds flushes :D

#

so fun 😄👍

grand sage
#

whelp I'm stumped I've tried following the example mods on smodded and anything I try just gets me the failed to collect atlas data error 😛

fringe ember
#

^ same here

grand sage
#

mine keeps saying the problem is at line 363 is it the same for you?

#

local file_data = assert(NFS.newFileData(self.full_path), here is the line it keeps referencing

normal crest
#

Does anyone know what the purpose of primary_colour is in ConsumableType

#

And if it's possible to change the color of the text in the badge for ConsumableType

lucid owl
#

how would one check if a card has no enhancement? would it be with SMODS.has_enhancement? it seems to search for a specific enhancement instead of simply checking if it has any

normal crest
#

card.ability.set ~= "Enhanced"

grand sage
#

ok it starts now becuase i changed my lua file from (mod_name).lua to main.lua but whats the difference?

marble flint
#

it's whatever you specify for main_file in your .json manifest

grand sage
#

i have my main file saet as "main_file": "ModernFoods.lua", yet it keeps wanting main.lua did i input it wrong infact if i change the file from main.lua to modernfoods.lua it crashes again

marble flint
#

make sure the capitalization is correct

#

or if you can't get it working, just use main.lua because that's fine

grand sage
#

ok then

#

I just tried to change it to main.lua in my json file and it crashed immediately with the same error failednto collect data for atlas

runic pecan
#

Should I stick with "every 17 scored Gold Cards", or change it to "every 17 triggered Gold Cards held in hand"?

old bane
#

how would I get a lovely patch to replace multiple lines?

runic pecan
grand sage
marble flint
#

no idea lol

grand sage
#

And here is my folder

old bane
wintry swallow
#

why does lua need to have js ahh function definitions smh

grand sage
#

who knows

maiden phoenix
glass scaffold
random sleet
#

lua is the child could learn this one

#

if roblox and this game are any clue

glass scaffold
#

If Lua and Java combined into one, you would have THE programming language.

wintry solar
#

The only weird thing I’ve found about lua is tables are 1-indexed

sturdy compass
#

That and the lack of semicolons irk me

#

Otherwise it’s pretty fine

edgy reef
#

I mean Lua isn’t a compiled language, why would it need semicolons?

#

Unless you mean something other than indicating the end of the line.

rough furnace
#

you can also put spaces

edgy reef
#

Oh wait yea

random sleet
#

yeah also semicolons are also valid lmao

edgy reef
#

I forgor

rough furnace
#

print("hi") print("mom") - valid lua code

random sleet
marble flint
#

all linebreaks are optional in lua

#

even without semicolons

#

which is Neat

edgy reef
#

I kinda thought that was cursed until I read the LuaJIT2 source code and found for (;;) do

gaunt thistle
#

rust

#

sucks

#

(it's great)

rough furnace
gaunt thistle
#

lua

#

is great

#

(sucks)

cerulean rose
rough furnace
#

idk I don't use pythin

wintry solar
#

How would variable = 2 print(“bla”) work?