#💻・modding-dev
1 messages · Page 360 of 1
i have no idea what it does but when someone else made the glass cards not shattering function for me they included it so im assuming its necessary
ill try without it i guess
nah if it works there then it must work here and i'm assuming things
ts still doesnt work
next(SMODS.find_card('j_mod_key')) would check if you currently have a specific Joker.
yeah no difference 
forgot to remove own reply, oops.
-# tl;dr context for the nil score requirement is me trying to optimize DriveSpace.
yeaH, I just don't quite understand what next does as a function
It should be SMODS.poll_enhancement({guaranteed = true}) and SMODS.poll_seal({guaranteed = true})
yeah i just dont understand why adding these four lines stops the code from working even if i have the joker
man
its not crashing its just undoing the xmult change
It's because config is not in calculate.
tl;dr next is basically a check for if you have a given j_mod_key Joker in your slots here.
??
holy fuck it works
i love u bro
kisses
ima give u a smooch bro
u cant run
what does create_card() do? i cannot seem to find it in the steammodded documentation
SMODS.create_card, you mean here.
im pretty sure it is? unless you mean the SMODS.find_card() invalidates that somehow
SMODS.Enhancement:take_ownership('m_glass',
{
update = function(self,card,dt)
if then
card.ability.Xmult = 1.5
else
card.ability.Xmult = 2
end
end
},
true
)
```?
still dont understand how config isnt in calculate
its definitely between the start of the function and the end
because this is a declaration
that's whre it really ends up
I mean a constructor, for an object that smods injects into the game in a different format
Some objects may not have either a config or calculate field.
i have no idea what that means but ill take your word for it
Using such as example.
so would i want to paste this inside the jokers calculate function?
No, you replace the take ownership with it and fill in the if statement.
ah
how do i make the added enhancement take effect?
right now the enhancements dont work in the hand they were added
carded = G.hand.cards[i]
G.hand.config.highlighted_limit = #G.hand.cards
G.hand:add_to_highlighted(carded, true)```
I have this piece of code, it works just as intented where I already use it. I wanted to reuse it for highlighting Spades specifically, tried doing `G.hand.cards[i]:is_suit("Spades")` but that results in a crash with `attempt to call method is_suit (a nil value)`
How do I highlight spades then?
this makes the glass cards display 1.5x mult but they still score 2x?
for k, v in pairs(G.hand.cards) do
if v:is_suit("Spades") then
G.hand.config.highlighted_limit = #G.hand.cards
G.hand:add_to_highlighted(v, true)
end
end
```?
Oh yeah thanks!
Hi, I'm trying to do a couple of things in my mod and just can't figure them out. The first is a context for a joker being destroyed, e.g. giving money when this joker is destroyed. Does anyone know what this context would be?
The second thing is how to create a joker with a mod key, e.g. create a joker that starts with j_cry or something. Can anyone help me? Thanks!
You mean create a joker from a certain mod?
You would call a context in Card:start_dissolve if the card is a joker.
Something something iterate of G.P_CENTERS and checking if a key has the j_cry at the start of a string...
so like this?
No.
could you provide an example? I don't think I'm following
yeah didn't think so 😅
local modjokers = {}
for k, v in pairs(G.P_CENTER_POOLS.Joker) do
if v.mod and v.mod.id == "modid" then
table.insert(modjokers, v)
end
end
```?
any joker or a specific one?
-# Or that.
a random joker from a mod, preferably not legendary but I have sufficient understanding to modify it in that way.
Just needed a template to build off of, which this is helpful!
local modjokers = {}
for k, v in pairs(G.P_CENTER_POOLS.Joker) do
if v.mod and v.mod.id == "modid" and v.rarity ~= 4 then
table.insert(modjokers, v)
end
end
local joker = pseudorandom_element(modjokers, pseudoseed('randomseed'))
SMODS.add_card({key = joker.key})
```?
yeah that's pretty much exactly what I was gonna do
anyway there's no context for a joker being destroyed
i don't remember which mods add one but I'm pretty sure there are some
the problem is that is not easy to distinguish destroy/sell/remove outside of gameplay
See how Paperback or Betmma do it, then write a SMODS PR
Thanks for pointing me in the right direction guys. I'll check out those mods. Have a great rest of your day!
you can look at the source code
Take a look at the wiki
cuz it only works by deleting the whole hand of 1
😦 i cant find
no like i cant find it in the wiki
what do you want to destroy exactly? a discarded card?
It's in that page
just CTRL+F "destroy"
biting the bullet
by the way I made a Joker to reward skipping
ayy noice :3
not bad
Hi, im trying to make basicaly the Wheel of Fortune, but i dont really understand at all lua/balatro source code, so, how it would be to trigger the joker if Wheel of Fortune applies an edition or not?
i mean basically that when the wheel of fortune does not trigger you get mult
and theeere's some good taste
uses the trademarked dark purple and seagreen Coonie color scheme, lol. I guess KastorCode needs sued :P
but I appreciatte the availability
Not sure that's doable easily
I'vd seen this before
one moment
cryptid has one too
I mean it's doable, I just think it's a bit high if it's like your first Joker
but cryptid has weird code
https://github.com/lshtech/risk-of-jesters
this is "roj"
whats the internal name for the soul?
thanks i will look it up!
it isn't just c_soul?
The key is c_soul
SMODS.Enhancement {
key = "infected",
loc_txt = {
name = 'Infected'
},
atlas = 'enhancement',
pos = { x = 0, y = 0 },
calculate = function(self, card, context)
if context.main_scoring and context.cardarea == G.play then
for _, scored_hand in ipairs(context.scoring_hand) do
if scored_card() then
scored_card:set_ability('m_infected', nil, true)
G.E_MANAGER:add_event(Event({
func = function()
scored_card:juice_up()
return true
end
}))
end
end
end
end
}
does anybody know how can i changer this to work like an enhacement? (currently its based on midas mask)
for _, v in ipairs(G.jokers.cards) do
v:calculate_joker({
wheel_failed = true
})
end
end
end```
loooks like how they did it was a custom context
which i wouldn't have known is what this is if it wasn't " if context.wheel_failed" in the actual joker code
so yeah advanced stuff
manual calculate joker ,,,,,
you're not defining scored_card anywhere (nor would it be a function, i don't think)
back in the day we calculated all the jokers by hand
That’s certainly one way of tracking wheel fails
it's a 1.0 port of a 0,98 mod, which might explain if it does things an old way
i saw it in vanillaremade so i thought it was more like built in
Somehow the loc_vars remains 0, even if the calculate function does properly gather its info. Does the generate_ui for seals use a fake card?
did you
Can you link the thread or git again, N? I forgot to save it last time
yes
speaking of older ways of doing things, ability.name, lmfao
Contribute to nh6574/VanillaRemade development by creating an account on GitHub.
question how do i make return {message} do a different sound?
why did thunk do that and everybody copy it for a while?
but you're not doing that?
you may have misread what that code does and what you wrote in your own
in the docs it specifies how to use sound
i dont know what im doing at all tbh, i figured midas mask code would be similar to what i want to do but i have no clue
so, compare the loop you've written to that from vanillaremade, and you'll see that you use scored_hand instead of scored_card!
wiki doesnt explain much when it comes to enhancements (or im too dumb and ignore sth obvious)
like... it might be unavoidable here because of how it interacts with vsnillia ccode actually
not proper terminology, though. But it's what's used to signal you're calling a function, which in your case will not exist and not be defined anywhere
I'm not sure the key exists anywhere on the args table being used
but i might be wrong
SMODS.Enhancement {
key = "infected",
loc_txt = {
name = 'Infected'
},
atlas = 'enhancement',
pos = { x = 0, y = 0 },
calculate = function(self, card, context)
if context.main_scoring and context.cardarea == G.play then
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card then
scored_card:set_ability('m_infected', nil, true)
G.E_MANAGER:add_event(Event({
func = function()
scored_card:juice_up()
return true
end
}))
end
end
end
end
}
is this better?
No, you need your prefix where m_infected
fair, ill figure that out then, but rn im looking for how to make it behave like an enhancement rather than joker
I'd test it out, and see what the crash log tells you. If there's no crash log, however, it works! But yeah, you'd need to add your mod prefix
what is the easiest way to get the "Mods" directory dynamically? will it always be SMODS.current_mod.path and one folder up or no?
enhancement's have an effect parameter in their calculate function, is the main difference
this is the set up for one of Kino's enhancements, and you can see that the set up of a simple one doesn't much differ from a joker's. But the best thing to do is generally to set up a template, and check the docs on the smods github wiki and see if you're properly asking for the same parameters. I think without the 'effect' there, it will work, but it could cause strange interactions. I'm not actually entirely sure, though
No they don’t
No
oh man
Not for 5 months
got it thanks
ah, okay, so that's a remnant of me starting Kino as a project on a very old version of smods accidentally
nvm im dumb
why does fusion jokers have.. after the commas in the extra tables?
i forgot about the json
oh it's just a space
lol
first time using vscode
whitespaces
There's a config to automatically remove those
In VSCode you go to File > Preferences > Settings and type "Trim Trailing Whitespace"
or i could just do this
Lame
bumperino, lua is a garbage language that doesn't support relative imports, which mods workarounds this the best?
i want to require a lua file in a sub folder
In your mod's folder or another?
SMODS.load_file supports relative paths?
yeah but does it support loading stuff into global lua space?
yes
everything is in global lua space
lol
afaik
okay but SMODS.load_file is relative the mod directory
not the current lua file, right?
correct
that is, in fact, glorpshit
glorp
but alright lua, i'll jump through hoops again to make you happy you fucking piece of shit language
anyway, thanks for the help
what did lua do to you
I think lua has what you want normally, the problem is lovely
literally every other serious language supports getting the path of the current file ur in, not just the cwd or the folder the "starting" file is in
because you aren't running from the file you're in
whoops meant to remove that
from what i've read that's also not really reliable, that whole debug.info garbage
but it still might be helpful
also... that thing I sent you to debug literally already does the thing you want?
how did they get it to work?
anyway, i'll stop rambling and just accept it (for now)
only one level "deep" for the json library, yeah
i forgor
yeah

