#đ»ă»modding-dev
1 messages · Page 164 of 1
all the numbers between 0 and .25 would be in one quarter
I undertand it now
hence why i added a light humour at the end
so 25 outcomes basically?
possible
kinda
Wait, hold on
holding
correct
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
25 positive outcomes out 100 and game checks if generetaed number is 25 or lower (one of the positive outcomes)

yeah, 25 correct outcomes out of how many?
100?
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
i mean yeah but math is weird, 25/100 is 1/4 which is where we get the 0.25 on the right and random value on the left
card.ability.set
thanks for explaining folks, my head now feels bigger and smarter
I love it so much that this channel is essentially a big study group in a hall.
the condition could also have been reversed to be
dont do the thing if the random number is greater than the chances
thats how we learn
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
What exactly do you want your joker to do with the stone cards?
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
does the :update even get called? đ€
Would there be a reason it doesn't? It is an API method defined in the docs
Youâre changing self and not card for starters
modding this game is hella confusing
are those values not of the enhancement though?
No, self is referring to the prototype object
changing self to card is yielding the same result
Itâs also not something that needs to be changed every frame
Would calculate be more appropriate then?
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
Alright I see that line of thinking. In that case, what would be the correct syntax to access those values on a card?
card.config.center.whatever iirc
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"
What's this do
Supposed to give rank and suit back to stone cards
Wait
I could have used card.config.center.always_scores this entire time to check for always-scoring cards
Probably not because this implementation does not work lol
looks like this crashes the game
basically I need this joker to duplicate itself only at end of round with 1 in 6 chance
I think so yea
Itâs somewhere in the card values, I donât remember exactly where
You donât need to take ownership
And itâd be v.configâŠ
@merry raven thereâs actually a SMODS.always_scores(card)
Bru
lmao
I could have used that instead of explicitly coding my Joker to only take in one or two cards
How do you use it, is it like
if not SMODS.always_scores(card) then
For checking cards that don't have the always scores property like Stone cards?
It returns true if the card is marked as always scoring
How are you checking it works?
Variable card is used in two different context.
There's function input card and a local card.
Only duplicate itself?
yeah
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
Did you respawn your joker?
Is this where smods is doing rarity calculations?
16/21 commons in a second test
But your code looks like it's duplicating any joker that is not itself.
its where vanilla does it for sure
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?
its invis jokers code
Im working off of it
But is your code being patched in and considered?
lemme show what code its replacing
And what the heck is that indentation?
Can you send the full file?
Repetitions do not give the "Again" too if you just return repetitions
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?
Yeah looks like it got munched, Iâll fix it when I do the other stuff đ
Look at the dumps
Can I separate the code from the file and send? I'd rather not send over my entire mod's main.lua (I haven't compartmentalized yet)
Yeah ofc
hm
thats not what my patch is called
cool lol
looks like i know where to look
The dumps are in mods/lovely/dumps btw
well i did find the file smods is patching
Here's everthing that should be affected
and it is indeed messing with mine
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,
shouldnt it be "<" instead of "<="? else, it will still duplicate even when your slot is 6/6
so should i be targeting the toml file to patch or should i search for one of these lines in common_events to patch
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?
Just set your pattern as that top line
But make sure it retains functionality or you will break custom rarities
yeah
skip local card line? Isnt it responsible for removing negative editions?
I need to remove negatives
ic ic
Sorry, the problems I spotted in that picture is a little bit too numerous.
its alr I'm basically a toddler at modding so all of this is just a lego contruct for me
I just stich toghether diff parts of the code from vanilla and then try to figure out how to make it work
Now where were we? Post the screenshot of your current code.
Its from invis jokers code
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
Rule #1 of base game jokers: don't copy from base game jokers
I think smods supports something along the lines of a G.GAME.uncommon_mod
well, documentation doesnt cover everything :(
ok so i dont have to make a patch then right?
cus id really prefer not to bork custom rarities
cool
vsCode
You canât blame that monstrosity on vsc
idk man, you asking tough questions
Now fix the indentations.
You also don't need the k_no_other_jokers line since it always has itself to copy.
it gives me tips where to put certain symbols so I do
so for this id put something like G.GAME.rare_mod = [itself] * 4 in the redeem function, right?
was about to ask what was wrong then i saw this
whats this
there's a couple more obvious mistakes here
Yeah like
how did it even manage to get a 3-space indent
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)
there's also randomly 3 tabs of indent where none belongs at all 
mhm
in any case, seems my code works now
feels like theres a lot more uncommons/rares now
That code originally looks like this
can we stop riffing on a new coders indentation?
there was a point where it was constructive but thats well past
@prisma loom How is your calc code right now? Post the screenshot.
I'm fixing formatting haha
how do i have a deck automatically give a voucher at the start?
give me a minute
I recommend you get some formatter that does it for you
Maybe the lua extension already does it, right click anywhere in your code, format document
?
that's the old guide
đ
how would i make it so a joker adding multiple editions at once only triggers the sound once?
i have no idea where to look for it in vanilla code and also if i did find how zodiac etc does it it probably wont work
damn...
the vanilla way does work, it's just config.vouchers (or config.voucher apparently)
just copy this wholesale (and set the key up right)?
oh shit it does
wow
copy what? you just put voucher/vouchers in your deck's config
voucher being a single voucher key or vouchers being a table thereof
got it
Maybe just config = {voucher = 'v_[]'}
or config = {vouchers = {'v_[]','v_[]',...}}
card eval line went down
my bad
so this
Probably strings
good point
And then _card:add_to_deck() and G.jokers:emplace(_card) instead of card:add_to_deck() and G.jokers:emplace(card).
whats the diff between _card and just card?
You defined _card right above
just a name?
ah ok
In this case, card is the joker itself, while _card is the copy, the duplicate.
done
but joker does nothing atm
at least it's not crashing the game lol
Well it's a 1 in 6 chance
that's smth
even with 3 dices
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
Fascinating (also yes I did change to hooking)
What version of steamodded are you using
"1.0.0~ALPHA-1302a-STEAMODDED"
That's why
?
Either update or don't use "context.main_eval"
Cus I think that's new
You have a very old version
So preferably update
should I fully replace old folder?
use main_eval but yes
instead of calculate?
no as context instead not individual and not repetition
context.end_of_round and context.main_eval
Is main eval just a replacement for not (context.repetition or context.individual)
Now the game crashes
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"])
under vanilla conditions, it's the same. but it's important in case something adds a different context
it's mostly to avoid the use of negative context checks because they're very fragile
update your other mods too
And lovely too
kk
bump
don't add multiple editions-? cards can only have one anyway
is there documentation on custom sets? e.x. the cine cards in reverie
I'd suggest put a delay(0.2) between each of them.
I added these launch options
and game doesnt launch now
That's for linux
how would i have my deck increase the price of jokers in the shop by one?
Ive updated lovely and smodded. Crash still here
`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"])`
(bump so its not burried by the log)
iter through G.shop_jokers.cards and v.cost = v.cost + 1
or maybe hook with get_cost if that's a thing
Check if there's a new debugplus version
so is shop_jokers all jokers currently in the shop or all jokers that can be in the shop
Would you like to consider taking tax aside purchases instead of changing every joker's price labels?
for the record the idea is this:
all jokers currently on the shop shelf
Ive downloaded latest version (added 1 week ago)
still crashes :(
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"])
The crash log says you tried to juice up a nil object, which it can't.
Its saying juice_up doesn't exist
its rudimental part of my code
ive deleted it now
it worked even with it
it shouldnt be the cause of the crash
What timing/event does the crash happen?
end of round
So it's crashing without your mod?
how could it crash if I dont have modded jokers?
it crashes at end of round
when my modded joker should duplicate itself
is it fixable?
In your code change your card_eval_status_text to
return {
message = localize("blah blah")
}
May I see the whole picture of your SMODS.Joker{...} code?
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
ummmm
it works!
Well I guess the code works in some way đ
but if Joker is negative it creates 2 non negative copies of itself
made the custom card area, but the card doesn't go in there yet
Very true. I figured out the scoring thing since the game specifically checks for stone cards, but the rendering is still odd to me since replace_card_base is false
Oh the drawing will specifically check for stone too
I donât know why I didnât think of that first
oh bruh
Just like Invisible joker... wait you said 2 copies?
As in, 1 becomes 3(1+2)?
You can probably just change the name value in the center
I donât think thatâll break anything
surely
yes
Negative (original) stays + spawns 2 copies with no edition
You might need to put your copying code in an event
but only if Im at 4/6 spaces in joker area
G.E_MANAGER:add_event(Event({
func = function()
_card:add_to_deck
G.jokers:emplace(_card)
return true
end
}))```
how would i loop through all jokers in the game
its not G.jokers right? cus thats just the ones you have
for what purpose?
I still hold my suggestion about taxing.
G.P_CENTER_POOLS.Joker works
i want to increase the cost of all by one
is there actually?
There is indeed something like that yeah
(and again its specifically for this)
*are increased
noted
i mean should just apply after this i feel
like this?
Let's go step-by-step.
Highlight from local to }))
Hold Shift and click Tab twice
done
And delete the last three lines before else
done!
Now post the screenshot.
Looks good to me.
does the % operator exist in lua 5.1?
Yes
Yes
ok so thats not why code dont work
if i wanted to make a joker that destroys all debuffed cards in the deck, how would i do that?
so im using inflation right, right?
Yep. That's card.lua for you.
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?
Lua start from 1 instead of 0
context.cards is the array
So which line in your code is line 188?
You could loop through the deck like so:
`
for k, curCard in pairs(G.playing_cards) do
end
`
and see where in card.lua it returns if a card is debuffed? I think there's a variable just called "debuff"
Also thank you @wintry solar and @runic pecan I'm probably missing both of those!
Weird, this doesn't look wrong to my knowledge...
HUUUHHH???
it works now
wtf
I didnt do anything
just tried to launch the game
once more

its fixed now!
everything works
Yup now it checks for the right card! Thank you both!
this deck look hard AF, what's topshelf and premium?
Uncommon 2X and Rare 4X appear chance, respectively.
my jokers are getting incredibly creative, will probably release the mod soon
ok might be worth the uptick in cost
thats one way to clean out your deck
to increase the cost of each joker by one every other boss blind, id do this right?
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?
i mean the keyword feels right, i have no idea im still a noob at this
By the looks of it, yeah.
I think you should keep it. Itâs funnier that way.
Right? It retriggers the foil tooltips too
sanity check
2 % 2 will return zero, right?
rare or uncommon?
not sure which would be better
I donât think any cards are debugged when you select a blind
Yeah, maybe change it to first drawn hand.
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.)?
actually yea they are
on boss blinds they are debuffed from the moment you press the button
Yes all calculate functions work the same
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,
})```
I think you can just check if itâs foil before adding the infoqueue
wha what
what does this even do
it's ten chips
Some cryptid jokers do this if you need a reference
I'm adding another slot for consumables
oh k
ok why isnt this saying config exists
i didnt know you could use calculate on consumeables
it very much does
If itâs a new area you have to add your area to be calculated
oh
that would make sense, actually
is that something that smods covers or do I have to figure that out on my own
Thereâs a function you need to hook
Yeah that's what I went with in the end đ€·đ»ââïž
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
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?
So I've tried to add 1.5 xmult to the joker according to tutorial but it crashes the game for some reason. Is everything correct here?
what does the crash say
can you show me line 175 of your code please, i can't see the line numbers in your screen shot
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
Thereâs also normal brackets not curly ones
it just showed an error so I though smth was wrong :(
yeah, do return { ... } and not return ( ... )
Start a new run
[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
The target is wrong
what's the difference between Xmult_mod and x_mult?
'=[SMODS _ "src/utils.lua"]'
that also makes sense
x_mult is a global variable that I don't think you can change, Xmult_mod is how you have Jokers apply Xmult
You should use xmult so you donât need to do all the other crap in your return
oh, so if i use Xmult_mod then I'd need to manually make the message, while x_mult does that automatically basically?
i do use x_mult to make my jokers apply xmult tho
oh nvm then
everything works now! thanks for all the help
You donât need to do anything _mod anymore
When I play a Full House, how do I get the "more common" rank (aka the rank that I play 3 of)?
Look at the three of a kind part of the poker hands table
How about back.ability.extra instead of back.config.extra?
so like
next(context.poker_hands["Three of a Kind"])
and then i would look inside the table itself?
Yeah
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?
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
Namely, use #2# to for a second interpolated variable
like this?
tried that, also crashed
yes that's fine
in the description #1# refers to the 1st value you return in vars, #2# to the 2nd and so on
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
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
Yeah, it's pretty easy
iirc there's Card:is_face() and Card:get_suit() (or something similar)
ah, it's Card:is_suit('Hearts')
how do i check if card sold is a consumable
if you have the card you can check card.ability.consumeable iirc
ok alright
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 âïž
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
how do I check what suit a card is?
card:is_suit
Scroll up like 7 messages
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
ok, is there a way to also do that for seals?
card.seal afaik
seemingly not
or maybe itll only do that if the seal exists?
or maybe its because i tried to do card.seal.name
just seal
Donât use .name on anything
card:get_seal(true) (the true ignores debuffs)
eremel I have one question i wasnt able to get an answer to, if youre available
are most of the mod devs working with new calc already?
one final thing, how do I get what edition (foil/polychrome/etc) a card is?
Sure
card.edition
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
Hiding?
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
i'm trying to check if two cards have the same edition, and it's returning a table, so what do i do here
Thanks everyone who helped me out with Banana Split <3 đ đ đ
Don't know offhand
edition.key iirc
that sounds right
(Must have room)?
What are you using to spawn in Jokers?
Thanks
using steamodded, if i create a new lua file can i just import it as a module ?
how do i detect the edition of a card? (for example, if a card is foil)
had to make this silly little function
hey i just went through that! you can check edition.key
Does the card have an edition?
but sometimes that'll be null
i wrote a function to handle the case where it doesn't and now we're all good
Thatâs a completely unnecessary function
without it the game crashed
will the edition.key be like "Foil" or something
or like G.P_CENTERS.m_foil
line 359 pls
forgot to include the numbers
wait
wrong thing đ
i put the wrong sc, of a diff attempt
ok here
Your context check isnât specific enough
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
Well when do you want it to trigger
anyways the joker works now
its looking for if any joker with meeb in its name is ever added
it gives 5x mult if you play two of the exact same card (seal, edition, rank, suit, and enhancement)
Use SMODS.load_file https://github.com/Steamodded/smods/wiki/Utility#mod-facing-utilities
its pretty much the same thing as baseball card, except instead of rarity it searches for if its any of a few specific jokers
How can i make those position indicators appear in Option Cycles in a mod config?
how do i check if its a boss blind it is with context (and preferably, what ante it is as well)
context.blind.boss by looking at Madness
and G.GAME.round_resets.ante I think
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?
ok i was getting this error, idk why
i tried to send this ~6 minutes ago and there was some sort of outage lol
are you looping through an array? if so, make sure you have #(arrayname) so that it gets the length of the array
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
im so lost, how would i make a config file and menu for my mod?
you mean a settings tab for your mod?
but i do need help with the settings tab
https://github.com/Steamodded/smods/wiki/Mod-functions
I followed this guide
https://github.com/Steamodded/smods/wiki/UI-Guide
And this one for the UI
oh i never saw this
thanks
Is it possible to create a joker whose effects are always active, even if you dont have it?
what is it's effect?
I didnt have anything in mind, I was just wondering if it was possible
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
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
you can also always fix it later if issues arise
how tf do seals work
im tryong to create a custom object that works like seals and i cant get it to work
why is this in a toml file
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
@smoky talon Which line is 132 exactly in your code
The first one that says local suit prefix
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
I just copied the code for strength
G.hand.highlighted[i] is the problem
I see
Delete it?
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
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
Hang on
K
Fair
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'
How do I do that?
just say local card = G.hand.highlighted[i]
and then card is referenced properly in the next line
@maiden phoenix added the default 'Again!' message, what was the other problem?
you realise that without a reference to an i anywhere within your for loop you can't actually iterate through the array?
The joker wouldn't juice_up without card = card and redeem voucher is broken if you start with it in a deck and try to reference the card parameters
which context was the juicing in?
and delete the one above that is the problem
Anything that usually uses card = card, for my case it was repetitions and G.hand individual
the G.hand.highlighted[i] on its own needs to go
because it doesnt know what to do with it
I deleted that and now it says this
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
I donât have it on Mac
(you're missing an end)
I can get it if I need to
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
well where is it actually doing the conversion?
so screenshots should look better
I think the set_base function handles that?
i assumed that what i had was doing it but it seems that just declares rank suffixes instead of changing them
but you've just assigned loads of variables and passed them through if branches, there is no process actually doing the conversion
i see that now
You'll need to fiddle with your if logic in order to check if the highlighted card is NOT a queen
any idea how i actually do the concversion? can't seem to find it in the source code
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
its the closest base-game card to what im trying to do, so i figured it could help, but it seems not
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
thats why im here lol, to find out what im siupposed to do
have you ever coded at all before?
ok, it is worth understanding principles but there is no reason why you can't learn doing this
alright
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
like this?
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
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?
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
Whats the best way to dynamically change the extra.mult in a joker's config within the calculation function?
need to be a bit more specific
are you trying to update the mult value on a joker after osmething happens, like spare trousers and fortune teller?
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
vanilla code for anything that has to do with ranks and suits should not be used at all, it's really jank and falls apart with anything modded involved
ok noted
chat is he perfect yes or yes
yes
he's everything
what is the squeaky sound
i will record it wait
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
well just reassign the variable you set up in loc_vars?
are these mult and chip values what are shown on their planet cards?
juicing should be fixed now đ
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
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
he's great
Best modded card yet
so if this is my config setup, then later just run
vars = {the_mult_that_i_want, the_chips_that_i_want}
at the end of calculate?
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
ideally before but along the line ding dong works too
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
you don't need a cardarea check in joker_main
is there documentation on like what each context does?
sick okay was already doing as such so hopefully that in joker_main should work
good to know
you might not need it but it will still access
it most certainly is
you'll need to update their values in context.before
if you havent already
this modpack just crashes on its own even without my mod đ i guess i'll be fine
oh so update vars in both context.before and joker.main?
-# i'm so braindead, i didn't realize there was a modding for dummies part of the smods docs
no just in context.before and then it will use the new value when it accesses joker_main
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
it would depend on what the effect actually is
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
Nope
nope! it's measured in full cards
nah thats why you need px and py to define the pixel width and height
so, 0,0, 1,0, 0,1
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?
i am so glad i asked
I've already got that defined earlier in the code
if you want one hand to be 'treated' as another it might be worth just accessing their values directly in G.GAME.hands
you should probably alter them before any joker calculation is called at all tbh
where is this in your code?
like at what point is this happening
because I've never used this way before
at the very end, within calculate/context.before
very new to lua/smods so please share any better ideas for getting it done lol
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
not 100
for debugging you can just put prints in on variables to see what their values are
it will show in the console
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
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
makes sense, building this on the foundation of a Buffoonery joker so they probably had that in theirs for some other purpose
with the before context
how do i make a tarot card that upgrades the last played hand by 4 levels?
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
it's better to ask specifics about your code and what you want stuff to do rather than ask someone to literally make the card for you
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
its gonna be a bit broken lol
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 đ€·ââïž
ok, i was just guessing but if you know that to be true then do that by all means
check Orbital Tag
alright
ok so i'm stuck on this part. trying to get it to trigger on only face heart cards but I can't figure it out
https://github.com/shadowfelled/balatrosgate3/blob/main/main.lua starting at line 57
tossed it on gh just so i don't forget to later
@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?
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)
also in that single/index for loop you have value and idex the wrong way round - pairs produces index and value in that order
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
copying orbital's code verbatim is never going to work
i knew that, i just wanted to see if it did something so i could go from there
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
k
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
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?
sounds f'd
good luck with it, not something I can help off the top of my head but hope there was some useful info
which mod is buffoonery from?
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
Buffoonery adds 24 Jokers. 3 of them have a new Special rarity and may only be found by playing specific Decks (or combinations of Sleeves if CardSleeves is present...
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?
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
does it not work?
what is the Card object?
because that looks taken directly from those functions' definitions in the source code
i have no clue
all i did is copy-paste
that won't do
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
ok so this
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
i am still that one gif rn
hold on
i'm sorry for being a pain lmao but. new territory for me
so if context.cardarea == G.play then first
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
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
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
o7 thanks
there is an argument for the function that checks for straight so it knows that it can skip
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
can card_eval_status_text() be made immediate? or should i just go for an event?
actually difficult programming
i can tell, my head hurts >_<
i think for you you just have to check for each card if it's in a suit
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)
It can, but an event is very likely more appropriate
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
yeah im getting the same error as you
which file do i find the evaluate_poker_hand_ref function or poker_hand_list in balatro?
can I change a joker's loc_txt.name... Aha, Larswijn said "don't do it lol" so that's a no
when did I say that? đ
oh I was helping that guy out with his code
well I want a card to have a dynamic name, depending on how it was spawned
I asked him to change something in his calculate function, he changed something in his loc_vars function
very curious
How dynamic? Like 1 or 2 options or a lot more?
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)
oh you can actually do that? was wondering if you could lol
wait you can do that?? time to go simplify some code, lol
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...
well it's lot harder to have procedurally generated descriptions
(colours are a bit annoying)
is there an easy way to chck for when a food joker is destroyed?
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
What's the best practice for destroying a playing card?
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
Oops, sorry! Remove center. then
i get an infinite print loop with no data
anyone that can help? i wanna make a joker that upgrades whenever a food joker is destroyed
How can a for loop be infinite?
because the update_shop function keeps on getting called
Iâd hook with start_dissolve and 1)check if itâs a joker; 2)check if itâs a food joker.
And nothing inside G.shop_jokers? Huh.
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
So I guess .key is also nil.
Let me thinkâŠ
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
Maybe donât use update_shop?
Iâm sure thereâs something like generate_shop (not sure if thatâs its name)
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
my plasma sleeve also needs to do that for the shop prices
I use this patch https://github.com/larswijn/CardSleeves/blob/main/lovely.toml#L87 & context.reroll_shop* context
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)
What's the simplest way to change the joker limit for my whole mod?
for context.reroll_shop you should be able to hook SMODS.calculate_context and check the arguments, then call that same function
im intereted n how you do that but ill want more explanation, kinda annoying there aint not vc in here
we can join one of the cryptid vcs if you want
perfect meet you there
like for every deck?
Yep! Multiply them all by a value, maybe, if that is set in each deck. I suppose modifying all decks is possible
you should be able to hook the starting values function, can't remember what it's called right now
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
seems like Game.lua:2227 is actually the part that's interesting
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
so, a lovely patch around that line?
or see if you can modify some of the variables from outside the function đ
game was angry about me writing
G.jokers.config.card_limit = 10
directly at the top of my main.lua heh
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
aha
talisman moment
aha, get_starting_params() function in misc_functions.lua seems like the best place
thank you kindly
er, ignore the comment
Would this work?
Or should I drag get_odds definition to the center?
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
...
that won't save and load correctly
so yes, you should pull it up
Cards are scored in order, and cards not initially part of the scoring hand don't get scored
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)
in other words, this is only happening when the first already scoring card gets scored, and so needs to be done slightly earlier
ah okay
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.
do you have 1x and 2x scale versions of your textures?
yes i have them in folders labelled 1x and 2x in my assets folder
So I'm able to visually change the base chips and mult, but when the cards start scoring, the chips and mult revert back to the hand played previously (so if I originally played a high card before my Joker's effect makes it a Flush, the chips and mult will equal that of the base chips and mult for a high card). Why does this happen >_<
big mood
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
you probably want to update scoring_hand instead of chips and mult
so like
scoring_hand = "Flush"
or no
or like context.scoring_hand.mult = x and context.scoring_hand.chips = y
we're not super familiar with that part of the scoring process unfortunately
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
alr time to be a pioneer
ignore this, it works and i just messed up the values lol
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 đđ
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 đ
^ same here
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
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
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
card.ability.set ~= "Enhanced"
ok it starts now becuase i changed my lua file from (mod_name).lua to main.lua but whats the difference?
it's whatever you specify for main_file in your .json manifest
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
make sure the capitalization is correct
or if you can't get it working, just use main.lua because that's fine
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
Should I stick with "every 17 scored Gold Cards", or change it to "every 17 triggered Gold Cards held in hand"?
does it trigger every time you play a Gold card or when the Gold card gives you money?
how would I get a lovely patch to replace multiple lines?
First and current case: every time a Gold card scores (includes retriggers like Sock'n'Buskin, Hanging Chad, or red seal);
Second case: every time a Gold card held in hand gives you money (also includes retrigers like Mime or red seal).
this is what my error looks like in the logs
no idea lol
And here is my folder
i think it makes more sense that it triggers whenever the gold card gives you money, since 1. it's easier to get a lot of those and 2. it goes with the theming
why does lua need to have js ahh function definitions smh
who knows
Neat ty đ
Lua: "Here's some confusing syntax on how to do this."
Java: A child could learn this language.
C#: "Fuck you, here's e99e9999 errors for trying to change 1 thing in your code".
If Lua and Java combined into one, you would have THE programming language.
The only weird thing Iâve found about lua is tables are 1-indexed
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.
you can put semicolons
you can also put spaces
Oh wait yea
yeah also semicolons are also valid lmao
I forgor
print("hi") print("mom") - valid lua code
ok thats cursed tho
I kinda thought that was cursed until I read the LuaJIT2 source code and found for (;;) do
this works in most languigaes witgh for loops
except python
idk I don't use pythin
How would variable = 2 print(âblaâ) work?
