#💻・modding-dev
1 messages · Page 343 of 1
the only thing this doesn't account for is the loc_vars text, which I have no idea how stencil displays the correct current value or if it just does that calculation in both functions
and I'm not at home rn so I can't check the source
oh no problems
you're help was wonderful
i'll try your idea of the loop and counter
yeah lmk how it goes
o7
how do i get tarots to spawn on specific conditions
is there a documentation for unlock_condition?
in_pool
unlock condition is like a condition for discovery, in_pool is a condition for spawning
yeah we want a condition for discovery
is there a place that explain unlock_condition better?
Can someone help me getting the localize function to actually do shit?
I think that goes outside of config, and unlocked has to be set to false
Also the thing itself is the function you don't need to add local function
{type = "name_text", set = G.consumeables.cards[1].ability.set, key = G.consumeables.cards[1].config center.key}
yummers
is there a way to see these extra values with debug plus?
now time to figure out how and why it works
eval inspectDepth(table)
If you wrap the given table in either inspect or tprint they show more
how do i check for a enhancement in can_use in a consumable
I think I show all keys on the top level object so just indexing into it works too
if localize gets a string it grabs it from misc.dictionary, else you need to give it a table with the parameters you need
"name_text" gives you the name of the object as a string ("name" gives you the UI table), key and set are self explanatory
in the deck or in the selected cards?
in the selected cards
i want to select 2 cards and if both have "bonus" i can use the card
iterate through G.hand.highlighted and check for SMODS.has_enhancement(card, "m_bonus")
oh wait, forgot the card
like that?
that checks if the player has highlighted 2 cards and if the consumable has the bonus enhancement
to check if the highlighted cards have the enhancement you would need to loop over G.hand.highlighted and check each highlighted card for the enhancement
if either one does not have the enhancement, you can return false right away. If you make it through the entire loop without seeing any issues, then you return true
how do i check if the card itself have the enhancement?
if the selected card i meean
how can you find the key of a highlighted joker?
its my first time trying things arund consumables so im not sure how anything works
how can i make a dynamic debuff joker slot
your loop will probably look something like
for i,v in ipairs(G.hand.highlighted) do
-- stuff
end
in which case v will store the current highlighted card you're looking at
no
G.jokers.highlighted[1].center.config.key
I think?
oh i just assumed it wasnt a table tyy
i want to make a joker that debuff the joker in the right side, like a blueprint. and when it debuff you can get xmult and shi
that's tough because there's not a great trigger for when a joker gets moved around
the reason blueprint works is because it doesn't actually care what joker is to the right until calculate gets called
but if you want to update the ui and stuff to show that the card is debuffed then that's gonna be trickier
i did a similar thing, someone here suggested to use update() to check for a joker to the right every frame and debuff it
if you want the code i'm happy to show it
that was my instinct but using update sucks lol
if it works it works i dunno 🤷♀️
There's worse uses of update in vanills
yeah no that's definitely the right way to do it I just always feel like I'm doing something wrong if I have to use update lol
Listen every steel joker loops over every card in your entire deck every frame
what for???
To count the number of steel cards you have
huh
if it didnt it wouldnt update the value in real time which would look a bit weird methinks
game is wierd
It could be much more effinent and just check the two times it reads the value but that's how thunk made it
Its easier to implement
And less likely to have a bug from forgetting to calculate
I've been saying smods should have a lazy update for thing like steel joker
literally the variables can be anything, but I think it's 'index' and 'value'
by convention
so what do i need that i for?
it's the index into the table you're iterating over
p sure
but you could name it bob instead of i if you wanted, lol
so this is progress ig, but my joker doesnt get emplaced ito my other jokers card area, but i cant select it anymore(havent patched that into the card area) and as you can see my card areas #cards goes up
Is there any way to put HEX("dg0944") in {X:mult,C:white}{} instead of color?
I think you might have to do a new color entry to the colors table?
Or use one in loc_vars
And how do you do that?
can anyone help please?
Funny idea i had for a consumable:
"Combination"
Select 2 cards of the same rank. Combine their suits.
Examples:
7 of Hearts + 7 of Spades = 7 of Spearts
you kinda want to do the opposite of that
if #G.hand.highlighted ~= 2 then
return false
end
for _, v in ipairs(G.hand.highlighted) do
if not SMODS.has_enhancement(v, "m_bonus") then
return false
end
end
return true
my mod have that! didnt start working on bbut will have
familiar has dual suits, you probably would wanna use their implementation for compatibility
same with you
ooh, tyty!
I is index v is value. They can be named anything, but i/k (for key) and v are pretty standard
@unkempt thicket have you considered, if you haven't already, having a ready-to-use sual suit api for people to drop in
seems like a lot of people want to use them
because cards having dual suits. but no, not that way, seems like a nightmare, lol
okay so jokers go in just fine, but they dont appear in the box...
why... why are you using a new card area?
It's implmentation isn't exactly hard, the hardest part is how the sprites for it is setup right now.
Very hardcoded and linear sprite setup
how are you doing it
suree thx
how can i make a debuff effect? im still looking for that
And what parameters should the function have?
SMODS.debuff_card
https://github.com/Steamodded/smods/wiki/Utility
it might be a bit complicated but hopefully you can understand it
could i possibly get a link?
also @unkempt thicket I think it's a good idea to move development back to main
oldcalc has no relevence anymore
I'll make a Pr to do that
anyone know what could be causing this?
the uh... enhancement was applied by a consumable from balatro+
Also would something like this be possible?
Upgrade Tree Deck:
No more booster packs, but you can do an upgrade tree, which gives you upgrades for either money or upgrade points (im still deciding)
possible, yes, but a lot of work
ill be willing to put in the work
the booster pack part is easy :3
can i get the code for that rq then
5 dollars
use SMODS.change_booster_limit
peak
to be clear, what it does is apply a random enhancement and seal to three seleted cards, and destroy 3 non selected cards
I think it worked, but... Silver Deck is a very unusual enhancement
this is debuffing every single hand that contains a high card (so all hands) - what the hell am i doing wrong?
this is how SMODS debuffs hands in blinds
so i'm not sure what's going on here
@dense crescent idk if this is related to the code of the card or it goes deeper
and this just crashes things (i know this is probably not correct at all)
config = { extra = 3 },
loc_vars = function(self, _, card)
return { vars = { card.ability.extra } }
end,
can_use = function(self, card)
return G.hand
and #G.hand.highlighted > 0
and #G.hand.highlighted <= card.ability.extra
and #G.hand.cards - #G.hand.highlighted >= #G.hand.highlighted
end,
use = function(self, card)
local enhancement = BPlus.u.random_enhancement("c_bplus_sigil_beast_enhancement")
local seal = BPlus.u.random_seal("c_bplus_sigil_beast_seal")
local destroyables = {}
local destroyed_cards = {}
for _, card in ipairs(G.hand.cards) do
if not card.highlighted then
destroyables[#destroyables + 1] = card
end
end
for i = 1, #G.hand.highlighted do
local card_to_destroy = pseudorandom_element(destroyables, pseudoseed("c_bplus_sigil_beast_destroy"))
destroyed_cards[#destroyed_cards + 1] = card_to_destroy
G.E_MANAGER:add_event(Event {
trigger = "after",
func = function()
if card_to_destroy.ability.name == G.P_CENTERS.m_glass.name then
card_to_destroy:shatter()
else
card_to_destroy:start_dissolve(nil, nil, 1.3)
end
play_sound("slice1", 0.96 + math.random() * 0.05)
return true
end,
})
local i = 1
for index, card in ipairs(destroyables) do
if card == card_to_destroy then
i = index
end
end
table.remove(destroyables, i)
end
for _, card in ipairs(G.hand.highlighted) do
G.E_MANAGER:add_event(Event {
trigger = "after",
delay = 0.1,
func = function()
card:flip()
play_sound("card1", percent)
card:juice_up(0.3, 0.3)
return true
end,
})
end
for _, card in ipairs(G.hand.highlighted) do
G.E_MANAGER:add_event(Event {
trigger = "after",
delay = 0.2,
func = function()
card:set_seal(seal, nil, true)
card:set_ability(enhancement)
return true
end,
})
end
for i, card in ipairs(G.hand.highlighted) do
local percent = 0.85 - (i - 0.999) / (#G.hand.cards - 0.998) * 0.3
G.E_MANAGER:add_event(Event {
trigger = "after",
delay = 0.5,
func = function()
card:flip()
play_sound("tarot2", percent, 0.6)
card:juice_up(0.3, 0.3)
return true
end,
})
end
for i = 1, #G.jokers.cards do
G.jokers.cards[i]:calculate_joker { remove_playing_cards = true, removed = destroyed_cards }
end
end,
}
this is the code for the card
also do i do SMODS.change_booster_limit = 0
is it doing what it's supposed to do and the pools are just wrong, or is it borked?
i dont see the debuff effect in game :((
no it's SMODS.change_booster_limit(mod)
mod is probably -2? i never tried setting it to negative so it might not work
okay so the formatting is correct, it just seems to think that the argument passed to next() in blind.lua is nil for whatever reason
yeah i answered a similar question the other day
you want hand = string
the docs seem to be wrong or outdated
damn, that's so weird lol
did you try what carrie sent?
0 won't do anything, it adjusts by whatever modifier, so you can just count the number of booster packs and subtract by that amount
-1 subtracts one booster, 1 adds one booster, etc etc
weird
also ill probably make it so you can press rightbracket to open/close the tree, but you can only buy upgrades during the shop
fixed this, changed to debuff_hand rather than the base debuff table
does it work if you set it higher
lemme try
okay, this is weird, Beat (the balatro+ consumable) seems to only be able to roll Familiar decks as "enhancements"
nope
but I got a playcards,cab (like a supercharged standard pack) that had regular enhancements
SMODS.Back{
key = "upgradetree",
atlas = "Backs",
pos = {x = 3, y = 0},
config = {},
loc_txt = {
name ="Upgrade Tree",
text={
"{C:attention}Booster Packs{} can no longer spawn,",
"but, theres an {C:attention}upgrade tree{} in the shop."
},
},
loc_vars = function(self, info_queue, center)
return{vars={colours = { G.C.SUITS["Clubs"], G.C.SUITS["Diamonds"] }}}
end,
apply = function(self)
SMODS.change_booster_limit(-2)
end
}
@unkempt thicket sorry for keepign on pining you, but I have a feeling this might also relate to your mod, saying that it's decks from it that get spawned as enhancements
what if you put that inside an event
i tried putting it into a hook too
still didnt work
There shouldn't be any problem with familiar's decks, they are like any other deck. What's the mod that's causing it called?
balatro+ or balatro plus, I posted the code for the consumable in question
.
oh, that's even weirder
apperently it's any object from Familliar
not just the decks
...suddenly started working for some reason
oh well
time to work on the main portion ive been dreading.
The Upgrade Tree.
Maybe its way of getting its enhancements has a similar prefix of familiar
okay i have 2 ways of doing this, so i want some opinions.
should i:
A - Go the incrimental route, where the upgrade tree has its own currency which generates/gets earned.
B - Have the upgrade tree be based on money
it seems to just be doing card:set_ability(enhancement)
which idk if is correct
.
oh nvm
I see there's a function to grab an enhancement
lemme see what that is
the grass route
yeye, i think im just bad at this lmaoo
the function it calls doesn't seem to exist?
the closest I can find is in utils
anyone know how to make a joker count all cards as non face cards
Hook is_face
am I correct that the code in the consumable won't call this function?
the relevent one with the similar name about a random enhancement
any reason this doesn't do shit when used?
like how? i make a function that calls is_face?
G.hand is a cardarea
G.hand.cards is the list of cards in the area
No, you would overwrite it while still keeping the original function.
so i use take_ownership?
what is better, card_eval_status_text or SMODS.calculate_effect or are they even the same?
(i know the signature is not the same but to me they seemingly do the same thing effectively)
No.
then what do i do? im pretty new to coding
calculate_effect does more because it can also calculate other effects but they're practically the same for text
it's just a bit more practical than having to write 'extra',nil,nil,nil etc each time
i'm also still struggling with this wiki page https://github.com/Steamodded/smods/wiki/Calculate-Functions
if "card" is mentioned, that means playing cards, jokers, basically everything, right?
can someone tell me at least if the error is contrained to balatro+ itself?
i would if i had any clue
yeah playing cards + anything under SMODS.Center is a card
local oldisface = Card.is_face
function Card:is_face(from_boss)
-- if joker is present return true
oldisface(self, from_boss)
end
i've scrolled over that contexts page several times, i find it very hard to grasp
slowly i understand small pieces but some mods using this and some mods using that to do basically the same thing is also not helping lol
the best part is that there are undocumented contexts!
awesome
to find the joker do i use the key?
and it's impossible to inspect because just printing it in calculate spams my logs
You would use SMODS.find_card
unfortunately you'll soon learn that the SMODS documentation is largely very out of date
i'd learn much faster if i could print out the whole context in readable speed, any tricks in that regard?
I usually just look for when the context is called in the code
use events?
Can you explain what's the problem?
the beast, instead of enhancements, does objects from Familiar, of all things
thank you very much
and I can't figure out where the function you're calling to get the enhancement even lives
i feel lost with that because there no like "set_context" function, it's just all over the place being passed around in the source code
the closest I could find is in here
there is for most of them: SMODS.calculate_context
mmmm with that i could indeed ensure one kind of context combination is only printed once
oh i should look into smods for the contexts, i was looking at the source code
yeah, smods replaces them for calculate_context most of the time
is there a way to give an object an alternate name? i need to change a blind's name if ortalab is present
i feel like i also need to take a crash course in lua about order of events/microtasks, i feel like i'm creating race conditions with every line i write
I mean... I'm sure there's something you can just wrap in an if statement
problem is i need to make sure it's localized correctly in the case of eventual translations
but I don't think having blinds of the same name causes anything but minor confusion?
and i don't think name changes can be done in loc_vars
they can
return a key and a set (optionally) in loc_vars
idk if they work for blinds tho
There's still this though, where it seems more confusing for it to have an alt name, if anything
for loop is not for looping
pairs instead of ipairs
Is there an object with prefix 'm_' in that mod? cause I got enhancements from filtering all Center with prefix 'm_'
ah, alright
can't you grab G.P_CENTER_POOLS.Enhanced?
will that even work for modded enhancements?
is that why I only got vanillia seals too?
all mod things should be in P_CENTERS
i meant selecting for prefix of "m"
Yeah I think i'm doing it wrong
luckily the actual function you need is much less complex than what you have
yeah all modded enhancements should be there with prefix m_
from what I can tell
ah, well atm I'm not getting enhancements at all
for some reason
Ouch forgot, I hard coded it
but instead random objects from familiar, as I've said
which wouldn't have a prefix of m
the familiar prefix is fam
which depending on how you did the string matching I can see the issue
not that prefix, center prefix, like all jokers center key start with 'j_'
but in three tries, I shoulda got at least one actual enhancement
ah nah, i'm getting different types of centers anyway
deck backs and momento cards so far
which is like tarots
and only deck backs from familiar
as I said, the function you call here doesn't seem to exist in the mod files
seems to have a different name than the version in utils
I think i should use SMODS.poll_seal() and SMODS.poll_enhancement()
they are also similar in that they don't return anything, right? so i should be able to carefully replace card_eval_status_text with SMODS.calculate_effect
only weird thing i see often is mods calling card_eval_status_text(card, "extra", ....)
does that translate to the extra table of calculate_effect or can i just ignore it? (as i understood, the extra in calculate_effect is for adding an additional effect)
WHY DO I FORGET TO WRITE WORDS man sorry everyone who needs to read my garbage
I think this makes sense? Also, it would give them /different/ random enhancements and seals depending on how you do it, which seems more in line with the point of it, but that's up to you
as it stands all up to 3 get the same
extra in calculate_effect is for that yeah
extra in calc_eval is for making the text background orange iirc
ah okay, but i can just include colour in calculate_effect as it seems
yeah
calculate_effect wohooooo, card_eval_status_text boooooo
i wish i could make everyone replace create_card for SMODS.add_card
what happened
you attempted to index local 'res' (which is in fact a boolean)
are you making a mod or just playing?
making
can we see your code then
lmao that was my next question, thanks
element potassium code
just sad that this otherwise goated file doesn't use the newer smods functions https://github.com/Steamodded/examples/blob/master/Mods/ExampleJokersMod/ModdedVanilla.lua
I lowkey hate that threads in text channels are a thing
I get the purpose
I just don't like the vibes
i think this was made before better calc lol
i've read bettercalc so often in the last two weeks i have no idea what it is, just that it came before me lol
gentlemen finish second
they made some things about calculate more straightforward and gave a calculate function to most objects
it also means you can't trust mods updated last before newcalc became the standard not to do weird shit
i only started my content mod after bettercalc too so idk much about before it
you guys need better names for stuff lol
not that i know any better name but...still
hence why I restarted my modpack when I came back after coming to terms with the loss of dozens of mods
took me months, lol
where's @dense jasper when we need him?
@/john aure smods
(just kidding btw man, I know you've been busy with life)
i can't trust any mod, period. i get modders not updating their whole codebase to better_calc...like kino uses a bunch of older stuff, but i get it
changing every second or so like the misprint text
I mean things that still work are fine to use still
yeah right
but that's not everything pre newcalc
i also mean in general balatro...centers are cards and cards are not just cards but also joker or even more but not always and backs are decks and waahahahahahaahahhaah
what determines the order of jokers in the collection
whenever they load
the order they were created
which can be kinda random sometimes
annoying but reasonable
if i understand correctly the idea is front = rank/suit, center = ability (enhancement, joker, etc.), back = deck (back of the card)
yeah the front thing i actually get when you look at it from a sprite perspective
I mean it just uses the naming conventions thunk did
all of the things do

actually, is there anything that lets you freely manipulate badges? or is that hardcoded
oh and centers are basically the "heart"/"core" of the card....maybe i get it slowly
anything can be freely manipulated if you're determined enough
and know how to patch
for most objects there is iirc idk if rarities have access to it the docs don't seem to mention anything like that
the problem tbh is thunk used a lot of the same words for different things
like I think center means something different depending on context
and different words for the same thing
context also means something
center usually means ability
aaahhhhhhh get me out of here
that's a lua thing possibly? Or a love2d thing?
yeah i tried searching this channel and couldnt find anything either
that's also the issue, there's 4 layers here
smods, balatro, love2d, lua
and your mod is another layer
talisman is the worst layer
lol
I have also just created an additional layer for my own mod to sit on
each spaghetto a masterpiece
you guys are spared from the obscure transpilation quirks from tstl at least
that's like an actual fucking layer
indeed, lol
typescript doesn't even have multireturns - and arrays and objects are different things here
people should use spaghetto more in the context of spghetti code
Is there another way for creating joker with forced rarity? I don't think SMODS.add_card { rarity = 0.99 } will work if there is a new rarity
isn't rarity a param for add_card
does anyone know the difference between mult, h_mult, and mult_mod
rarity = "Rare"?
or maybe it was lowercase
rarities are strings now, thanks to the rarity api, so are an open set
for returns?
or uh... they're keys I guess
yeah, or I guess if they're used elsewhere then what they mean in those contexts too
see, my thing is that smods/balatro is the only codebase I have major exposure to, so I have no idea how idiosyncratic the terminology is
why did keys used to be called slugs, despite balatro not seeming to use that in its own codebase? no clue
mult is for mult
mult_mod is for mult without a message
h_mult means mult in hand but it's interchangeable with mult in returns for compatibility reasons (I'm guessing)
The wiki said it's a number between 0 and 1
damn i wanted to write bad fanfiction of mult, h_mult and mult_mod here but no
oh that's for weighting
strings should work too
but there is a way to definie a rarity
I'm wrong, it's just stupid
but yeah "under vanillia conditions" the numbers definie rarities
the implication is that rarity strings also work
the number is to hard set the weight
The fact I'm going to need to go over who knows how many breaking changes has somewhat cooled my desire to get back into it. Do I need to set up a priority board?
How do I make a right click with the mouse do things in Balatro?
idk why it doesn't just use the old 1-4 system as well as the strings? but yeah it must be because it's a wrighting thing under the hood
I can very much relate to that
instead of doing pseudorandom() it replaces it with your number
I don't know but, this function just a wrapper for create_card() and call get_current_pool() that is hard coded to 'Common', 'Uncommon', 'Rare' and 'Legendary'
yeah I can get that
I mean, those functions are likely overridden or hooked by smods
this looks like i need to do the effects in events, right?
yeah
are you looking at the dumps?
i feel like i'm taking dumps into my code
big mood
from lovely/dump
yeah that's not hardcoded
it checks if it's a number and does the weight thing else it checks if it's a vanilla rarity and assigns it to the respective number else it uses what you gave it
hey chaseoqueso, where can i donate for super tank fight?
It's poll new rarity
if you give it a correct one it doesn't poll
oh uh, I don't think I have anything set up for that yet. I really appreciate that though, I'll figure something out for donations
and you can see, it goes to the pool where the smods.rarities live
Oohh yeah I read it wrong
also... you're using arch, but not using your print screen key?
or is discord just not on your pc?
Discord on my phone, my laptop has 2GB ram it will very laggy if i use Discord
fair tbh
must be a bitch to develop a balatro mod on it
arch is a W, i tried install it but have errors with the servers and pacman shi
though if it's only 2gb, it's probably ddr2 or smth, which is very cheap?
Yeah like, close web for documentation, open balatro, close it again, open web again
or is it old enough where 2gb is the max?
The laptop ram is planted to the motherboard
oh that's grody
sometimes when they do they, they still use actual dimms, which is funny bevause it meas it's still upgradable if you're a good solderer
though I've never soldered in my life
How do you check how much score you have at the end of a blind?
Couldn’t find it myself
G.GAME.chips?
@dense crescent lemme know when you get balatro plus updated, I've been trying to do a release of my modpack, but I keep on running into little issues
i'm cooking
and these negative icosahedra look RAD
my only question is this:
in my eyes i'm doing "make random negative copy of joker" first, then "destroy all negative jokers"
the intention was to also destroy the just created joker with that second action, but hm
Idk, I don’t think that would be it, cause I would think that the score would be a separate variable than chips, but I will try it out later
The score is a different variable from chips, hand_chips is the current chips of the current hand.
Oohhhh, I think I get it now, thanks
got this crash, can somebody help?
excuse the typescript but the calculate for the first action (copying) is this
if (
G.jokers !== undefined &&
G.jokers.cards !== undefined &&
G.jokers.cards.length > 0
) {
SMODS.calculate_effect(
{
colour: G.C.DARK_EDITION,
message: localize("landedOnVertex")
},
context.blueprint_card ?? card
);
G.E_MANAGER.add_event(Event({
delay: 0,
func: () => {
if (
G.jokers !== undefined &&
G.jokers.cards !== undefined &&
G.jokers.cards.length > 0
) {
const randomJoker = pickRandom({
options: G.jokers.cards,
seed: "icosahedron"
});
const copiedJoker = create_card(
"Joker",
G.jokers,
undefined,
undefined,
undefined,
undefined,
randomJoker.config.center.key,
undefined
);
copiedJoker.set_edition("e_negative", true);
copiedJoker.add_to_deck();
G.jokers.emplace(copiedJoker);
copiedJoker.start_materialize();
}
return true;
},
trigger: "after"
}));
}
the calculate for the second action (destroying) is this:
if (
G.jokers !== undefined &&
G.jokers.cards !== undefined &&
G.jokers.cards.length > 0
) {
const destructibleJokers = G.jokers.cards
.filter((joker) => !joker.ability.eternal && !joker.ability.getting_sliced);
if (
destructibleJokers.length > 0 &&
!(context.blueprint_card ?? card).getting_sliced
) {
if (!(context.blueprint_card ?? card).getting_sliced) {
SMODS.calculate_effect(
{
colour: G.C.RED,
message: localize("landedOnEdge")
},
context.blueprint_card ?? card
);
}
G.E_MANAGER.add_event(Event({
delay: 0,
func: () => {
for (const joker of destructibleJokers) {
joker.ability.getting_sliced = true;
(context.blueprint_card ?? card).juice_up(0.8, 0.8);
joker.start_dissolve({ colour: G.C.RED }, undefined, 1.6);
}
return true;
},
trigger: "after"
}));
}
}
they get called after each other and both in the context context.ending_shop
any idea what i am doing wrong here?
sorry for flooding the chat
when does this happen?
what is ++jokers?
your mod is loading twice
no bueno i think
is my mod]
lmaoao
just a name to difference it, i dont think im going to upload it
oh is MiDeckTest and WDeckMod something different??
yeah
test was to look some differences cuz it was crashing
but im gonna delete it now lmao
Is SMODS.Ranks[card.base.rank].key the best way to determine something's rank within SMODS?
no, use .base.id
at least for cards
that's an integer and you can just work with that
does id account for modded ranks?
Why not get_id?
that i don't know, i'd also be curious
btw, rn the problem is with ++jokers mod, i was trying to do the debuff shit and it isn't working
idk, someone here told me this :D
Oh wait it's not base.rank, it's base.valuethat's typically used for internal SMODS stuff
Okay yeah I guess get_id() is fine and accounts for modded ranks, it grabs rank.id from the SMODS rank when it's set
It's not constrainted to vanilla ones
oh... smods.rank is a mess, the ordering is definied by the person who makes the rank object literally defining ranks that come afterit
there is no like.... way to sort by an index
which I guess makes sense tbh
wdym?
I mean they have no inherent numerical value
even if you want them to
at least from what I can glean of documentation
I'm still not entirely certain what you're referring to. Numerical value in what context?
They give their chip score value, and vanilla ranks at least have numerical ids
how do i make this but with more enhancements iinstead of just one?
I mean for straights mostly, but yes the chips value can be used for most purposes
but yeah if you just wanna poll for ranks it doesn't matter anyway
If you mean the vanilla ranks within the SMODS.Ranks table, they do have the order they're created, which is in SMODS.Rank.obj_buffer
Obviously for modded ranks, it depends on when the mod is loaded
the thing with how the straight behavior is defined, which is by the user as what comes after it, other modded ranks aren't accounted for
You mean check if a card has multiple enhancements or if a card has one of a certain amount of enhancements?
so one mod could add a 13 and another a 14 and they wouldn't work in a way that makes sense without them having knowledge of eachother
if it have one of the enhancements its being checked
again, from my reading
i want to check for 3 enhancements rn
I think the problem is with vanillia balatro straight detection come to think of it
not smodded
You could do SMODS.get_enhancements(card) then check if any of the outputs equal to one of those 3.
ooh, okok, ty!
As far as I'm aware, no. Not without changing SMODS code
also applies to strngth
The way Rank ids are determined is in order of application load
bump
it's a limitation in the ranks of the actual game, I think, so I don't blame smods. they'd have to reimplement and break every mod that messes with ranks
So multiple mod creators can't force ranks to have the same IDs, because they're determined automatically by the smods load. They could force them to have conflicting keys, but that should generally be avoided just as a design principle
i feel like you are talking past each other
i think i did it wrong but idk another way that i could do that
yeah, though it's probably because I'm musing rather than making a solid point
and they're coming at me with facts, which are fine, and pretty much what I presumed, but don't really apply to my musings
My pronouns are in my bio, don't refer to me with they/them pronouns pls
sorry, she
I wasn't assuming you were a they, I was just using the English language default pronoun
but yeah, I'll keep that in mind
how do i make a negative card
use ectoplasm
lmfao
well how do i make a negative consumable
I think he means in code
(don't answer perkeo)
use card:set_edition(e_negative)
this time I checked bio
No, you want to check if it contains any of those.
I have a habit of not doing that, so I'm sorry to anyone I use they for who doesn't wish to be referred to as such
im not sure how, its one of the first times im using check enhancements things
discord should really just display the pronouns field on messages
relax, they/them is the default neutral pronoun, no one randomly looks at every profile, she told you what to call her and it's fine (i hope)
fair, what's probably worse(?) is my sometimes he/him defaultism when I do check and no pronouns are listed
also normal, problematic, but systematically normal...i'm not queer but from what i've gathered in most conversations, ur only shitty if you know the pronouns and still actively refuse to use them
yeah I'd pretty much agree
My reason behind doing it is if I check, it means I actually am actively interacting with someone on a somewhat interpersonal and extended level a lot of times, and in that case, I inherently recognize that for anyone that doesn't actively prefer they/them, being referred to exclusively as such can feel odd and othering
like, you don't list pronouns, but because we interact so much, they/them would start to feel weird to use
i personally just don't care, feel free to mix it up lol
not to make fun of others, i get caring about it
there's a plugin for vencord that does exactly this
(although it seems to be partially non-functional at the moment, in that it won't actually load the pronouns until you've clicked on a user's profile anyway lmao)
for some reason everything here is becoming the m_mills_feral
did i do something wrong?
You should be checking if the table contains it, not if it is it.
bump
how do i check if it contains?
Put this somewhere in your code ```lua
function table.contains(table, element)
if table and type(table) == "table" then
for _, value in pairs(table) do
if value == element then
return true
end
end
return false
end
end
ok, what else?
I'll not say I've never used vencord, but I do try to avoid it because it can get ya banned
and I don't trust folk
or really trust discord to not somehow detect it
tbh i'd recommend just using if SMODS.has_enhancement(v, "m_bonus") then instead. does the same as what you're trying to do i think
Then just do if table.contains(SMODS.get_enhancements(v), 'm_mult')
fair enough
tyty
also tried and had the same issue
dang
didnt work
also that code of the screenshot worked
For that statement to be true the card would have to be wild, mult and bonus?
Which is possible but not normally.
in that part it have to be one of them
i doubt anyone cares but just for reference: i fixed it by resetting destructibleJokers inside the destroy event - obviously once the destroy event actually fires, there could be new jokers, but i've set destructibleJokers way before outside the event
and it looks nice too (imo)
nvm i just can select anything
its not working lol
Hm I've never done this before, does anyone have any pointers towards animating the Blind Score requirement if an effect changes its value?
i think it's ease_value 🤔
No I don't mean changing the value, I mean actually animating the text UI element itself
G.GAME.blind.chip_text:juice_up()?
Although after saying that I literally just found what the game does at least when it sets a blind, which is G.HUD_blind:get_UIE_by_ID("HUD_blind_count"):juice_up()
Or I think more preferrably, G.hand_text_area.blind_chips:juice_up()
okay chatters
Im making a consumable that acts very similar to sigil, the "flip your entire hand over, change it in some way, then flip it back"
so it can be used freely whenever you have a hand drawn
so base blinds, arcana packs, and spectrals
this line of code doesnt work tho, works fine on blinds put not the packs
any tips?
i tried to copy sigils code from base game a
and no dice no pizza
Is there a way to make a consumable check if a card has a certain enhancement to upgrade/them into a new enhancement
you would check if G.hand.highlighted[i]:edition = "whatever
SMODS.has_enhancement(card, 'm_key')
is there a place where all game states are?
okay nice
so
is there a state that the game sets at when
i copied that code exactly before and it didnt quite work
yeah its not working
it either only works in blinds
or works literalyl everywhere lmao?
Try just checking if #G.hand.cards > 0
What if I want this consumable to basically check if it has Mult bonus or Wild and have it turn into a certain enhancement based on what it was
if SMODS.has_enhancement(card, "m_bonus") or SMODS.has_enhancement(card, "m_mult") or SMODS.has_enhancement(card, "m_wild")?
#g.hand.cards > 0 is true on blind battles arcanas and spectrals
so
perhaps i literally just do that lol
this seems scuffed tho
You want it to happen when there are cards in hand right?
whats the stone card enhancement called in game btw
like
e_stone?
m_stone
thank!
any reason why this isnt working
i am unfamiliar with lua lol
game isnt crashing, but using the card is softlocking my game
some noob shit i know but
im just trying to learn i think
Definition of flipAllCards?
flip all cards works perfectly
its the transform one
but here
game flips all cards, then just softlocks lol
Try using pairs instead of ipairs
nah
its something with the setting of the shit i think
let me try to hard code it rq
Try changing 'm_stone' to G.P_CENTERS.m_stone
hmm okay
my magnum opus
wait... is this a revive of a really old mod?
is it?
I've heard of pow like a year ago
I know barely any mods
I'm not surprised that I'm not the first person to come up with it though
it seems to be infinitly looping....?
oh shit i need a return true
nah, I'm just having a deja vu moment or something, if it was talked about, it was just in passing
never punished
@daring fern what exactly is G.P_Centers anyway?
It's where mostly every object is.
should I worry about how the back would look when flipped by amber acorn? things like chad stencil and ignore it, but idk
lol
not worth the hassle id assume
if thunk doesnt do it you dont have to
would I not be able to hook the function that flips the jokers and for specifically its id, shows a different back? or is it not that simple
tbh I thought he changed all backs to look the same, because isn't amber acorn vanillia?
I'm not sure what you mean
the backs used to be different?
no? they still do I think
I like that functionality idk
I think they just thought it defeated the purpose of amber acorn on an arbitrary basis
well it's like an immersion type thing, like you're actually playing a card game
yeah I get that side of it
you're both right
the backs are solid, even if the joker has holes in it. however, the shape is still retained
(this was stencil, photograph, hanging chad, golden ticket, and half joker)
buy tnh in a real card game, they'd prpbably just be images printed on normal playing cards
I have a double-sided joker that acorn shows the back of, but only because it's based off a real line of cards that were printed on both sides
yeah I knew the stencil didn't apply, that'd require a custom shader on the deck back I think
i think you can just punch a hole into the normal back
but that breaks immersion with other decks
or wait...
do jokers always have red deck back?
I don't remember
no lol
there's a bug with anhk/invis where it had the wrong back so I think not
it's (supposed to be) whatever deck you're using
you can do the thing I said or maybe make a mask out of it?
then yeah you'd need a shader to do it rigjht
or maybe drawstep?
with a ask like aiko says
mask
can a shader even make something translucent?
i need to figure wtf a smods.drawstep actually is
yes, there are translucent editions
huh
Grrr unblockable events are the bane of my existence right now
my assumption would be that it can only add colors, but I haven't dared to touch shaders yet
shaders can do basically whatever, so long as you're okay with pain
It just does math on the colors, alpha is part of them
afaik
i could theoretically move card calculation logic into shaders if i really wanted to
the only issue is that's dumb
yes, shader languages are indeed full programming langauges, lol
time to go take a video of that one vertex shader i wrote a while ago to establish that i know what i'm talking about
ugh, if it's not one thing it's another, i stg
where are all the blinds' centers?
G.P_BLINDS
thank
was my assumption correct for this if I did want to do smth like that
take a look at Werewolf in Bakery which basically does exactly that
alright, good to know
How does one call a function in itself without causing an infinite loop?
stop at a certain point, either condition or counter
or how do you mean that?
I'm trying to be more efficient with a card having more than 1 seal.
there's multiple way to stop recursion once a goal is reached though
the most basic thing is like this
function test(a)
if (hasReachedGoal(a)) {
return true
}
local new_a = something(a);
return test(new_a);
end
but i think i misunderstand
i noticed that defeating a boss blind will reset you back to small blind, and i initially thought that the code was in end_round(), but its not, anyone got a clue where the code could be?
just need to make sure of two things: have a case that terminates, and return your function call
is there a way to just remove one of the selected cards in consumable?
like a way to differentiate the 2 selected things
G.hand.highlighted[1]:start_dissolve()?
tyty!
Hi chat
is G.hand.highlighted[1]: a way to differenciate the first and the second card selected in general?
hii!
The first card is G.hand.highlighted[1] the second one is G.hand.highlighted[2]
then would this work?
I can't work on my Balatro Mod, away from Computer, so instead I'm working on ideas for it
the first one i want to change to that enhancement, "m_mills_lots, the second one to remove
its crashing
relatable
You don't check the highlighted in use you check in can_use also v does not exist.
as much as i want to dunk on you for this not being how it works i admit i also dont know how to approach what you're doing
many such cases...
oh so i have to set an v and take out the #G.hand thing right?
well what argument is v supposed to be anyway
What does this consumable do?
what parameter is that
like, if i select 2 bonus cards he will remove one and set the other to a "lots" card
basically fusing
interesting
i had something similar to this before and was working but both became the "lots" enhancement so i just kept those two without thinking LOL
also personally i would just check the Card.enhancement instead of using the smods function if possible
if SMODS.has_enhancement(G.hand.highlighted[1], 'm_bonus') and SMODS.has_enhancement(G.hand.highlighted[2], 'm_bonus') then
OHHHH
see THIS makes sense
arg1 is the card ok
ooh ok, so this instead of the "SMODS" thing i have now i put this right?
Replace the whole if with that.
yeye, thats what i meant! tyty!
how do i check if a card have an enhancement? like any enhancement, not a specific one
just SMODS.has_enhancement()?
next(SMODS.get_enhancements(card))
tyty!
Can I do multiple calculate functions in a Joker or do I have to figure out some Lua magic to fit 2 effects in one functions?
Use SMODS.calculate_effect?
It works for most things that would be in the return.
My Joker already has a calc function for a 1 in 5 to auto-win a blind. I want to add in some passive emult.
Why would you need to return to auto win a blind?
Just put it after the setting_blind check?
how can i make this but with 2 different enhancements and both can be either first or second? like, the G.hand.highlighted[1] can be either m_bonus or m_mult and same for the G.hand.highlighted[2]? i thought of just using some or but then it could also be just 2 m_bonus than it breaks
I'll try that idea later on and come back.
Just change 'm_bonus' to something else.
Iterate over all highlighted cards.
but the idea of the mod is fusion, so i can have bonus+bonus, bonus+mult, bonus+wild etc
wait i dont think i got it right
Just change 'm_bonus' and check if v from the iteration has the enhancment.
sorry i really dont understand how that works
for loop?
i think ill just lay down in all four and start eating grass like the caprine i am instead
probably a pretty dumb question but how do i add multiple lines to the description?
(and how do i add a mod icon)
like this:
text = { "this is line 1",
"this is line 2",
"this is line 3",}
just add a , and go to the next line
remember to add a " before the comma and in the start of the next line
?
So probably what you want to do is something like
local enhancement1 = SMODS.get_enhancements(card1)[1]
local enhancement2 = SMODS.get_enhancements(card2)[1]
And then use whatever combining code you already have. Only problem is that I'm on mobile and have no idea if that's how get_enhancements works
okay it works if i put it in the JSON, but which lines in the .lua should i keep?
Put it all in the JSON
That header is an outdated way of doing things, use the JSON method instead
well i tried, but then it just doesnt show up here
you don't need the lua header if you're using json
try using a readme.md file instead
??
There is a correct way to do everything the header does but with JSON instead
I can send you my mod repo if you want to see how I set mine up
yes please
i dont see how that would help? i need a way to make it so the first hand and the second hand can be both 2 different enhancements but not the same, like, both can be either mult or bonus, but they cant both be mult or both be bonus
doesnt work
Hello. Question: Is there a way to check if any given card has an enhancement?
-# to this day I think enhancements are extra fucked up
do i make it "text" instead of "description"?
Has a specific one or any enhancement?
oh in json? thought you meant in cards
Would be nice to have both.
So I don't have to ask again.
Well doing it that way gets you any possible enhancement in the entire game in two lines of code, instead of having to manually check every possible combination of enhancements
in json yeah
SMODS.has_enhancement(card, 'm_key') for specific and next(SMODS.get_enhancements(card)) for any.
but isnt what you sent basically what im already doing but with extra steps?
i think i didnt get it right, again
maybe just take out the {}, im not sure
But doesn't your code not do what you want it to? And the code I sent would be a step in the direction of what you want to do?
Can you explain the goal again?
how does one target a joker? G.P_CENTER.Jokers?
What do you mean?
i want to give iridescent to a random joker
sadly not
just trying to figure out to call
nono, it is working properly now, what i want is a way to say that like
G.hand_highlighted = 1 mult and 1 bonus
G.hand_highlighted[1] either mult or bonus
G.hand_highlighted[2] either mult or bonus
G.hand_highlighted[1] and G.hand_highlighted[2] never the same
Get a random joker and card:set_edition('e_modprefix_key')?
exactly
wait i think i know how
just how do i target one of your random jokers
pseudorandom_element(G.jokers.cards, pseudoseed('random'))
its G.jokers.cards got it
thank you
i need to just study the game objects lol
so how do i add multiple lines of text in the json?
Add more text.
i can just say
if SMODS.has_enhancement(G.hand.highlighted, {'m_mult', 'm_bonus'})?
No.
i can't see how thatd help at all
ofc i wanna add more text
but how
oh then nvm😭
can i make something similar to it?
You press the keys on your keyboard.
..
as you add more text it will automatically make more lines
alright
So it essentially requires credit card to be functional?
Rental?
thats the problem
i was gonna add more jokers that allow you to get into debt
fwiw it may not stay in
It's generally (with some exceptions) bad design to create an ability that relies on another ability when that ability is rare or extremely conditional. It is generally better to design around ubiquitous mechanics
Then put it in a new tab?
i want to try to make debt more ubiquitous
I think jokers are not the best way to do that
i've made a joker very similair to what you've done here. for me it made it way more useful if the joker allows you to slightly go in debt already, like $5, so maybe try adding that?
Just because of the cursed design problem of the variance of the joker pool
That makes a lot of sense
why didnt i think of that
and it makes the joker a lot of fun to use haha
i need to start working on this fucki n mod EARLIER in the dyay when i can think criticaklly
farming debt on the tooth was an experience
wow it really is
is there a generic SMODS.has_enhancement that just checks if a joker HAS an enhancement
not a specefiuc
"description": "A description of your mod.", // [required] ! To use more advanced typesetting, specify your description as a localization entry at G.localization.descriptions.Mod[id]
tryint to code a spectral to apply an enhancement to a random joker that does not already have an edition
Use
next(SMODS.get_enhancements(card))
does anyone even know what i mean. i just want to add multiple lines to the description like how you can press enter normally in stuff
would it return nil or none
crash when my blind is on screen
you can't not without making a loc entry
SMODS.get_enhancements(card, extra_only) returns all the enhancements a card has, so if it has none it would be nil? idk never used it but it may be useful haha
unfortunanlty i havent messed with those yet
thank you!
The lack of newlines in the description field has been discussed many times before iirc
@daring heron
but you can do it in a loc entry
how do i do that then
you create a folder called /localization/
I mean without the /
in the folder for your mod
and make a file called en-us.lua
(or altneritvely default.lua. I've seen both be used
like this?
yes, but please stick to lowercase for all the folders inside your mod's folder. It's not technically nessacary but lua is case sensative, as is every OS besides Windows, so things can get weird
and you can just forgor what case you used
the mod folder being capital is fine
also same with the filename for default, that should be lowercase. idk if it needs to be because windows is strange, but that's how it is officially in the code
do i need to lowercase the pngs too?
that seems to be the way that people do it, but you'd also have to make sure your code asks for them in lowercase too
okay, and then what do i put in the default.lua?
gimme a second to figure that out, lol
alrighty
lowercase please
https://github.com/Steamodded/smods/wiki/Localization
here's the docs if you wanna figure it out with me
I already told them, lol
this breaks on jokers i think
how would i figure out what editons a joker has
Jokers don’t have enhancements
edition is not the same as enhancement
Can you tell me how to put your color in loc_vars?
enhancement = lucky, bons, mult
edition = polychrome, foil, holo
if card.edition then return card.edition.key end
many ways! heres an example
theres a list of colors somewhere on the wiki
read this page https://github.com/Steamodded/smods/wiki/Text-Styling
but do the {C:color}{} thing
there are all the colors you ever need
valid?
I know that, there is some way to move it to {V:1} I'm not quite sure how.
oh i see
No, if not joker.edition then
Would this be the correct code?
loc_vars = function(self, info_queue, card)
return {
vars = {
colours = { HEX("#FF00FF") }
use = function(self, card, area, copier)
local used_tarot = copier or self
local cards = G.hand.cards
--Flip cards
flipAllCards(cards)
--Make them stone
transformCards(cards, G.P_CENTERS.m_stone, nil, nil)
--Grab a Random Joker without an edition
local jokers_without_enhancement = {}
for _, joker in ipairs(G.jokers.cards) do
if not joker.edition then
table.insert(jokers_without_enhancement, joker)
end
end
local joker = pseudorandom_element(jokers_without_enhancement, pseudoseed('random'))
--Roll for initiative
if joker and math.random() < G.GAME.probabilities.normal / card.ability.extra.odds then
joker:juice_up(0.3, 0.5)
joker:set_edition('e_frover_iridescent',nil,true)
play_sound('frover_iridescent',1,1)
else
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
attention_text({
text = localize('k_nope_ex'),
scale = 1.3,
hold = 1.4,
major = self,
backdrop_colour = G.C.SECONDARY_SET.Tarot,
align = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK) and 'tm' or 'cm',
offset = {x = 0, y = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK) and -0.2 or 0},
silent = true
})
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.06*G.SETTINGS.GAMESPEED, blockable = false, blocking = false, func = function()
play_sound('tarot2', 0.76, 0.4);return true end}))
play_sound('tarot2', 1, 0.4)
used_tarot:juice_up(0.3, 0.5)
return true end }))
end
okay so help me out here
setting used tarot to "self" but self is nil
literally fucking now
juice up crashes my game
Always use card unless you're hooking vanilla functions.
Would this be the correct code?
loc_vars = function(self, info_queue, card)
return {
vars = {
colours = { HEX("#FF00FF") }
you're missing a lot of closing curly brackets but besides that yes
it WORKS!!! thank you chat
You could use the unknown function SMODS.get_edition_cards(G.jokers, true)
Thanks, I'm gonna go try it
did you figure it out at all? sorry I got distracted
not really, it's okay lol
descriptions = {
Mod = {
[your mods id] = {
'line 1',
'line 2'
}
}
},
misc = {
},
}```
I think this is all you need
does that look right @wintry solar
besides the terrible indenting
i did try and it didnt work
remove the one from your json file
oh I see what I did wrong
Is there an effective way to have a joker change the hand recognition(similar to four fingers?), so like, if i have this joker, two pairs are considered full house or something like that
edited
you want to take_ownership of PokerHands for that
preferably with a hook to only modify the original logic instead of replacing it
gotcha
still didnt work sadly
I haven’t used the loc file for my mod descriptions
yeah I must be parsing "G.localization.descriptions.Mod[id]" wrong
all it says is put a loc entry there
no more info
just figured you might know because you're pretty involved in smods development and were around
If cebee can send their code I’ll be able to sort it out
@daring heron
I think it's the header json and loc file that are relevent here?
loc file was just the one you sent me
Question: How do I make so it says +1 consumeable slots instead of joker slots?
{
"id": "extradecks",
"name": "Extra Decks",
"display_name": "Extra Decks",
"author": ["CebeeDrawz"],
"description": "Extra Decks - Adds a multitude of new decks to the game",
"prefix": "extradecks",
"main_file": "main.lua",
"priority": 0,
"badge_colour": "8389dd",
"badge_text_colour": "fffff",
"version": "1.2",
"dependencies": ["Steamodded (>=1.*)"]
}
this is the json
did you fill in your mod's id?
idek if that's what that means in what ti says to do, but it's worth a try
as is removing the desc here
but I'll let eremel take it from here because he actually has a clue what he's taking about, lol :3
pweaxe?
uh... negative consumables are in the base game?
so the desc should be fixed for them already?
e_negative_consumeable
And the loc file please
tried with G.P_CENTERS.e_negative. key does not exist
I think it's you set the edition to e_negative_consumable instead of jsut e_negative
No
I tried.
Haha
Shit does not appear.
I don’t remember exactly how to change it, just search the game files for that key
You need to set the info_queue to {key = 'e_negative_consumable', set = 'Edition'}
dis?
Add _consumable to e_negative
Literally the next line
?
Oh that’s your file
Yes
Yeah add the _consumeable now
dis?
Yes.
Missing an e
?
Thunk pls
?
maybe you are missing something
so from what I'm getting, the keys for the loc entries are the same as for their respective editions, but negative_consumable of course isn't an actual edition but is just an alt text for if it's on a consumable?
couldn't thunk have used a dymanic description? lol
info_queue[#info_queue+1] = {key = 'e_negative_consumable', set = 'Edition', config = {extra = 1}}
I mean that’s straight from the game code
I mean.... it's literally the code that's already in the game for the same purpose
it's not rocket surgery
for me it is. brain is smol and dumb
oh same tho, I just mean how eremel knows is because that's how it is in the game
@daring heron looks like you're still online, are you gonna send your loc file for eremel so he can help you? I know it's basicaly what I aleady sent but it's helpful to have it exaclty
when lovely patching, do I do it for the lovely dump, or for the base game code?
I mean the lovely dump insludes any number of mods
unless you're just playing vanillia, in which case I think it's nearly identical
you match with a pattern, so line numbers don't matter
so the base game code I'd say
well rn I'm looking at the dump vs base game code and they are different, even with just steammodded
Do it for the lovely dump.
ok that makes sense
It depends on the patch priority though.
how exactly does that work
bump
actually I should really go to bed
Oh yeah smodded ofc
