#💻・modding-dev
1 messages · Page 165 of 1
like lua variable = 2 print("bla")
mandatory do and then is lua weird
exactly the same as
variable = 2
print("bla")
also the same as
variable
=
2
print(
"bla"
)
is this allowed in lua??
real chads write machine code in a hex editor
yes
maybe I was harsh on myself by starting with C# for how strict it is in comparison...
most languages let you mess with newlines real hard
for card descriptions what do we put to make the text grey? ive tried grey and gray neither seem to work
inactive
iirc it's {C:inactive}
ill give that a shot, thanks!
(this is helpful for lovely tbh)
it's ironic that we provide ways to make injected code "look" nicer since it really doesn't change anything
adding a random amount of zwsps into my nice looking lovely patch so nobody can actually patch it
regex \s
me, who just copies the target line from the source:
Situation: I have two of this tag, and I just entered a boss blind.
Expectation: One of them goes off, the other one stays, and the boss blind is disabled.
Problem in reality: Both of them went off. (But the boss blind is properly disabled)
two things
first, card eval status text is probably not necessary, and you can let yep handle that
second, yep adds the function as an event to be called (at least one frame later)
we'd try disabling the blind outside of yep and seeing if it causes problems
So like this
mhm
Lemme test this rq
neat tag btw
Aaand it worked! Thanks!
How can I stop an enhancement showing up on random cards from packs?
You can set it’s in_pool return to false
heya! i'm new to the modding community so this may come off as a stupid question, but what would be the best way I can structure my folders and files so that I can load in jokers from lua files like this rather than having to put it all in my main file?
this is what uncommon_jokers.lua currently looks like btw
You can just use the standard SMODS.Joker definitions in your split out files
that works. ty!
other people use intellij but I prefer to be rebellious 😎
Rider is basically IntelliJ
Just drew the sprite for this tag. How does it look?
i really love this design
though maybe consider shrinking your butterfly icon a bit so it doesn’t touch the edges
How about this?
feels more balanced now
heya, where can I find some documentation for how G.GAME works? i'm trying to figure things out but I'm making no progress
you reminded me, i finished the art for this joker i coded yesterday
Made sure that the 2x folder actually has the higher resolution atlas image?
How do I add this tag into info_queue?
i think you do it in loc vars
❗
I know it's in loc_vars.
What I'm asking is what variable name to put after info_queue[#info_queue+1] = ?
ty mods
Would that still work for modded tag?
G.P_TAGS.tag_modprefix_butterfly
Worked!
Hi modders !
I have the project to create a balatro mod but i knwo barely nothing about balatro modding
And im bad at design too
So im asking here if there would be people interested in making it together !
(I would do the code if it wasnt clear x))
Hi yall, may i know what do you use for joker sprites?
You mean what’s their usage or…?
oml, i meant what yall use to make joker sprits
I use Libresprite to draw my pixel sprites, some others use aseprite.
Libresprite is free open-source but probably with less func than aseprite I guess.
libresprite is a fork of aseprite its just not as well maintained, probably worth buying it and supporting the devs
You can get aseprite free too if you build it yourself
ty guys
what is the context for when the Shop first loads?
none
You might need to create it, this is the lovely patch I used if you want
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''
end
}))
G.STATE_COMPLETE = true
'''
position = "after"
payload = '''
SMODS.calculate_context({entering_shop = true})
'''
match_indent = true```
the latter ig is returning number of rounds required
but what the other one is responsible for?
you should use SMODS.calculate_context({entering_shop = true}) btw
does using it prevent accidentally triggering other jokers?
that was my only issue and I added a check for my jokers
it calculates it through all the calculation areas
so that would be context.entering_shop?
oh I see, so I wouldnt need to loop through the jokers?
no
if you're worried about intefering with other mods just prefix your context variables
whats self ability extra?
how do I define it via config?
or its some sort of constant?
If I understand it correctly, this part of the code adds +1 to the counter at the end of the round
until it reaches the same value as self.ability.extra
then it starts jiggling
and becomes active
thoughts on this proposed ability for Candle?
(Uncommon): When Blind is selected, if you have any Tarot cards, destroy one and gain X0.2 Mult
unsure on wording but you get the gist
you'd need to use card.ability.extra which would refer to the entire extra table, card.ability.extra.coffee_rounds would be how to access that value
When Blind is selected, destroys one random Tarot card and gains X0.2 Mult
The "and" should imply the scaling happens if the destroying happens
Holy shit, Inanimate Insanity Invitational mentioned!!!
DO IT
Or have it be based around different Object Shows
so candle, right
Barnham has priority 👀
her ability is tarot cards, because she's spiritual and also purple
sooooo. we have an orbular blue character too.
:>
i'll get to him!! ^^
I was joking but it would be fire if you did 🔥
If this is correct, it should give you 50$ after 3 rounds of waiting when you sell this joker
but it crashes the game when I hover over the joker
not correct you mean?
context.end_of_round is inside context.selling_self
I thought Ive separated them
also end_of_round doesnt need individual for that i think
or it will trigger multiple times
how to separate them? add new calculate = function?
1 - you use self.X... all over the place which is incorrect, needs to be card.X..., and update loc_vars deifiniton to card from center
2 - it also references X.ability.extra which is an entire table and cannot be displayed in a string
3 - you refer to many values in an ability table that don't exist, it will crash everytime you try and compare any of these
4 - your context.end_of_round is nested within the selling self check, and should be tagged with context.end_of_round and context.main_eval
5 - your selling self context uses an event an manual methods for some reason?
is this your first joker?
no you close the first if and open another
I'd still recommend reading this and taking time to understnad what you're doing, look at other code that is functional and try and understand it
don't rely on vanilla items, they work differently
What does this E do?
if you need some examples of code that is functional, you can take a look at my work on ortalab and I'm happy to talk you through any of the stuff in there in DMs if you need some more help understanding
applies a jiggle effect, can either do 1 or 2
ohh, Ive heard ortalab added lots of diff stuff
it has examples of everything other than seals, and I try to keep the code relatively clean for other people to look at and learn from
How would I make the Jim sound effect play when the message pops up instead of happening immediately as the cards are being scored?
I just realized I didn't include play_sound("bpch_jim") in the code just imagine its there
Did anyone ever do a mod where the jokers are like math functions, js asking if anyone did that before
Jim
yes
.miJ would decrease ur mult but will try to increase it 1 in 25 chance
Smh
1 in 100 chance to die when you reach Ante (multiple of 8)
1 in 1000 chance to destroy all ur jokers
Nevermind, I just had to use the event manager instead of calling it immediately.
It seems the 0.5x mult effect doesn't seem to work. Is there a way to directly read from and modify the mult value?
Working on my first ever mod on this game. Now to figure out how to actually make the effect real.
Fuck (I tried using hand_mult after seeing it in the game's code)
fucked up in the crib playing balala
Madnes for destroying card, create Jokers from justice?
Also probably better (must have a room), although then it will destroy the cards Even when there is no room
The intended result would be for the mult value to be halved, but I played a High Card (1 mult) and nothing seemed to happen. Hm.
Yeah, I would like the card to be destroyed only if the joker gets created. That's why I formulated the text like that.
Still subject to change, though.
i think you could probably have an if statement before it destroys anything that does something like:
if current joker number < max joker slots then
(this is pseudo code and not actually how lua is coded)
Still no luck getting 0.5 Xmult to work
Even using xmult instead of xmult_mod, it doesn't seem to be working and I have no idea why. The mult should be 1 in this case
Can you screenshot the code?
I just realized I might (emphasis on might) know exactly what's wrong after giving the Steamodded API a cursory skim
And what do you want to happen?
Multiply the mult value of the played hand by 0.5, halving it
With a custom message and sound?
Already got the message and sound in, it's just the 0.5x that doesn't work
card.ability.extra.evilmult is 0.5 for reference
The only thing that looks wrong is that event in your return
It just needs to be sound = ‘key’
that's what's confusing me as well 'cause like, shouldn't it just work?
maybe it's because i'm on an old version of steamodded though
this is in context.joker_main right?
Yep
You shouldn’t be developing on old versions
you need new-calc
update: it WAS because i was using an old version
welp, lesson learned, i guess!
I'm modifying G.P_CENTERS.m_glass.config.Xmult to change xmult value of the glass cards, but for some reason, the change only applies visually - scored glass cards still do only 2x mult, any ideas?
isnt it supposed to be
xmult
i'm using normal mult for when it doesnt hit
you should modify the glass edition itself
well make 2 cases
if it hit 1 in 25, do xmult
if it didnt do +1
afaik it only modifies the gui
elaborate? The center is of the glass enhancement
It is where the default xmult value is stored
nah you're on the wrong track there
thats whats going on
sounds more like the center is updated but the card itself isn't? not sure why enhancements would use the center's config though
I do also update all cards in the deck
🤔
(I also modify the chance but it seems to work fine)
will have a look later then
isn't it ability.x_mult?
there's some weirdness like that iirc
maybe it's config.x_mult and ability.Xmult? I'll have a look later
how would I check if the current hand is a certain hand?
in a joker?
yeah
i'm trying to make a card that detects if the current hand is a three of a kind
u can do next(context.poker_hands[poker_hand]) where poker hand is ur hand
quote from examples jokers included in smods example mods
"The 'next()' part makes sure it goes over every option in the table, which the table is context.poker_hands."
"context.poker_hands contains every valid hand type in a played hand."
ig u should try "Three of a kind" first
and then Three_of_a_kind
Three of a Kind*
"Three of a Kind"
so now how would i go about destroying cards used in scoring?
return { remove = true } for marking cards for destruction.
how would i destroy multiple cards doing that?
i'm trying to make it so if you play a three of a kind it destroys all the cards scored
That's automatically done for each card iirc.
As long as you use the destroying context it is yeah
hello
so it'd be something like
if context.destroying then (for loop for the cards in scored hand) return { remove = true} end end ?
how can i install mods, i dont have nothing and the tutorials dont have the proper links
step 1: get balatro base game
step 2: install lovely
step 3: get steammodded-main(not to be confused with steammodded-old-calc)
step 4: drop off the neato jokers folder into the mods folder
what
Want to mod Balatro? Unbalanced, Mind-bending mods? This guide shows you how!
there
tyyyy!!
do u destroy them when played
after scoring
how would i give a joker its own ability?
trying to have it gain chips whenever you lose mult
when u lose mult?
yeah
u will have to modify the calculate function and check for current contexts
im not sure how to check if u lose mult
i see thanks
i think u need to do if context.final_scoring_step then
it happens when all cards are scored
I'm trying to make a joker that gives 3 of a specific consumable but am having trouble due to the pool limit, which i havent figured out how to bypass. I tried adapting perkeo's code instead, but i cant find a way to have it target a specific card to copy instead of a random one. If anyone has advice on either way of doing it, i would really appreciate it
i replaced the perkeo code with what i had originally, but i can bring it back if you need to see it
its e_negative
from perkeo 2(example jokers) code
Not quite, check the wiki for the actual context
the negative part works fine
this is what i'm trying to make
Check context.scoring_name
local newcard needs to be done once... then you can redefine it without local. Alternatively, put just one "instance" of the create-set-add into a for loop.
https://github.com/Steamodded/smods/wiki/Calculate-Functions this might be helpful, although i am not sure on destroying cards part
In the destruction context ofc
is there anyway to run code every frame with steammodded, or do I have to use Lovely for that? I have tried using an always false G.E_MANAGER but it stops running after I click in game
What do you need to run every frame?
it crashes when i change it to e negative
could u send the error message
TCP socket
oh wtf u doing a networking mod?
and what is at line 101
Can probably hook Game:update()
i tried just replacing the negative with 'e_negative' and i also tried using exactly what perkeo had
Don’t use the weird table part, just a string as the first argument
what do I do when the game crashes on startup from memory issues again? I downloaded fresh Smods, cleared the Lovely crash log, uninstalled and reinstalled the game, and it's still crashing
yh what he said
like this
newcard:set_edition('e_negative', true)
does it error screen
But the other way you had is okay, it’s just ugly
so how do I mark a card for destruction?
did u create ur mods or smth
it works now but it still doesnt fix my problem with the pool not allowing more than 1 to be spawned at once
so it spawns a negative one and then stops?
is there a way for my consumable button to be out here with the normal consumables instead of them all being behind this larger button
or theres not enough space for them
No
it spawns 1 negative one, a negative version of the other one in the consumable category, and a negative jimbo
unfortunate
so 2 negatives and then... a negative jimbo?
You need to send the key in the fixed key argument
It’s like the 7th? in vanilla create card
Or use SMODS.create_card
realized I forgot to reinstall Balamod. Now I get this
can u debuff a playing card
how do i get the text effect Perkeo has on "Negative"?
loc_vars = function(self, info_queue, card)
-- This is the way to add an info_queue, which is extra information about other cards
-- usually, like Stone Cards on Marble/Stone Jokers, Steel Cards on Steel Joker, and
-- in this case, information about negative editions on Perkeo.
info_queue[#1116390750314307698_queue + 1] = G.P_CENTERS.e_negative
end,
hm
i meant this color
Balamod and smods aren’t compatible
how do i get that color
{C:dark_edition}
thanks
is it possible to debuff ALL playing hands, if so how
this gonna go hard asf 🔥
like where playing cards are stored, even
free econ
wouldnt it create like exponentiating jokers
i could set the sell value to zero right?
okay, fair enough. But what do I do again to undo the "cannot decode PNG image" crash on startup
make this uncommon
usually because of lack of memory iirc
What’s the full crash?
local card = copy_card(the card in question idk), nil)
card:set_edition('e_negative', true)
card:add_to_deck()
and then
emplace it to jokers table(idk what is it called)
i installed cryptic mod, talisman mod and handy mod, the cryptic and talisman mod works perfectly, but the handy doesnt do anything, it shows the mod is installed but nothing
Fusion mod's Dementia Joker but weaker.
(+3 mult per Joker, 1 in 3 chance to create negative copy of self, if self not negative, upon finishing blind)
whats the error message when u hover over the exclamation icon?
stronger considering u can basically scale it
from 1 to 2048
where is the exclamation icon
in basically 11 blinds, btw
so like 3-4 antes and u have 2k mult
4k mult, 8k mult
that is, until ur game crashes
anyways how do i create a joker with an edition
doesnt show anything, it seems that it was installed correctly but doesnt do anything
check the mod files
they could be missing or smth
or click on the handy mod
ok
to see what it even has to offer
it creates shortcuts
but i do a command for a short cut and nothing
wich is the mod that ramdomize everithing?
this is the mod
i mean the one that everithing is ramdom
local card = smod.create_card(table)
the table is this
This function replaces create_card. It provides a cleaner interface to the same functionality. The argument to this function should always be a table. The following fields are supported:
set - The card type to be generated, e.g. 'Joker', 'Tarot', 'Spectral'
area - The card area this will be emplaced into, e.g. G.jokers, G.consumeables. Default values are determined based on set.
legendary - Set this to true to generate a card of Legendary rarity.
rarity - If this is specified, skip rarity polling and use this instead of a chance roll between 0 and 1.
Under vanilla conditions, values up to 0.7 indicate Common rarity, values above 0.7 and up to 0.95 indicate Uncommon rarity, and values above 0.95 indicate Rare rarity.
skip_materialize - If this is true, a start_materialize animation will not be shown.
soulable - If this is true, hidden Soul-type cards are allowed to replace the generated card. Usually, this is the case for cards generated for booster packs.
key - If this is specified, generate a card with the given key instead of the random one.
key_append - An additional RNG seeding string. This should be used to put different sources of card generation on different queues.
no_edition - If this is true, the generated card is guaranteed to have no randomly generated edition.
edition, enhancement, seal - Applies the specified modifier to the card.
stickers - This should be an array of sticker keys. Applies all specified stickers to the card.
it’s a part of cryptid if we’re talking about the same thing
as in cards?
I went to get a screenshot and my entire laptop crashed, now it's working again
cards jokers etc etc
did u check options
i think its the cryptid mod
yeah, nothing\
^ @heady summit do you mean the deck that randomizes all values on cards and packs
yes and jokers ....
did u follow these steps
Install lovely by following instructions in repository page. Make sure your antivirus is not removing it;
Download latest release of mod by selecting an archive named Handy-[version].zip;
Put HandyBalatro folder from archive into game's Mods folder (can be found in %appdata%/Balatro/Mods);
Start a game. If all done correctly, new button should appear in options menu;
then its the cryptid mod
tyall
misprint deck
yea !
whats the code
just lua if context.setting_blind then SMODS.create_card({key = "virus", edition = "negative"}) return end
you need prefixes in the key
e_negative i think
edition you don't
ehhm
have it all. i put lovely in the appdata balatro mod section
so j_lbm_virus
one more thing xd
ye
could any1 send me cryptid
why do u have both smods old calc and the new one
duplicate label continue mentioned
hey wait i can just check perkeo
Yeah editions need keys
cause if i didnt put that the section mods wouldnt appear i dont know why
nevermind
set_edition doesn't take a prefix tho
Yes it does
should i uninstall new or old
uh okay
if u want cryptid uninstall new(-main)
it spawned it, but it's not constrained to the joker area
Uninstall old if you are developing mods
u need to emplace it
into the joker space
how would i do that
You can use add card instead iirc
oh right wait
what would i use to pull the number for total mult being scored? the one thats shown in here
worked, thanks
Just mult
It’s a global value
ok ty
got it thanks
and it is Truly working
is there a way to get all playing cards
G.playing_cards
nothing, i cant solve it
What’s debuffing them?
this joker retriggers all jokers, how do i avoid things like cavendish's extinct check?
i don't believe cavendish extinction gets retriggered?
it ignores the extinct check i think
also if possible, how could i avoid retriggering jokers that aren't compatible with blueprint?
since they have different contexts
solve it !!!!
somehow, this joker is making cavendish do that check again
thanks for the quick respond
This will retriggers every joker effect
how could i make it only trigger the same things blueprint or brainstorm would?
i want to create a joker that debuffs all playing cards for a x10 mult
check if its blueprint_compat
Make it work how blueprint does then instead of using retriggers
Debuff card might work then, I’ve not used it a lot
ill check later
is it old-calc
It’s old calc cryptid
send the mods tab
it better not be nested
if im printchecking a variable, which console is the check being sent to? (for context i am using print())
this only copies a single joker, i assume it's a fault of mine but how can i make this copy every joker?
how do I make context.end_of_round not trigger like 8 times again
I believe print only sends it to the lovely console, not to debugplus' in-game console? though I suggest using sendDebugMessage regardless
Huh.
Add context.main_eval
ohhh ok
Print goes to debug plus console too
ok back to this issue: how do I destroy all cards used in scoring?
Why
if context.end_of_round and not context.repetition and not context.individual then```
oh am I suddenly super outdated now
i've been waiting for cryptid to move to better calc
Cryptid should just stop being so slow
in that case you might need to set the logging level lower in smods' config
i had it set to error
do i leave it there
?
No set it to the lowest
bump
ok got it
I'd say just dev for new-calc anyway, even if cryptid's main branch isn't working for it yet
It returns after the first joker
really thought the transition would take longer
is there a reference for G.GAME ?
how could i have it copy without returning just the first?
like it took a good few months to get everyone from 0.9.8 steamodded to 1.0.0 didnt it
is it possible to join 2 strings together
Also bump
to get smth like X3 mult wow
yeah the operator is ..
"text" .. "text2" will make "texttext2"
You can use the calculate effects function that smods provides instead of returning the values
do i do that after the localize operation
god lua just gotta be different for no reason huh
Why don’t you just use the Xmult localization
Hey its fast and lightweight
Why Complain
ok it doesnt appear to have printed anywhere actually
did i setup something wrong here?
its main strength is that it's easy to embed in other programs (see: pico-8, roblox)
well yh
Is this on a joker?
Some mods didn't even need to change anything for new-calc, some mods only a very small amount 🤷♂️
i have seen the light
yeah ig
Python... Heh.
does final_scoring_step even have the cardarea context?
now I get to fix that bug where cryptid's refactor removes all my fusion sprites
It does but a joker won’t have the area of g.play
god what the fuck is even going on with that
Here’s a hint Marie
anyways how does one destroy all cards used in scoring
how would i change it for a joker then?
Just remove the area check
i feel like I should solve the problem considering i have crossmod content with it
wouldnt it be something with context.destroy_card iirc
i saw that, but that code looks like it only works for one card
i need to destroy all cards used in scoring
It passes every card in turn
oh alright then
So you can evaluate each card independently
full_cards is the played cards I think
so do i just destroy_card = card and return { remove = true }?
if context.destroying_card then
return {
remove = true
}
end```
oh the game did not like that
This might destroy unscored cards I don’t remember
is it just a memory type issue or did the code cause this
cant contact a table into a string. need to stringify, or extract the data from the table you want to concat.
Oh do you have talisman
i do
Then mult will be a table
ohhhh cause the scoring buff
Join the anti talisman club!
cant express much data with 1 number Tho
but big number,,,
Pffft big numbers who cares
game just cheating at that point
yeah ante 39 overflows the score which is why talisman exists
how do i set that up by the way
is the latest main branch of smods newcalc
Idk im too familiar with
Roblox Studio lua
Dunno I don’t use talisman
okay well i'm getting a crash on startup already
A crash on start up?
how do i Rig the game to get my Jokers instantly
it was cryptid's fault
want to test them
In action
ty 🙏🏿
holy shit you can SWITCH PROFILE
WITHOUT CRASHING NOW
how long has that been a thing
i feel like smods has literally done that for its entire lifespan
That has always been a thing?
got the green guy card working
i always crashed switching profiles
Did smods ever make that crash happen? 🤔
i've had that issue forever and idk it just stopped happening on new calc
You don’t need that joker main step btw, can just do and context.scoring_name == ‘Three of a Kind’ in your if statement
i guess i'll test all my jokers while i'm here
make sure everything works on new calc
crashed on loading into a run I know exactly what the crash is don't I
actually scratch that is there a reference of all the Game.events you can hook?
well that's just great
that'd be the game's source code for ya
i got this crash when.... selling Splash? i didn't even know that was possible
start a new one-?
debugging 🔥
no i did start a new one
sounded like you didn't lmao
i solved the run startup crash it's a fusionjokers talisman thing
average fusion jokers
how does one set an icon for your mod? like how cryptid does
yeah no idea what makes this line crash
two things:
- I made a pack, but these green particles are sticking around
- Using the cards doesn't do anything
make an atlas with the key 'modicon'
got it ty!
anyone got anything for this
i should get the full log
You put "folder with folder with mod", not "folder with mod"
i.e. goto "Handy-v1.3.0b" folder, you'll find "HandyBalatro" folder inside. This is a mod which you should put in Mods
I'm trying to mod a joker as an experiment, how would I make a joker that creates a copy of itself when sold or destroyed? (I do once again apologise if this is the wrong channel)
if a joker has some of its effects compatible with blueprint, but not all, would you still mark it as blueprint compatible?
wait im stupid runner exists
you want to mark whatever stuff isn't blueprint compatible - such as self-destruction - within an if not context.blueprint then
when my fish contains a strush
yeah, I think i'm right in saying that anything in a not context.blueprint if branch will skip on a blueprint/brainstorm copy of the joker
i already had it i was just stupid but thank you both
sorry for such a late response, but what syntax would that use? this obviously doesn't work but i'm also obviously using the function incorrectly - there just isn't much documentation on it that i can find
the {effecttable} is from something someone else said about using this but i think i misunderstood a placeholder for an actual usable thing lol
i do want to know if there's a context for checking when the total mult value changes? that way i can assign a value to the postloss variable equal to that current mult (what i have so far)
if selectedjoker is a random joker i selected, this would be the way to put that joker's name into my description, right?
you could perhaps put a hook on mod_mult()
havent actually done hooks before, how do they work?
something like
local original_function = foo
function foo(...)
original_function(...)
do_something_else_when_foo_is_called(...)
end
ok nvm seems that isnt my problem
so like
how do i make the joker being evaluated juice up with the message on the joker instead of on the playing card during context.individual?
it'll need to looke like this:
local raw_mod_mult = mod_mult
function mod_mult(new_mult)
local ret = raw_mod_mult(new_mult)
-- Do stuff with the new mult value here
return ret
end
iirc you can specify card = card in your calculate function
i tried that but the message is still on the playing card
sorry, should've mentioned that i tried that
all good
the joker does juice up if i do that, but the message is still on the playing card
idk then
anyone know how i could do this? trying to copy every single joker blueprint-style, but unsure how to use SMODS.calculate_effect() properly - before i had it returning a single joker which definitely wasn't what i wanted
Does anyone know if theres a way to make square joker not be square anymore?
Is there a way to get the score of the hand played through context without lovely patching?
I figured it out, it's focus = card
Does that make straights 5 oak cuz if so that’s extremely powerful
hand_chips is a global variable for that
then for the entire hand you can do hand_chips * mult
yes it does.
what about the mult for the multiplication?
Wow
pretty sure mult should function the same way
so if you have it defined, you can remove that definition since mult is always equal to the hand played's mult
It does not appear to be a global variable
I feel it's not that much of a problem? Building for consistent straights is difficult due to it requiring five specific ranks. So mostly, it just expands the possible number of playable hands.
I made it an Uncommon because Four Fingers and Shortcut are both Uncommon, and this feels most similar to those conceptually. Should I make it Rare?
strange, supposedly it is
what's the full code?
is something like what you mean? so then (at least rn) the chip value will be equal to the difference? like
-mult is picked up by mult_preloss
-change in mult occurs which is picked up by mult_postloss
-chips gained is equal to the difference between mult_preloss and mult_postloss
Huh it actually is, thanks for the info
lol of course
Maybe make it rare. Idk, straights require 0 deckfixing to pull off, and even if you don’t get a straight a run of 4 is still a free 4oak which is a powerful hand in its own right
i tried that and it was just null
If I want to change hand_chips and mult before it does the multiplication I suppose I need to lovely patch
and if it works it works
no idea, that's beyond my level of expertise lol
Pretty much
right* my bad LMAO
sick
Is there anything stopping me from disabling / removing square joker and then creating a new identical joker that doesnt have the weird sizing so that I can make it look like a regular joker (also the same for photo), this is probably a bad idea but I cant think of another way to do it.
is there anything within context.destroying_card that can get me a reference to the triggering joker? i'm trying to get a joker to display a message while destroying cards and a reference to self crashes the game, card just references the destroying card
card is the joker
assuming you have a joker destroying a card
if you want something to happen upon a card being destroyed, that's context.remove_playing_cards and has no information on the source of destruction
not within context.destroying_card apparently
it's specifically when this joker destroys a card
what's your code
yeah card is definitely the joker then
you don't need card = card though afaik
bump
an effect table is what you'd return from a joker
so like { mult = 4 } as an example
yeah, but how would i adapt that to what i'm doing? i'm trying to blueprint-style copy every joker
call calculate_joker on every joker, store the result and pass that result to calculate_effect
also in your code you're not assigning context.blueprint_card which could lead to issues
does this feel more like a rare?
yeah, it does
especially if "average" mean arithmetic mean
actually, geometric mean might be more appropriate for how balatro scales?
how to check how many times a specific consumable was used that run?
Question, I downloaded this mod that replaces the amongus deck skin with a custom one. I'm trying to make it standalone, but while it's showing up in the list, the cards appear blank. I created a lua file, based on the lua files for existing deck skin mods. https://pastebin.com/X791YAZe
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
is the consumable custom?
yeah
You can probably create a variable for it
local igo = Game.init_game_object
Game.init_game_object = function(self)
local ret = igo(self)
ret.consumable_uses = 0
return ret
end```
then you call it using `G.GAME.consumable_uses`
aight thanks
thats a hook btw
got it working, thanks again
Loop through G.jokers.cards and find the index of your joker
Hi, brand new to this, having a lot of trouble finding info online
Attempting to add a new joker to the game, how would I go about reading the current hand type being played?
Like, if I wanted to check if the current played hand is a flush, for example?
context.scoring_name i think is the name of the hand
Don’t know if you got this solved, phone died in hospital waiting room. Are you hooking eval_card?
You’d still need to call calculate joker, but then put the result of that into calc effect
How do I go about preserving a variable from one context to another? I'm trying to check if a hand contains a straight and do some stuff if it does, but the variable is getting set to false again. Here's my current code
local straightcheck = false
if context.before and not context.blueprint then
if next(context.poker_hands['Straight']) then
straightcheck = true
end
end
if straightcheck```
the vairable is local to that call
you propbably want to store it in your card.ability somewhere
or on G.GAME if all instances of your joker share it
I thought about doing this but not enough evidently, thanks
What part of balatros code makes it apply the sprite for seals
Card:draw
what could be causing this to crash when a hand is played, with the error attempt to index local 'effect' (a nil value) ? seemingly calculate_effect is the problem but i'm unsure
no
did not get it fixed and no i'm not hooking that
one of my mods might be? idk
silly question, how can I get how many time tarot cards have been used?
Yeah probably, there’s no reason that line would crash otherwise
Check that 'copy' isn't nil before calling calculate_effect
Also you're looping twice unnecessarily
Also you should set blueprint_card
Also you should do the blueprint check balatro does to prevent infinite copying
Looks like fortune teller checks G.GAME.consumeable_usage_total.tarot
in what order are smods mods loaded?
"yeet"
hm?
more seriously there's a priority system
and then mods at the same priority are loaded alphabetically (?)
awesome, thanksies ^^
in whatever order the filesystem finds them*
is there a way to check to see if the current hand's score is the highest score of the current run?
yeah that's just love, which is what NFS mimics so I'd suppose the same is true
big oof (but fair)
its possible platform depenedant
omw to rename thac again explicitly so it loads wrong on linux
just use priorities
im going to cause problems
on purpose
(i also have no idea how that'd even be done so)
how do i make the consumable spawning ignore the pool limit so that it spawns all 3 instead of just 1 and 2 jimbos?
That's definitely a progress
follow up, how do I set a loc_var with a default value?
you don't
if you need a loc_var, the function must return it
how do I get the text var to not say "+nil"
well, you could do ... or 0 when generating it
sorry, not too sure what you mean
well clearly something's gone wrong, could you show code?
here, when no tarot has been used it says +nil chips
SMODS.Joker {
key = 'joker',
loc_txt = {
name = 'parking',
text = {
'+10 chips per tarot card used this run',
'{C:inactive}(Currently {C:chips}+#1#{C:inactive} Chips)',
}
},
atlas = 'Jokers',
rarity = 2,
cost = 7,
unlocked = true,
discovered = true,
blueprint_compat = true ,
eternal_compat = true ,
perishable_compat = true ,
pos = {x = 0, y = 0 } ,
config = {
extra = {}
},
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.chips } }
end,
calculate = function(self, card, context)
if context.using_consumeable then
if (context.consumeable.ability.set == "Tarot") then
card.ability.extra.chips = G.GAME.consumeable_usage_total.tarot * 10
end
end
if context.joker_main and G.GAME.consumeable_usage_total and G.GAME.consumeable_usage_total.tarot > 0 then
card.ability.extra.chips = G.GAME.consumeable_usage_total.tarot * 10
return {
chips = card.ability.extra.chips
}
end
end
}
that or add chips = 0 in config.extra
yup, you didn't set card.ability.extra.chips
So I'm trying to make a Joker that adds x0.25 mult whenever you play the highest hand of the run, and removes x0.25 mult when you dont.
I'm pretty sure I found the code to gather the highest score of the run (G.GAME.current_round.high_scores.hand)Y
and based on the example Runner in the steamModded wiki section, the next( ) is used to gather the current values of hands (such as the playd hand being a Straight), I just need to know what value is the current hand's score
wait no, the next() is for searching through a table to ensure that the Runner can also grab straight flushes, I just need to use the context. section there
ty
How do I get the rank of a card and get the next rank (as if I was doing the strength card)?
card.base.value to get the rank of the card as text, like "Ace" or "King", card:get_id() to get the ID of it
to get the next one you can do SMODS.Ranks["Ace"].next[1]
instead of studying i brought my shitty laptop to work on my mod
fore
Hey what's the Context for like, when the score has been finalized on a round?
if a variable is a list of values, how would i make a if statement that checks if a different variable is set to any one value in the list?
you're probably looking for context.end_of_round, no?
not exactly, I'm trying to get the score of each hand, not the full round, I mispoke
so like, if I play a High Card, after it applies the jokers, the card values, multiplies the chips and the mult, the number that is calced then is what I'm looking to find
how do i place a specific consumable in the consumables slot? based on everything i know this should work, but it just picks a random one from the category instead
there, the 5,776, that is the number I wanna check
Did we ever figure out the solution to this error?
...or not
i think the error was popping because i had a github repo in the same folder
for some reason
nobody who can help any of us is online lol
ive been trying to figure out this dang consumable thing all day but nobody has been on here to help, and im starting to go insane
idk why it isnt working, the odeshould beright but im probably missing onesmall line somewhere
Replace those four lines with SMODS.add_card({ key = 'c_gcbm_est', area = G.consumeables, edition = 'e_negative' })
We can hotload mods right? Just by reloading the game through the console?
answer is yes, but answer is also i don't know why it's tripping like this
calculate = function(self, card, context)
if context.cardarea == G.play and context.is_suit("Hearts") and context.is_face() then
return {
mult_mod = card.ability.extra.mult,
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
}
end
end```
relevant part of code
python brain is really not liking lua rn
rip
Not context.is_suit,
it's context.other_card:is_suit
no parenthesis?
context.other_card:is_suit('Heart')
okay then that's not the issue, thank you. I must be grabbing the wrong value instead then.
the code if you need it
maybe the consumable tag is wrong?
its supposed to be c for consumable at the start right?
giving the attempt to index field 'other_card' [a nil value] error now
how do I make a joker that retriggers only a certain set of jokers?
I've been trying a couple things with self.ability.name but that crashes
Does anyone know the eval code for discovering everything? (debug)
Aware if it's colon or period.
use card instead of self
scratch that, misspoke
if context.cardarea == G.play and context.other_card.is_suit('Heart') and context.other_card.is_face() then
return {
mult_mod = card.ability.extra.mult,
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
}
end```
if i were to iterate through every joker, i could do something like this
for i,v in ipairs(G.jokers.cards) do
if v.ability.name == 'Blueprint' or v.ability.name == 'Joker' then
(do something)
end
end
The colon.
@nova finch
✅:context.other_card:is_suit('Heart')
❌:context.other_card.is_suit('Heart')
Somewhat figured out; eval G.FUNCS.unlock_all() but only works on the profile menu
✅:context.other_card:is_face()
❌:context.other_card.is_face()
context.other_card:is_face(true)
mmm, it's still giving me the error
with
if context.cardarea == G.play and context.other_card:is_suit("Hearts") and context.other_card:is_face(true) then```
@runic pecan the code you gave me crashes my game when choosing the bling and triggering it. Maybe the tag that calls the specific consumable is wrong?
Might wanna add context.individual and (not context.repetition) and before the G.play check
By the way, is "gcbm" your mod prefix?
and "est" is the consumeable's key?
the one time i needed a heart face and i draw none
yes
does context.other_joker check when a different joker triggers or just when the joker itself isn't doing anything
just sending these to make sure i dont miss anything
that was it
that was what it was missing
thanks
May I see its whole code?
what part? the entire mod code?
ok one more thing from me before i slip away.
would i change card.ability.extra.mult to card.ability.x_mult in the code if i want it to be x2 mult instead of +2 mult?
Yeah, the entire SMODS.Consumable braket.
here
im sure its messy and there's stuff that doesnt need to be in there, im just trying to make it work first
Try SMODS.add_card({ set = "Drugs", key = 'c_gcbm_est', area = G.consumeables, edition = 'e_negative' }) ?
-# i hope you added weed
im gonna add crack, ill add weed if i think of a good effect for it
Then I have no idea where the issue truly is. Sorry.
dang
use SMODS.change_base(card, suit, rank), where suit is, for example 'Hearts' and rank 'Ace' instead
you can get the rank as a string from card.base.value
my current method works fine, im not looking to change it and risk breaking it just like the spawning
the spawning the card with the joker is what im worried about right now
if i can figure that out ill come back and clean up the rank conversions
so what's your spawning card code
Riv helped me change it to this a few minutes ago, crashes my game when i try to choose a blind though
what's your consumabletype look like
That would put the consumeable onto the joker slot, since G.jokers is the default area. /iirc
that's just not true
How do I make a custom sticker? (the code parts)
so waht am i supposed to do then?
did you try this
i dont understand what you mean by taht, sorry
SMODS.add_card { key = 'c_gcbm_est' }
replace it all with just that?
yes
To see if this would work
no
can you send the entire crash log
I think I found what was trying to index your "center"
so what do we do about t
since you have debugplus, try opening the console with / ingame and type eval G.P_CENTERS.c_gcbm_est
Right, that doesn't quite tell me how to apply it
So for some reason, G.P_CENTERS['c_gcbm_est'] is nil.
So your consumable code is not being executed, or your prefix is not gcbm
I suspect it's something other than c before _gcbm_est?
it should be gcbm
i would be inclined to believe that, i just dont know what it would be
are you defining your consumable type before making your consumable
i sent you all the consumable type code
the case should match
yes, but is it before or after your consumable is defined
gcbm != GCBM
its before any info on specific consumables
But is SMODS.ConsumeableType loaded before SMODS.Consumeable ?
ingame do eval SMODS.ConsumableTypes.Drugs
Post a pic of your mod json file, also.
they're using a header, which is old but should still work
so presumably they do not have a json file
correct
i just downloaded a joker mod example and have been building off of it, so thats why some of it may be out of date
yep
it works fine
and i can spawn the category, just not the specific omne
\i can spawn one of the two i currently have, jusrt cant choose
So it's just that spawning it causes issue
Do you see the 'est' card in the collection
except the animation but im less worried about that now
yep
dont ask lol, its a collab mod and my friend came up with it
But is your SMODS.ConsumeableType loaded before SMODS.Consumeable is though?
yes
Sorry, didn't see your yes earlier. Just saw it.
i've been plaigarized 💔 /s
dang mine is better though bc its a consumable
love that art
yeah its peak
it's so good lol
i havent done the art yet, just placeholders for now
fair
but do you have...
Okay open your collection and type eval G.your_collection[1].cards[3].config.center.key replace the 3 with whatever index your estrogen card is
this is supposed to copy the ability of all jokers - and it works, except for cards involving repetitions (see video) - how could i fix this? blueprint works basically the exact same way as my code, but copies cards entirely correctly
how do i find what inded it is
from left to right, starting at 1
aight
thats what i assumed
WAIT
are there just extra spaces
no way
if thats it imma crash out
I see, so in your header you have spaces after 'gcbm'
dunno, but please use a numeric for loop instead of ipairs to guarantee the order of operations
will do
now time to swap to json metadata
ipairs should guarntee order
just pairs doesn't
howwdo i do that
ill makke the json and see if that fixes irt
if you're using debug plus and loaded a save file
after i make the json do i delete the header
then the previous cards will have the prefix with spaces
ahhh
yes
the only reason i can think of that this might not work is because the base blueprint only copies one? and uses a return value instead of the SMODS.calculate_effect()? but honestly not sure 💔
oh heck you're right
Is there a mod that adds a simple sticker out there? The wiki is not clear enough imo
try putting your calculate_effect in an event
anything
alright
why would that do anything?
yeah I just realized, that'd only fix the message appearing during calculation time
but for repetitions it uses the return value
Ngl, this revelation is kinda hilarious.
still worth fixing
hmm
try your joker with a card that gives chips or mult
it is lol but i cant belive it sti;;
it works just fine for those
the only problem is seemingly ones with repetitions? though i can't be 100% sure
what you can do is take into account if the return table of the other joker has the repetition key
then add it to your own table and sum up the repetitions of all of them
and then return that
but that only really accounts for repetitions
oh, so save repetitions for the final values?
yeah i think that'll work
you could also make it show all the messages consecutively which would be very funny
but yeah you can only return one message
doesn't SMODS.calculate_effect already put it in an event?
putting it in an event makes it score the mult/chips after the hand was already scored, effectively making the card useless lol
yeah cus it's now two events deep
i think the problem with the text is that it's getting the return text, but not the repetitions and all that
it didnt like the json
im gonna stick to the header for now bc it works and theres no need to change it
oh my god this is perfect
so that's why when it copied hanging chad, it put the buggy text but obviously never bothered with any repetitions
man this is annoying
now that i can spawn cards properly i can make my costco joker that makes 5 big booms
cause if i put all the return values in a table, if they happen after the rest of the flow they can be kinda useless
bringing back this question tho
costco joker?
for example saving a hanging chad repetition would do nothing since it doesn't have the first card to score, or at the least could add a very diminishing amount to setups wioth the first card
BOOM! BNOOM! BOOM! BOOM! BOOM!
How do I apply a new sprite to a vanilla enhancement like stone cards?
maybe i'll just make it easy and ignore jokers that do repetitions lmao
you're not really returning anything tho
i did notice you're missing a check for 'context.no_blueprint' tho, dunno how relevant that is to your current issue
i'll add it but unfortunately idk if that will fix this, but for sure better to have than not
You could also use retriggering jokers instead of copying them
smods has that
as in, just make the jokers themselves activate again if they're retrigger jokers?
yeah it'd kinda look like this, you need the optional thing at the top somewhere
isretrigger_joker_check specifically for jokers with retriggers or would i need to check by name?
no no, retrigger_joker_check is what smods uses to collect repetitions for jokers