but this would work exactly the same if it was in a subfolder?
Return {remove = true}
does that just enable removing?
No, that tells the game to destroy the card.
cuz i want to remove only one card
oh
so
remove means to remove all the marked cardS?
if context.destroy_card and context.destroy_card == context.scoring_hand[1] then return {remove = true} end
if ca.lua is in the mod folder root, yeah
but if i'm in items/stuff/yay.lua and want to import items/stuff/yay/util.lua, then i have to do SMODS.load_file("items/stuff/yay/util.lua") which is stupid
so context.destroy_card repeats for each card?
Yes.
ok thx
I mean... i guess? but like... you could just load everything in main.lua and be done with it. it's all in the same place then and you can treat it like one big file
how do i deal with this
so you can do stuff between files no issue
do u want to remove it or what
Also set card.getting_sliced = true
make a new SMODS.Rarity?
wut does that do
yes thats the rarity badge
It shouldn’t do anything by itself
whar
It just marks the card as a card that’s getting sliced
does the base game do this for playing cards, I don't remember
wut does getting sliced mean
No but SMODS handles it
yeah idk, i like local variables and definite, understandable scopes, but i guess i'm in the wrong language if i'm looking for that
i mean... put things in functions if you want locals?
why you need this in a first place? Just store stuff in global object like everyone else, import everything in main file, and call it a day
It just means that it’s getting sliced, but I recommend marking it as getting sliced when it’s being destroyed
and then just run the function
how, I didn't see it in the dumps when i was making the mod
o
It should all be in Card.can_calculate
It’s useful for other effects in your or other mods
I dont think getting sliced does anything on playing cards?
oke
@wintry solar
the relativity only really matters in languages like c# and such because scripts/code on those are mostly self contained
I'm asking because if smods handles it it doesn't matter if they do it manually
unlike in lua where basically everything gets added to the damn global table
I said that SMODS handles it in the sense that Card.can_calculate checks it, not that SMODS sets it
Lua is like old JS with var 
all my homies love _G
bruh okay, let's say i have joker1 that imports it's loc_vars from a subfolder because they are so big
let's say i wanna do the same for joker2
now if i call both of these separated loc_vars the same name, one gets overridden, meaning i can't just dump them into global
ok but i don't think the game uses it with playing cards
maybe you could help strmnn. He wants to figure out how in lua to easily load files from other files without having to put long paths
he doesn't want to just load everything in main because he wants locals and stuff with a limited scope
And I said you’re right
But SMODS does
does it?
no please, i'm already done with this
i've accepted it and i'll just use "absolute" paths with SMODS.load_file
It did when I PR’d Card.can_calculate. I know there were timing changes to when Card.can_calculate is called, but I don’t remember that method itself being changed
I am 99% sure that it doesn’t use it for playing cards
it only matters on Jokers in the same calc step yea
god I'd hate to navigate your code without an ide, lol, with it being so broken up, But fair. I can't easily think of a solution for that, nor does it seem like you're looking for one that isn't just being able to do it in a way that most languages/enviorments can but this speicfic implementation of lua can't, which again is fair
i am getting sliced rn
print(N.ability.getting_sliced)
i dont have ability
who are you
im sorry
any reason it shows up as error?
It did when I wrote the PR https://github.com/Steamodded/smods/pull/508#issue-2889832016
Right now, it seems to at least matter to Seals, which are on playing cards. But I think the part that covers playing cards might be in another file
Since it was restructured
wait people localize their poker hand names in joker descriptions
localize(card.ability.extra.hand, 'poker_hands')
that's what vanilla does for some reason
Example from the original PR
it works now ty, what does the poker_hands do here?
As you can see, this is (trying) to run Card.can_calculate on non-Joker cards
it tells it to grab it from the poker hands localization table
Although I’m not sure this specific logic was correct
i see thank you
bump
You need to apply the Enhancement immediately and not in an Event
If you want it to take effect immediately
...is this not how i use a custom rarity?
my other mod uses this so idfk why i cant get it working now :3
so trigger = "immediate" or i just remove the event?
is this an if condition?
perhaps
yes
true
Here’s Glass cards being tested for card.getting_sliced
Outside the Event
aight
i mean my point was that vanilla cards don't use it so it doesn't make much sense to recommend it to someone
it could be handled by { remove = true } maybe?
I disagree. SMODS already adds utility functions to handle new mechanics that aren’t supported in vanilla
And anything like Quantum Ranks will be the same
I do agree it’s not ideal
But there’s not always a better solution
Maybe it could be, I’m not sure
But this makes it so it behaves differently from vanilla in a way that people might not want, so I wouldn't recommend it unless someone needs it
OR patch the vanilla cards that destroy to do it
I don’t understand your first point
It should only behave differently in the way it interacts with other modded content
Since vanilla doesn’t use it
If someone is making a joker that destroys you can't assume they want the card to stop calculating too
And if a mod needs the card to stop calculating when destroyed then it has a problem with vanilla
what the
I half-disagree. If the card doesn’t exist, trying to calculate it crashes the game
If the card is just going to be destroyed at some further point in time, then marking it as being destroyed isn’t necessarily what you want to do
do i need to do some extra stuff to actually get rarity working??
I mean I see that, that's why I think it should be added to vanilla cards too
But with the destroy_card context, those are simultaneous
There’s not anything that would care
So it doesn’t impact anything except some niche mod interaction, maybe
I’m just teaching other people to do it since it’s not vanilla
If I understand how this works correctly, it needs to be auto added to anything being removed in destroy_card so that context.after doesn’t crash
thats fine i just wanted to know if i needed to add it to the example mod
There’s no need for it to have to be applied manually to olaying cards
It should just be handled internally
Well, if it can be handled automatically then I don’t need to suggest people do it manually. But I didn’t add the functionality for it to be handled automatically
It does need to be handled manually in other timings
Actually, hold on
I think aure changed the logic
I wouldn’t recommend anyone trying to destroy playing cards in other timings
I think cards in the standard calculation pipeline are only tested at the start
wait
I think that change was made to simplify debuff manipulation
is this a class, not rarity?
So context.after might not care either way
Yeah I think that’s your type badge
Because by then it’s already too late
To be fair, this handles all cards, not only playing cards
Yes, I thought it was a property unique to joker type cards
In vanilla it’s only set by Dagger and Madness IIRC
So in vanilla yes
As I had said
And thunk manually checks if Jokers are getting sliced to avoid calculating them
hahahahahahahha thats funny its not like im trying to do that 😭
I just automated the entire verification process except marking cards as getting sliced
Because that’s not a verification step
Also as I said I’m pretty sure it has since been fixed and/or reworked to some degree
Yes, that’s why I thought it wasn’t for playing cards, as playing card destruction is handled automatically, if getting slice is supposed to be used, it should automatically be added
i am confused
for _, held_card in ipairs(G.hand.cards) do
if held_card:is_suit(card.ability.extra) then
G.E_MANAGER:add_event(Event({
func = function()
held_card:start_dissolve()
return true
end
}))
G.E_MANAGER:add_event(Event({
trigger='after',
delay=0.7,
func = function()
held_card:remove()
card.removed = true
return true
end
}))
end
end
i don't think this is properly removing the cards from G.playing_cards, anyone know why (the context is context.selling_self)
i have no clue how to even change this badge, hm
I remember badges being in two places
See Consumable Types in the wiki
if you wanna create a consumable type use SMODS.ConsumableType if not use SMODS.ObjectType or something else
ok, trying to do mods to balatro made me realize that lua is totslly not ny thing and i should stick with rust
i want to go commit -naneinf 🥀
-# idk how to get this going, theres very little documented about this
steamodded rust version when :3 /j
any of yall know how to fix this white outline issue when using pixel smoothing
that seems to be a bug a lot of mods experience
soon as i posted that i remember someone mentioned it possibly being an issue with missing color info
so if i just have a bg layer with a flat color and give it 0% transparency it apparently fixes it but i might be misremembering
i'm exporting with photoshop lul
It’s to do with how you scale iirc
hm
i usually just go into image size and double it when exporting the x2 variant and then undo
can you use loc_txt for SMODS.ObjectType, or is that only for ConsumableType?
you guessed it :3
label = text
Not for the badge
this made it worse somehow 😭
mmm i see
also, just to be sure - my loc_txt should look something like this, right?
because its crashing rn :3
Try putting label on the object itself
https://github.com/GauntletGames-2086/D6-Jokers
this is the only mod I know that uses object types, could look here
thanks, that should help a lot considering im just blindly doing things and praying that it works now
Flowwey also wrote the object types iirc so it’s probably the best place to look
how do i check for if a specific hand type is discarded?
-# thats not very useful if i have to be honest 🥀
okay so it's exporting wrong? this is meant to be 852 pixels
how the fuck does this happen
the x2 dimensions should be 852x1330 and that's what i'm inputting here
(i have no clue why my photoshop is in spanish
okay so the dimensions are fine now but that didn't fix it lmao
doing custom textures on paint rn
Hello. I have come here (again) to ask (again) for help on making a custom UI appear when pressing a certain key. Can anyone help me with this? I have read the SMODS page about UI structure and I still haven't been able to figure out how to work it out.
how do you check if the player is in a blind
G.GAME.blind.in_blind
What kind of UI
You press a certain key, then buttons appear as some kind of overlay, that's the idea.
Buttons where
..on screen? I don't know where else they would appear.
how difficult would it be to recode steamodded to rust
good luck
You press a key, then a menu, like idk, the collection, settings, etc appears.
well that sure isnt motivating
On cards, on menus
You can make a keybind that opens a menu
...maybe also that later.
Yeah, but how do I do just that?
I got the keybind part down.
Menu function is what I don't know how to.
There are examples in the game
-# that doesn't help me
okay nah but rly lua is so not my thing
ms paint my beloved
if someone does a balatro rust framework i will pay them a dollar
maybe even 2
so help maybe?
I mean.... you'd have to basically write a rust to lua cross-interpreter
lol
okay ill pay 2.5 dollars then
cause the game runs on uncompiled lua code
first round joker has a custom menu maybe that'll help
it's compiled at runtime
2.5 dollars is what i can do
what?
Already did that.
lmfao
ah dang
Already have done jokers, enhancements, consumeables
I am not that new to this.
I just don't know how to make a menu appear when pressing a given key.
though if you do know rust maybe you can help @gaunt thistle develop lovely
it's the runtime injector we use
that mod has a custom ui when pressing a key.
and is written in rust
overlay menu or something that pops up like the debugplus tab?
aughhh
Exactly.
which one lol
Just a menu UI whatever that appears upon pressing a certain key.
i have one in my mod
I got the keybind ready, not so much the function that makes the menu do appear.
Why is the changing sprite slightly delayed and is there a way to make it not delayed?:
just have the code use time travel, duh
where are you running this function?
It runs when any context is calculated.
In a joker's calculate function.
how do i create jokers with stickers?
likely explains the delay
you'd have to put it in update an live with it running every frame
if you wanted instant
transpile Lua to rust, job done
SMODS.add_card({set = "Joker", stickers = {"sticker1", "sticker2"}})
Yes, but how would I tell the update function what to change to?
I don't quite understand the question, but i'm sure it's a valid objection. I just don't know shit about functions yet
I imagine if something is valid for literally every context, it's always valid, but there ae probably outliers i'm missing
how do i make it add a custom sticker? i set it to modprefix_key and didn't add anything
It should be: SMODS.add_card({set = "Joker", stickers = {"modprefix_key"}})
that's exactly how i did it
Would you say "Card with highest rank in scoring hand" or "Highest ranked card in scoring hand"?
1 feels right but raised fist's description is very similar to 2 except it's "lowest ranked card held in hand"
So maybe "Highest ranked scoring card"?
sounds good
What if you did ```lua
local card = SMODS.add_card({set = "Joker"})
card.ability["modprefix_key"] = true
gimme a sec
there we go
thanks
but it show an eternal sticker and ERROR where the sticker name should be
why does this cause a crash?
alright it works now but play the 'remove' sound like a billion times
May I get some naming suggestions?
imaginine naming yourself after thunk's shtty way of finding objects
also, there's a new full release of the smods beta
unrelated to the crash
good to know
is it possible to check what the hand type of a discarded hand is? like what would have been showing as the hand type just before they pressed discard
you may or may not need a 'discard cardarea' optional feature
aight, i tried
You mean like burnt joker?
key = "burnt",
unlocked = false,
blueprint_compat = true,
rarity = 3,
cost = 8,
pos = { x = 3, y = 7 },
calculate = function(self, card, context)
if context.pre_discard and G.GAME.current_round.discards_used <= 0 and not context.hook then
local text, _ = G.FUNCS.get_poker_hand_info(G.hand.highlighted)
return {
level_up = true,
level_up_hand = text -- TODO: this crashes, seems to be an SMODS bug?
}
end
end,
locked_loc_vars = function(self, info_queue, card)
return { vars = { 50, G.PROFILES[G.SETTINGS.profile].career_stats.c_cards_sold } }
end,
check_for_unlock = function(self, args) -- equivalent to `unlock_condition = { type = 'c_cards_sold', extra = 50 }`
if args.type == 'career_stat' and args.statname == 'c_cards_sold' then
return G.PROFILES[G.SETTINGS.profile].career_stats[args.statname] >= 50
end
return false
end```
Here's burnt from vanilliaremade
Though I guess it crashes, lol
^ it doesnt anymore i just removed the comment
key = "burnt",
unlocked = false,
blueprint_compat = true,
rarity = 3,
cost = 8,
pos = { x = 3, y = 7 },
calculate = function(self, card, context)
if context.pre_discard and G.GAME.current_round.discards_used <= 0 and not context.hook then
local text, _ = G.FUNCS.get_poker_hand_info(G.hand.highlighted)
return {
level_up = true,
level_up_hand = text
}
end
end,
locked_loc_vars = function(self, info_queue, card)
return { vars = { 50, G.PROFILES[G.SETTINGS.profile].career_stats.c_cards_sold } }
end,
check_for_unlock = function(self, args) -- equivalent to `unlock_condition = { type = 'c_cards_sold', extra = 50 }`
if args.type == 'career_stat' and args.statname == 'c_cards_sold' then
return G.PROFILES[G.SETTINGS.profile].career_stats[args.statname] >= 50
end
return false
end
}```
Here's the current one
Idk if any changes were made but just in case
Is this substitution correct?
it will be called for objects other than jokers but it seems to makes sense so yeah
what are you doing that needs a patch?
bump
I needed a way to alter their cost
and the patch does?
you can't need a patch for that
but i may be mistaken
To be honest, I wrote this patch in an early time before I learned how to hook, so there may or may not be a better solution to this.
I'm not even sure you need a hook?
Well you might, just to get the shop items
before they load
The probability needs to roll at the moment the transaction happens.
Yup, emphasis on the word "Gamble" in the joker's name "Medical Fee Gamble".
well.... can't you just put the if context.buying_vouucher check in your joker's calculate?
or the update?
I'm pretty sure there is a context for buying an item from the shop even if it isn't called that
but maybe not
Vanilla game does not have context.buying_voucher
yeah i remembered that
You're thinking of context.buying_card
buying_card doesnt count vouchers?
and that doesn't work on vouchers?
how do i get the current played poker hand
In Card:redeem(), G.jokers.cards[i]:calculate_joker({buying_card = true, card = self}) is after ease_dollars(-self.cost), hence the need of the patch.
makes sense
in calculate?
yes
context.scoring_name
But now I re-read the code, I think I might be able to make a hook instead...
yeah you can definitely just hook card:redeem() then
but I'd try to do something stupid like making a context based on detecting if it's ran, lol. pretty sure only vouchers are reedeemed, but also like... also pretty sure that's the same thing
I just dislike any unessacary use of hooks and patches because I'm traumatised from running 70 mods at once
and seeing dozens of patches fail whenever I load my game
maybe hundreds
is it possible to have a joker make a hand go entirely unscored? like no score from hand type, no joker triggers, enhancements, absolutely nada
it's a miracle the game and mods still seem to work fine
but then there's the crashes when they don't
yeah you can just set the score to zero after all other scoring
or use the "this hand won't score" code bosses use somehow
but it'd be more fun to see it count and then... nope
you should even use the Nope! loalization
lol
but nah that wouldnt fit quite right cause it is actually charging up the joker with the non-scoring hand
You can make every card not score yeah
Yup, simple as that.
But that would still have joker effects and the hand type scoring
How do I destroy cards outside of calculate? I'm trying to get a card to destroy itself in a hook I'm doing, so it doesn't appear in two areas at once
there's efinitelya mod with jokers that act on the final score
damn, i finally figured out what i can do with rust in balatro
Updater/update notifier
I mean... helping with lovely was a legit suggestion
that'd be cool
honestly im not THAT good with rust, i understand it and all but i dont want to commit to being some omega rust programmer
Oh yeah you could modify the final score easily enough
bump
it seems like hands also have a debuff parameter?
or os that only there if a blind uses it?
card:start_dissolve()?
I figured this out trying to track down what blinds that have hands not score do.... they just set hand.debuff
at least that's all I'm seeing here
Bumpppppp
Because you return in the for loop
huh, waitr. it isnt an issue with my mod
Ohhh that would do it wouldn't it............ Me dumb..........................
Thanks!
Can you tell me where to see the full list of functions such as add_to_deck, calculate and so on?
they said add_to_deck and calculate
there's some usefull stuff too
Actually I meant the full list of features that were given to you there is no update function so it is not a complete list
there is no complete list
smods docs incomplete
add to deck and calculate are also not functions
they're in here though
Okay, but what are the other options in a case like this
i mean... they kinda are? at least they're index keys for functions
you put functions in them
ieh.
they're not exactly callable
no, but they're called as functions when they're meant to be, because they're functions, just not reusable ones
but i'm being pednatic ig
this is correct right
because apparently it is crashing with some other mods i just wanna make sure it's not my fault
that seems correct
TFW your kids are playing games on your Steam account so you can't test your balatro mod
🐴 ...did you try launching it directly and not via Steam?
hiya! this Joker doesn't do anything, and am debugging that
👀 wow I did not think this was possible
it looks like it's an issue with next(get_lowest(context.scoring_hand)) == context.other_card:get_id() (i removed :get_id, since it was complaining that i was calling that on a number value)
it's meant to retrigger the lowest card, if the played hand is a Junk
the Junk detection works, at least ^^"
I wonder if there is an iconic Ghost Card from YuGioh I could integrate into my mod. I have a Ghost Rare edition, a nod to Yugioh that mtues the palette of the card and tries to make it look shiney like those cards
But there's nothing in my joker set to reward this edition. I really like jokers who synergize with card enhancements
Here's how I retrigger all cards for a new custom hand I added,
You could use the same sort of context combinations to apply your effect to the lowest scoring card too
oh, i only wanna retrigger the lowest card, that's the bit that isn't working
otherwise, with Splash, every card would be retriggered 3 times ;)
does any1 know how to write shaders?
Hi again Seth
hi fox
Are you iterating through the scoring hand with a temporary table of your own with table.sort?
oop, nvm, i got it to work ^^
if context.repetition and context.scoring_name == "phanta_junk" and get_lowest(context.scoring_hand)[1][1]:get_id() == context.other_card:get_id() and context.cardarea == G.play then
turns out, next() wasn't correct here
iirc it returns the key, not the value
oh it returns both
right
well, what works, works :)
it's negligible but you should put trivial conditions like the cardarea check before more complex conditions like the check starting with get_lowest, so it can fail faster
i'm pretty sure i've written this incorrectly, what should it be?
context.other_card.ability.config.h_x_mult
i'm trying to get a value from a Ghost Card's config
question how do i pass a variable into G.P.CENTERS?
What is trying to call juice_up? to make this break?
card_eval_status_text
You're passing in self instead of card
oh thanks
I forgot i needed to change that when porting from Source to SMODS
Should the context be "if context.setting_blind and not card.getting_sliced then"
or is that fine for self?
checking for* card.getting_sliced is not needed in calculate
You should (basically) never use self in calculate
Idk what getting_sliced even is
okay, putting Will-o'-the-wisp aside for now, this Joker doesn't do anything either
it should retrigger all unscored cards
but, it's not
you should add it before destroying a joker so it doesnt calculate
and other jokers dont try to calculate on it
can you see why? my SMODS is on the latest version
maybe unscored cards cant be repeated? im not sure
So then I should put... "if context.setting_blind and not getting_sliced then"?
I mean it currently works
how does Wraith set your money to zero?
search for the code with notepad++, that's how i do it
i mean, in the context of smods code of course
i think the right question would be, how to set money to zero using smods
I don't think there's a different function for smods
I think it's just ease_dollars
But also I've never done a money effect so I could be totally wrong
ok then. how do you use ease_dollars?
G.GAME.dollars
G.GAME.dollars = 0?
Look at how vanilla/other mods do it
pretty sure shaders are dark magic
it's kinda hard to check how vanilla implements modding api since... yknow
yeah
What's the best way of messing with mods without affecting my normal save file?
I am developing a mod but don't really wanna accidentally ruin progression
i'm making custom jokers from reddit as practice
one could say tracing for practice xdd
You could try returning negative dollars in the calculate function
Here's a modded equivalent of golden joker
https://github.com/nh6574/VanillaRemade/blob/64936206517d5cc132b14a117c15e1473e460a06/src/jokers.lua#L2628
funnily enough i'm already on those pages
So you could try something like
dollars = -G.GAME.dollars
}```
Idk if that would work
it should
But could be worth a shot
i know ive probably missed more, so if theres anything that increases your hands/discards, please tell me :)
how would I make this effect? (ignore awful loc, lmaoo hehe)
Merry Andy
burglar?
...the discard voucher??
well firstly, to do randomness, psuedorandom("blablablabl") genereates a random number between 0 and 1, so to do a 1 in 4, you would check if its less than or equal to 0.25
Don't do 0.25, because that won't allow for oops all 6's
Check this page to see how they do probability
oh yeah im used to making things incompatible with it my bad 😭
anything else i need to restrict?
Look at other mods to see how they give tags but I think that part is pretty straightforward. The harder part will be destroying after 4 triggers, which will require you to store some kind of triggers variable and increase it by 1 each time it triggers, then destroy the card once it reaches 4
you could also look at the diet cola joker
found it
G.E_MANAGER:add_event(Event({
func = (function()
add_tag(Tag('tag_double'))
play_sound('generic1', 0.9 + math.random()*0.1, 0.8)
play_sound('holo1', 1.2 + math.random()*0.1, 0.4)
return true
end)
I've been looking around, and I think I've got the main part down, all I'm missing is the chance and the destruction parts
OH BOY I LOVE SUFFERAGE!
also, omg, I need to favorite this, this sounds so useful lol
thank you, I'll look into this
I also love my right to vote 🇺🇸 🦅
i think this challenge might be possible
(suffrage joke)
i literally could not beat ante 1 what the hell 😭
Very kind of you to give the player a discard
This makes sense
I feel like this challenge is made or lost in the first ante depending on your shop luck
true
My professional opinion as someone who has not played the challenge
there's so many red lines you'd think there was a fire 😭
using dollars = ... gives a text prompt, is there any way to disable it?
is there a table with all the G.C colors?
whyyyy do you have to spell colour?!?!?!
what on earth 😭
Ok so if you return, none of the rest of the function will get run. The function ends immediately. So don't return first, do other stuff first.
Your parentheses and brackets and ends do not all line up, which is the main cause of all the errors
ahh okey
If you want the tag thing to happen first you can do that part first just don't do it in a return
made a voucher template, if anything looks wrong, please do tell.
whoops, sorry but i didn't get an answer for the first question... :(
You'd probably have to do it without the return statement then
how would i make it so that things from booster packs get added to your consumable slot, and not immediately used?
You can try adding message = false to your return statement but there's an incredibly high chance that will cause a crash
Could be fun though
I'm at my wits end here. I'm needing to apply seals to cards to test them, and I have this function to assign the seal to all cards in my hand (triggered by another function via a keypress). But I'm always getting the "attempt to index a nil value" error when triggering the function. What am I doing wrong?
You can apply seals to cards using DebugPlus
If you're only doing this for testing purposes
There's also a good chance that everything about your function works perfectly fine and you're just passing in an invalid seal key
where do i pull the current round from?
Can I get some UI help? I wanna add some text above the deck overview area. How's best to do this. I assume I can reference the parent in the node but can't find how to do it. I'm trying to reference the game dump to see how it's done natively but I can't seem to make sense of it
- I didn't know you could do that with DebugPlus
- My slash key doesn't seem to be opening the console anymore
how does create_playing_card() work? what are its parameters?
a link to a ref page would help
how do i make it so a consumable cant spawn in a shop until a voucher is redeemed?
in_pool
should the in_pool in the consumable or the voucher?
Well I've found out how to set the seal of my card but keybinds aren't working
Consumable, and then the voucher sets some global variable to true
okay, got it
That I cannot help with, I'm afraid
how can i insure the global goes back to false with a new run
or does it do that by it self
Ah I figured it out, my keybind function was stealing all the keybind listeners. Now I've got it working
Store it in G.GAME
got it
That'll also ensure it gets saved to the run
but now, i domt know how to store it in game lol
Literally G.GAME.variablename = true
Yeah lol
Also I think best practice is to include your mod prefix in the variable name when doing this
good idea
But not technically required
how do you do the loc for chance? I'm looking at the gros michel loc and made something but it has a few Nil values for some reason, even tho I think I matched what gros michel was doing
only just realized I coded the effect wrong lmao
Does anyone know why this still allows for the objects of power to spawn in the shop?
- I doubt G.GAME.OOPspawn will work if you init it here
- in_pool takes a boolean as a return value, not a table
(also you can just do return G.GAME and G.GAME.OOPSpawn)
wait, where should i init OOPspawn
You're already doing it in your voucher I just saw, it's fine there
Tho tbh it wouldn't be needed, you can just check if your voucher was redeemed using G.GAME.used_vouchers.v_modprefix_voucherkey
No need for an extra G.GAME var 👍
oh, that sounds handy
what do i put into poll_seal(options = ) so that it only gives gold seals?
check the func set_seal
set_seal('gold')?
the documentation is very convoluted for me :<
Also you need the card at the beginning
i accidently coded "Oops! All Jimbo!"
Card:set_seal('Gold')
that i have
Yea but it's better to specify so you don't just do set_seal 😅
what about enhancements? what is the function to use?
should i be doing this?
in_pool = function(self, card)
if G.GAME.used_vouchers.v_CTRL_Hotline then
return true
end
end
}
also is there a page with the reference for all available functions?
Card:set_ability(G.P_CENTERS.m_enhancementkey)
I'd recommend checking this https://github.com/nh6574/VanillaRemade/blob/main/VanillaRemade.lua
Should have most of them
honestly just go through card.lua
if you use vscode you can see all the functions
on the side
okay, ive got the cards to not spawn, but they are just now spawning jimbos, should i just lower spawn rate and forget about it or can i the jimbo overpopulation
alright
Aren't there issue if you don't return false afterward? I think a boolean must be returned no matter what iirc
is there a way to do a "message" without using a return? I know that "return" kinda stops things in their tracks
Check the func card_eval_status_text
SMODS.calculate_effect({message = "message"}, card)
what could be causing smods to just not find any mods despite them being in the same Mods folder as smods?
smods runs and then just cant find anything
Didn't know this allowed it to be simplified
okay for some reason puting the mods inside smods for some reason will cause it to be detected?? huh?
im confused, this is only printing the 1 joker that has the ability.extra.exploded_trigger set to true, but every joker with a context.after is triggering? (the code here stops a hand from scoring if you have the exploded joker and play high card, then does its own stuff)
thank you, this was helpful
my destruction effect isn't working tho, lol, something isn't working right, I assume cause, once again, I grabbed a return effect and tried to turn it into an effect without return
I grabbed this from gros michel at some point lol
<@&1133519078540185692> @snow summit is a gift card scammer
i seriously need help here lol, for some reason smods stopped registering the mod again and no no matter where i put it smods refuses to use it
i have no idea whats going wrong, smods is just being busted
how can i force smods to read a mod at a particular location?
oh wait its because im using a symlink so i dont have to duplicate my mod twice over 
you don't need to init it because lua evaluates nil as false
so it not existing and it being false are essentially the same
also you're returning true or false inside a table, but I think you're supposed to not do that
this is my crash from this btw
I know I'm probably just missing something incredibly obvious here, but that tends to be my major flaw lmao, even if I DO know how something is supposed to be done, my brain just skims past things sometimes lol
didn't know about this, lol, grabbed this event straight from gros michel, as I wasn't sure how to make a destruction effect work
don't copy vanilla, copy this if you're going to copy anything
😭 that's where I got it from, lol
here
oh oops
line 962
yeah I see it, it probably has something to do with the fact that this is in an event and yours is not
but also probably just doing card:remove() is sufficient
not it's because im dumb
rip
i needed to test how much of that event was necessary anyway
bump
once upon a time I went down to rabbithole of cardareas and I think card:remove removes the card from the cardarea as well
by this do you mean like
yeah it should
you have rarity X. all X jokers give X2 mult or something?
smth kinda like that, more exactly the effect is a chance of being destroyed at the end of round
i don't think there's a way to have something run based on a joker's rarity? maybe you could have a separate hook that checks at the end of round and does that all manually
how can i make a consumable change a playing card's suit?
Hi folks, anyone have experience with DrawSteps? @daring fern gave me a sample but I really am struggling
I have a deck called goldDeck which is selectable as b_Fox_goldDeck, I'm trying to apply the Foil shader to it.
SMODS.DrawStep({
key = "editiondecks",
order = 5,
func = function(self)
if self.area and self.area.config and self.area.config.type == "deck" then
-- following here is a horrendous mod compatability line
local currentBack = not self.params.galdur_selector
and ((Galdur and Galdur.config.use and type(self.params.galdur_back) == "table" and self.params.galdur_back) or
type(self.params.viewed_back) == "table" and self.params.viewed_back
or (self.params.viewed_back and G.GAME.viewed_back or G.GAME.selected_back))
or Back(G.P_CENTERS["b_Fox_goldDeck"])
if currentBack.effect.center.key == 'b_modprefix_key' then
self.children.back:draw_shader(
'foil',
nil,
self.ARGS.send_to_shader,
true
)
end
end
end
})
probably you would have to put that in each joker's calculate function, but you could probably write is as a function and call it in each joker so you don't have to rewrite it over and over
like smth that checks all jokers in the joker area and apply the chance of destruction to each joker of (X) Rarity?
yeah
how/where would I write the function
Call the card:change_suit('Hearts' || 'Diamonds' || 'etc) method
You could just put
local destroy_rarity_check = function(card, context)
do the stuff
end
anywhere in your main mod file
ah, ok
(I assume you will need both card and context for your function to do what it needs to do, which is why I put them as parameters)
im completely new so idk if ill need both or not yet, thanks for the help anyway
do you know of any mods that have consumables that do that so I can try to understand how it's done?
plenty! Here I made a few myself https://github.com/1RedOne/FickleFox/blob/master/src/consumables.lua#L147
chat, i think i got a good one gor yall. where are used the 1x an 2x textures, bc i dont think i really need to make both
Probably check out SMODS.change_base
https://github.com/Steamodded/smods/wiki/Utility#mod-facing-utilities
25% and 5% if my math is mathing
I'm sure this works but if there's a vanilla way and an SMODS way of doing the same thing, it is generally preferred to use the SMODS way
?
mb wrong ping
?
there
for me it didnt work so change_base is probably safer
yeah all cards may or may not need to use them
you need them both or the game will crash if players are using the other setting
there is definitely a better way to do that
but thats how balatro works so you have to deal with it
ok, so for example rn im editing the hd textures dirrectly, and there is a 1x and 2x. i did some retexturiing and did both, but i fr dont want to do twice all the jonkers
just resize them
you kinda just have to
2x is literally double 1x
turn off anti aliasing
also if its pixel art then resizing to 2x on Nearest Neighbor should work perfectly fine
for example i did a "lets go gambling" wheel, and i did a size down it was ass) so i had to redo it (im using paint
)
youre using paint?
yh
ms paint resizing works perfectly fine
wait are you starting with the 2x
yeh but sometimes if my changes are too thin it fucks up
Hello! I checked out the Balatro modding start guide, it was incredibly helpful
Sorry if this info is obvious, but since modding works by injection, is there a way to see changes you make to code without having to restart the whole app? Or do I have to reload the mod for any source code changes to show up?
oh wow no it does not
do not start with 2x
it doesnt matter
if you start with 1x, it still does anti aliasing
again resizing using Nearest Neigbor with pixel art shouldnt do that
If you have debugplus there are some things like UI that the mod lets you reload without restarting but most of the time no
ms paint doesnt use nearest neighbor unfortunately
so my question still stands, do i only do 1x for when playing ?
theres free art software you can use. i recommend firealpaca
no you pretty much do have to do both
you must do 1x and 2x
this lets you resize by nearest neighbor
😠
I see, even having UI changes without reload would be great, I'll try installing debugplus then
Thank you!
balatro modding has existed for a very long time, if there was a way around it, someone probably would've figured it out by now
i use krita for all my pixel art lol 
debugplus is also pretty critical for any testing
there definitely are ways to automate the process
im sure i could write some custom code for aseprite to save it in 1x and then again in 2x at 200% scale
true, I saw that someone wrote a script for it. But it takes me about 7 seconds to do in aseprite so it wasn't worth the effort for me
but yeah the time it takes for a human to tab into two folders is so small that its basically a nothing process
use a different program and itll make it way easier @upper juniper
what i mean is that i would only do the 1x or 2x (whichever is used in a game) and would keep the base textures for the other folder
i mean thatd work
both are used
so wich one do i priorityze
but it would like. make some textures look different dependent on the context
o wow big typo mb
theyre equally prioritizable idk
😦 ig ill have to test them separately
I have a more complex effect idea here and I'm not sure how I'd go about doing all of it, lol, hehe
i have a question, im sure its been asked here before but i cant seem to find it. how do i add the little tab for cards like lucky cat and marble joker have?
ik what ill do : do a card full red in 1x and make it blue in 2x
info_queue
Contribute to nh6574/VanillaRemade development by creating an account on GitHub.
or more ideally where in the vanilla code is this done? is it in cards cause i dont see it there
it's in generate_ui
its a setting, if pixel art smoothing is on it uses 2x if its off it uses 2x
If I use play_sound, I want to be able to cancel it at some point with a fade out transition, is that possible
can info_queue be used for general descriptions (like if i wanted to have a description for a certain rarity of cards)
I can only find STOP_AUDIO
yes
thanks
Oh no...
amazing
Looks like a good texturepack for Malverk
just curious, but is it possible to make the buttons and most ui elements round instead of having pixellated corners?
my brethren
I’d swap Judgemtn and Lovrse
I don't think you can with the normal UI structure, maybe with your own sprites
but they are holding hands!
im just wondering if it's possible is all lol
everything is possible with the magic of computers
i mean if definitely possible yeah
They’re holding more than hands in the other
just asking because i am working on a wii-themed texture pack and thought round buttons would look better with the custom font i chose lol
Can you solve the halting problem for me
yes send me the program and I'll tell you if it halts
for 5 dollars
Yes, I've done it!
Can you use a computer to make it free
Bro why does Lua not have a built in split function
damn
-100 social credit
ill send you every possible program can you tell me which ones halt using a computer program
I have finally been able to apply a shader to the Deck.Back object!!!
never heard of this
ok let me know when you finish sending them

