#đ»ă»modding-dev
1 messages · Page 368 of 1
Ah sorry, I meant main
You may have to do some research to see if you can disable smart quotes
Or just as a test try copy pasting a straight quote everywhere you see a curled quote
should the keys be red when done properly
What do you mean red
That looks right
The colors are a little different for me but that seems like it's actually picking them up as strings now
so this one is the phone's fault, brb to fix that
sometimes when i use this G.FUNCS.discard_cards_from_highlighted, the game just doesnt redraw the cards to fill the hand size
alr hold on it froze when i tried to start the game, rebooting
how can i make a custom rarity btw?
why does this still retrigger
do i need to do anything special to have my tarot card appear in packs or will it do that by default
ok it shows up by default
grafics...... desigmn,..
i was originally going to use this image for the nate joker but i found the little sprited nate to be funnier
Oh yeah if youâre coding on mobile they use quotation marks that arenât correct when interpreted by lua
Like joker retrigger?
yeah that was the issue, changing the quotation marks fixed it, now how do I set the can_use on the tarot to only return true if the should_apply for the sticker is also true
actually i can probably look at the cryptid code for that one huh
yup got my answer from there
yea
alr
how i can make this retrigger (as in joker retrigger)?
As in when it doesnât trigger it tries again with extra retriggers or that if it was successful it creates more when it retriggers?
if you hit the 1 in 4, it triggers twice
Probably something like checking for the retrigger context and just giving the consumable, it should only count as having triggered if you hit the chance initially
does anyone know all the rank ids of the played cards?
oh, what if i put 'or context.retrigger_joker' after the chance check?
2-14
after 10, there's 11 - jack, 12 - queen, 13 - king and 14 - ace
Yeah that should work
is there any guide that tells you how to make your own "soul" style consumable? by this, I mean, having a custom rarity, then, having said custom rarity only show up via a custom consumable which makes them
this would be my first real consumable btw
this is what I have so far btw, just the skin of a rarity, really
Hey, just to check, there isn't a straightforward way to make a tag impossible to copy even by other mods' tags right? For example cryptid's triple/quadruple/quintuple tags.
not gonna ping bc i dont need an answer from any specific person, but starting on the second half of this and wondering if this looks right
added more
Probably stupid question but did you enable joker retriggers? It's an experimental feature
of course
bump
Can you show your sound implementation? Both the creation of the Sound object and the usage of it
hey does anyone know the color for xchips in steam modded, or where that might be listed in the smod wiki?
First off, I don't think it's the sounds causing the problem, but I can't find the line that's crashing in the vanilla code because of all the injects on my end. Secondly, this would not function in your intended way, as joker_main check would never go off due to local booleans being reset every calculate call, and your loop would stop as soon as one of the criterias are met due to the returns
all colors should be in the text stylings page but it should be G.C.CHIPS
I'd want to make this card into a spectral and have it appear in spectral packs, but I am not yet sure how to do this
y'know, I don't know how I missed the text styling page lmao
I blame it on not wearing my glasses
if anyone knows what the thingies are on the blinds then uh, idk. you can have a slice of cheese or something.
Is there any example anywhere of a Blueprint Joker implementation?
Check the vanilla code
https://github.com/nh6574/VanillaRemade/blob/main/src/jokers.lua check line 3870
How does the code look?
updated it but i'm still getting the same card.lua error
Do you have access to vanilla code?
You need brackets around the chance check
i'm not using vanilla, i'm just using steammodded
Go to mods/lovely/dump and open card.lua. I wanna see the code at line 4905 since thatâs where the crash is happening
When do you get the crash?
whenever i start my current run i'm using to test stuff, the game itself opens
Oh, you set active to 0 and then check if itâs not zero
Donât continue a run, always start a new one after changing code
Try starting a new run
Yeah starting a new run is probably your fix
before i impliment ANY jokers. i want to implement the yo-kai tribe system
iâve been saying this before but i want it to be a seperate variable i can slap onto any joker
another 'or retrigger' fixed it
the problem is that i donât really know how to make a new variable entirely
okay, good news: no more crashing but it is Not working how i intended đ
how many tribes are there
if there are not that many you could make ObjectTypes
i have 9 tribes that i want to impliment from yo-kai watch. brave, mysterious, tough, charming, heartful, shady, eerie, slippery, and wicked
iâm not including enma and wandroid because those two are very niche and donât really fit balatro
Like I said, your loop will end early due to your method of returning. Also your booleans will still reset before joker_main rolls around. Iâd say handle that tracking within joker_main and handle the sounds within a context.individual check
realistically iâd want them to have their own badge that goes onto the joker right above the rarity
can i do that actually?
how would I make a joker that adds +1 Shop Slot WHILE in said shop?
basically, like, a freebie, I guess
idk
maybe I should think on this more, lol, idk what'd be best here balancewise, lol
you can take ownership of each and give them a badge but it would probably be easier to do some kind of patch
actually, I think I have an idea here, hehehe
good schmorning modding crew
what are the weights of the base game rarities btw?
thats my goat N right there
who the heck is dat
crispy, she commits arson <3
set_badges = function(self, card, badges)
badges[#badges+1] = create_badge("texthere", backgroundcolor, textcolor, scale)
end
anthropormophic pretzel creature <3
arson is not healthy for longevity
i would patch the part of G.UIDEF.card_h_popup that add badges and use some function like get_card_tribe(card) to add the corresponding badge
there are multiple ways you can tag the cards tho, i dont know which specific one would be best
i would probably make a table of all the cards with a tribe for each in a file and then after hook some function that runs after all mods load that adds a field to each center called yokai_tribe = list[key]
but that's the first thing that comes to mind
yo-kai medals are different from the usual consumables so there probably WONâT be a spectral yo-kai medal
unless.
make them better than spectrals, make them ethereals
for this joker it is supposed to check the playing card and if it has enhancement in geneneral it seems to be not working and adding xmult for scoring
it just adds +.1 xmult for each enhanced card in scoring hands
so right now it adds +.1 for each enhanced card, but you want it to be +.1 if the hand contains an enhanced card
is that right?
that's not how you check for enhancements
yes scoring hands
oh really? i used it for checking specific enhancements just thought u can do for pool
next(SMODS.get_enhancements(card))
it's only for specific ones
Hey, where and how do I begin modding, and is there some documentation I can find to help me?
ah damn ok i wasnt sure L
check the last pin in #âă»modding-general
- Don't use context.individual for this (otherwise the code will get run for every card you play)
- Check context.scoring_hand, not G.play.cards (G.play.cards includes unscored cards)
- Use N's suggestion for checking for enhancements
yea good call full hand is prob the way to go thank you đ
I would also suggest looking at this repo to see some practical examples of how to use SMODS to recreate vanilla effects
https://github.com/nh6574/VanillaRemade
(shoutout N)
this what u mean?
context.before is probably best
what's the difference between SMODS.Consumable and SMODS.ConsumableType?
consumable is like a single tarot card or spectral card. ConsumableType is for creating an entire new set of consumables
oh a got it right so
thanks chase
where's the doc for SMODS.ConsumableType? I didn't find in Git
oh it's in ObjectType
thanks again Chase
It's possible making a text Italic with TypeStyling?
did I mess something up here? the rarity isn't displaying correctly :<
it's showing up as a white backed "ERROR"
is straight detection hardcoded to account for shortcut? how can I make a joker do the same thing as shortcut?
check four fingers here
https://github.com/nh6574/VanillaRemade
saw this, but the code confuses me
what is the double not?
also, would this not potentially break if another mod does the same thing for its own shortcut-type joker
yeah it would, you would need to probably patch get_straight to not break
next(table) gives you a value not not next(table) turns it into a boolean
ahh okay
* you need to patch the get_straight override in smods, not the original
yeah I work off of the lovely patch dumps
yeah but the original isnt patched
oh wait is get_straight redefined in utils?
oh wait this one doesn't even look for the specific jokers
yeah it does what i do in the reimplementation and just takes ownership of the pokerhand
oh okay yeah I have to patch the poker hand part in smods game_object.lua
now I just have to remember how to patch smods files
the format is different, right
thanks
bump
how can i have it so that localization is completely disabled for a specific edition?
like a joker with a specific edition doesnt get localized?
the first argument of pseudorandom_element has to be a table like {"option1", "option2"}
like some sort of edition that forces your jokers to be in french?
yes
exactly
I've got 2 jokers (watching and stained glass) that use a shader instead of art and i can't figure out how to use just a shader without needing an edition so I'm trying to disable the localization for those editions since it's gonna be displayed on their jokers anyways
like this one
oh, so just swap out the parenthesis for brackets like this?
oh that looks sick
yes but you still need the parenthesis to give it the second argument pseudorandom_element({...}, pseudoseed(...))
so yeah either i need a way to display a shader on them without needing an edition or i need to disable the localization ui for those specific editions
you can use draw or a DrawStep for that I'm pretty sure
I've tried to make one multiple times but they've either done nothing or have crashed
like this
never did anything with shaders but I know Hologram uses one in the base game
do i need to add anything afterward or is this fine as is
that looks fine
(that's from the invisible joker code that i copied for this) https://github.com/nh6574/VanillaRemade/blob/ce4bad70093be5d28ef45c407178e418176c5a5f/src/jokers.lua#L4413
like this?
yeah
head to line 106 of sprite.lua
??? okay
patching '=[SMODS _ "src/game_object.lua"]' crashes lovely, saying that it isn't a valid path or whatever
but patching '=[SMODS _ "game_object.lua"]' does nothing
what is the right method here?
I finally fixed this by hooking SMODS.calculate_individual_effect instead of using func
oh it might need to be modprefix_shaderkey
THANKS
first one works for me
here's the full patch
also if you're doing an 'at' patch there's no much difference from the take_ownership thing
do I have to patch the entire line in order to do that?
the idea is that the patch still contains the original pattern, so anyone patching that pattern would still be able to patch on top of this as if it didn't exist
yes, you can maybe use regex to not overwrite it completely but idk
but anyone else would have to sidestep your patch too
that's why i said it was probably better to patch get_straight
would I just be setting skip to 1 in the get_straight function if the joker is owned?
skip is a boolean so just skip = skip or not not next(SMODS.find_card(...))
you probably hook too
i probably should get to doing this before i actually impliment the jokers
oh right it's a bool, okay yeah
like, actually implementing the tribes
when i made my mod i did all the yugioh type stuff beforehand too
so all the tribes should be like, a seperate object type, right?
so the shady tribe would be its own seperate object from the heartful tribe
yeah, objecttypes are more like lists of objects most of the time
i would look into how mods like cryptid do the food jokers
if the joker is a part of a specific tribe itâll have a tribe badge
if itâs not a part of any tribe then itâll just have no badge
i just impliment all the tribes and then apply them to all of the basegame jokers
just have one big âvanilla.luaâ for all of the basegame jokers and their tribes
okay wait, this is still crashing lovely, what?
is there a way to check the current ante in the code?
If I'm trying to make a joker that copies the ability of adjacent jokers, is there a better way to do that than merging their effects into a single table?
G.GAME.round_resets.ante?
Pro tip! os.exit() just closes the game! Dont know if youll ever need this, but its good to know!
still have no idea where to start in terms of actually making the tribes real though
all i know is that theyâre all gonna be seperate object types
Check the current Ante number
Yes, that's what it is?
I've arrived.
what's the error
Need a little help: I have a card here that causes retriggers lucky cards, and I want to juice/flare it every time the lucky card is retriggered. However, although I have a good place to trigger the first visual (in time with the 'again') text, I'm not sure the best way to add it on each successive instance
this looks similar to the outdated lovely error but idk what it means
What I do right now is just call the visuals on the consumeable before returning from the repeititon context
G.FUNCS.csau_flare_stand_aura(card, 0.38)
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
blocking = false,
func = function()
card:juice_up()
return true
end
}))
return {
message = localize('k_again_ex'),
repetitions = gold_count * reps,
card = context.other_card
}
end```
I guess I'll try updating lovely?
key = 'Odysseus',
set = 'Homerus',
atlas = 'Homerus',
pos = { x = 0, y = 0 }
loc_txt = {
name = 'Odysseus'
text = { 'Retriggers the first {C:attention}King{} played',
'after using this card the number of times',
'equals the current {C:attention}Ante{}',
'{C:inactive}s"What if I the Monster?"{}'}
},
config = {
repetitions = G.GAME.round_resets.ante
}
function use (self,card, area)
if context.cardarea ==G.play and context.repetition and context.other_card:get_id() == 13 then
return {
message = localize('k_again_ex'),
repetitions = self.ability.repetitions,
card = self
}
}``` Is this code right?
okay yeah updating lovely fixed it
Basically "Retriggers the first king played same number of times of the current Ante"
hi bestie
Hello!!!!
how are you my friend
Doing decent!!
:D
how do i make loc_vars in my SMODS.Consumable so that when something else changes the variable, it also changes in the localization file
#1#?
finally done with this for the time being :3 It's part of @willow plinth 's reimaging of elbe's card exporter, but I decided to take the shader thing on. I ended up reimplementing the relevent draw steps and sprite draw routines, lol
most of the code is directly ripped from smods and the base game, just adapted for rendering off screen
return {vars = {variable}}?
like this? (rest of the code is below this
have a separate context check for whenever any card is scored and check if it's a lucky card, and just do the animation then
No? return {vars = {variablelocation}}
this will set extra.repetitions equal to the ante when the consumable is created, not the ante when it's used
Using the individual context doesn't time it with the 'again' text unfortunately. It plays after, during the chip scoring
??? thats different from what you first said
Hmmm How can i fix this?
my first instinct is to append extra tables for each repetition individually with each calling the flare function
Does that time them in the event queue correctly?
That doesn't sound right, admittedly
don't store it in extra at all. Just return repetitions = G.GAME.round_resets.ante in the calculate function
oh
return {vars = {variable}} is not the same as return {vars = {variablelocation}} not that i understand what you mean either way
You also can't use extra tables in the repetition context without getting a warn (which may be completely benign obv if you don't actually have debug tools)
im pretty sure aure fixed extra tables in repetition at some point recently
what he's saying is that you should put the name of the variable in the innermost curly braces
Wixard, the vars table in the loc_vars return table is an array of values. You pass in the number of variables you want, and then you reference them in the localization text using #1#, #2#, #3#, etc, where the number is the position in the passed array
I should update SMODS so let me try it
recently might have been like 3 months ago tho im bad at time
yo, how does copying vanilla jokers work? since they don't have a calculate function I'm not sure what I should use
like blueprint, yeah
Also they technically do have a calculate function, in the sense that all jokers call the vanilla Card:calculate_joker() function, and just go through the vanilla logic if it doesn't find an SMODS calculate function and return early
ah okay, cool
Otherwise you kinda just have to copy the blueprint logic, which is, uhh, this whole thing
a lot of vanilla jokers (all of them maybe?) have been adapted to the SMODS way of doing things
https://github.com/nh6574/VanillaRemade/blob/main/src/jokers.lua
there's a helper function in smods for this
Definitely not all of them. Some specific jokers are overwritten, but SMODS leaves a lot of them vanill as possible
How can I determinatecan_use(self, card) for only when a round is being played?
Dang that would've been good to know like a month ago. Classic SMODS experience
i love undocumented functions
documentation is optional
like, inside a blind?
yes
G.GAME.blind.in_blind
thanks
this is the rest of the card code, what would i put into the vars table to make it so that when the card code is changed by another card the variable also changes
Me: G.GAME.blind and G.GAME.blind.name == G.GAME.round_resets.blind_choices["Boss"] 
I'm not sure how the card code can be changed by another card given what I've seen here, but typically you store relevant variables for consumeables inside the config table
ah so i gotta redo that then
the plan was to have a joker somewhere else in the mod that doubled the effects of all tarot (including the one im working on rn)
So yeah you'd store a value in config or config.extra, and then you access it via card.abillity or card.ability.extra in the loc_vars function
Is the relevant number the highlight count?
yeah
So in your consumeable defintion, you would have
extra = {
highlight = 1
}
}```
And then in `can_use` and `loc_vars`, you call `card.ability.extra.highlight` when you need to compare the number of how many can be highlighted
However, in `use`, you'll need to make a for loop to loop through all the highlighted cards rather than just applying to a single one
Hey, good question.
This almost works, but the timing is too late đ
damn
how would i do that second part
It's so close
also, does this look good in regards to the first part of what you said
You'll want to also check for can_use that it's between 1 and your highlight limit. For example in the vanilla game, you can highlight only one card with Hierophant to apply the Bonus enhancement to
And you don't need to check for it twice btw
Curently you're doing the same check twice in a row and returning if both are true (which will always be true)
its two different checks that i copied from Cryptid's Global card
oh wait I see the second checks for consumeables
Hmm then you'd need to also highlight the same amount of consumeable which is not what you want
Genuinely I don't think you need the latter check
so would the consumable check always be 1
ill just remove it
Hey has anyone got a moment? otherwise I'll wait.
if the removal causes problems ill add it back in
Basically, whenever can_use is called, it's when the consumeable itself is highlighted
In which case, the number of consumeable highlights will always be 1, because you can't highlight more than one at a time
-- your code goes here, 'v' is the card you need to apply the sticker to
end```
Feel free to ask, someone will likely see it or if not, you can just bump later
what goes in the blank
your same sticker appliation code that you're already using
Alright, Apperently the playing card mention being "copied" didn't work,
Firstly let me show the code:
Waht it's supposed to do is copy a random playing card effect
But when you pass in card to apply, you use v instead of what you were using before
@shut crater This is the issue.
Try with cards with editions and seals and enhancements.
Well the desrciopion of this joker I found online was this: "Copies the Effect of a Random Played Card Per Hand"
I thought it was just more than seals
would it be like this
Nope
Oh, that's what you meant by "the blank"
The underscore is used to basically "exclude" a key or a value from an iteration
It just means it's unused
You literally put the underscore there _
Try doing this:
local eval, post = eval_card(other_card, context)
if eval.playing_card then
for k, v in pairs(eval.playing_card) do
eval[k] = v
end
end
return eval
``` `other_card` being the card.
like this?
You're only storing the id (numeric rank) of the card in your array, not the whole card
for _, v in ipairs(G.hand.highlighted) do
You have the do way earlier, it would give you a compilation error
fixed that
otherwise it's alright?
Also you need to call :apply(v, SMODS.Stickers['hmlt_br_st'].key), since it's a function
Erm, wait, that's wrong
I think maybe you just pass in 'true' as the second argument?
I'm not as 100% on stickers as I am on some other stuff, they're a bit weird
from what's been told to me they act the same as seals
so whatever code is applied to seals also probably applies here
in any case do i need to do this
do :apply(v, true)
like this?
Think so
no comma after apply
alright I'll try this out.
sorry for the delay
and then in loc_vars it would be like this?
oh because its in a function right?
Yeah, commas are for table declarations
no, because it's a statement
Yes, but also you need to store the cards themselves, not the ids.
in either case is this the right way to write this or do i need to add anything else
i cant test it for another few hours, so will update when i can
Ah, hrm
How do I arbitrarily nest tables within tables?
Smth smth recursive function here
this is how i do my extra table concatenation https://github.com/nh6574/JoyousSpring/blob/40e7f90f4a6b0e8db15fed29f43f08d6b2e34065/src/effects.lua#L492
t["value in origin table"]{ "some stuff", "more stuff", "etc" } (taken from a random stack overflow post i saw when i googled the issue)
No, I need to do it at arbitrary depth depending on a variable
Which is more complicated
and how is it possibe for this?
card_select[i] = context.full_hand[i] not card_select[i] = context.full_hand[i]:get_id()?
something like this
local table = {}
local recurse_table = table
for i = 1, depth do
recurse_table.extra = {}
recurse_table = recurse_table.extra
end
return table
alright I did that but somehow it didn't work not sure if I did the code right like this:
not sure if I needed to start a new run
You do.
local recurse_table = return_table
for i=1, gold_count * reps do
recurse_table.extra = {
func = flare_func,
message = localize('k_again_ex'),
repetitions = 1,
card = context.other_card,
}
recurse_table = recurse_table.extra
end
return return_table```
ok.
Like yes I do understand vaguely how this works but ughhhhh reference tables hurt me
It shouldn't be as complicated as it feels trying to wrap my head around it
this worked fantastically. the only problem I have now is trying to get the joker to display whether or not it's compatible with other jokers. In the vanilla remade mod, it displays it in it's loc_vars, but I also noticed it doesn't include it's joker description, or loc_txt at all for that matter. how does it display in the joker's text box?
yeah
You need to return eval not post.
oh.
it uses main_end which displays it at the end
for the rest it uses a localization file instead of loc_txt
The Blueprint compatibility badge is done is in the Card:generate_UIBOX_ability_table function in vanilla. In modded, you'd return main_end in the loc_vars return table roughly similar
ahh okay, would a localization file be worth making?
got it, thanks
main_end = (self.area and self.area == G.jokers) and {
{n=G.UIT.C, config={align = "bm", minh = 0.4}, nodes={
{n=G.UIT.C, config={ref_table = self, align = "m", colour = G.C.JOKER_GREY, r = 0.05, padding = 0.06, func = 'blueprint_compat'}, nodes={
{n=G.UIT.T, config={ref_table = self.ability, ref_value = 'blueprint_compat_ui',colour = G.C.UI.TEXT_LIGHT, scale = 0.32*0.8}},
}}
}}
} or nil```
depends, some people like having loc_txt although eventually you might come across something you need a localization file for
and it's easier for localizing
Do you only want it to copy the chips? (Also jacks give 10 chips?)
I believe Blueprint/Brainstorm's self.ability.blueprint_compat_ui value is set in Card:update and it just checks every frame (which is bad, you can do it much more efficiently than vanilla does it)
that's what I thought if any.
in what case would you need a localization file? as opposed to just loc_txt?
for this it's indifferent
Personally I use localization files because I find it a little easier, but whether or not it's easier depends very heavily on how decentralied you want your information for certain things to be
if you need to localize a message you need a loc file as well as some objects that don't allow loc_txt
Ultimately I think they're better if you have multiple localizations
Plus yeah, for a number of things, you'll need to put arbitrary loc strings such as in the dictionary table which isn't item-based
(also the jack chips number was a typo)
Then you would just do ```lua
if context.joker_main then
local copied_card = pseudorandom_element(context.scoring_hand, pseudoseed("seed"))
return {
chips = copied_card:get_chip_bonus()
}
end
like replace all the code with this?
or an area of the code?
Everything in calculate
alright.
I realize you said you're already sold but for example, we use localization files for a bunch of assorted flavor callouts that cards do when activated as well as hold all the text for custom badges since it's the best centralized location for it
I replaced everything in calculate with that and it gave me this:
You've got a syntax error. Check your code, it should appear red around where it's missing a brace
That's only if you have the lua extension.
alright one moment
Hm. Now I'm getting an error saying a return table for this doesn't have repetitions in it.........
oh wait I see
this.
I think the the topmost table in the nest doesn't have it
You're calculate is missing an end
ah.
how can i get this button to actually be clickable? here's the code
Now it did work!
But theo nly thing missing is getting thep laying card to display "Copied!"
Is this possible?
Then again thanks for the most part.
Whelp, triggering this after the Again text is the best I've got
I guess that's alright
Add SMODS.calculate_effect({message = 'Copied', colour = G.C.GREEN}, copied_card) before the return.
i think the UI for the tooltip doesn't have the property for that
it should be something like .states.clickable
THAT WORKS! Now let metry torecord
to see the result
so i should move the button code to a local, set its clickable state to true, and then use the local instead?
maybe that works? I don't know if the whole UIBox needs the property too
Thanks @daring fern ! now it works!
trying the discord/twitter buttons approach used in the main menu and it still isn't working
could it be because this is inside of the localization UI?
yeah that's what I was saying, I think the whole tooltip is not clickable
đ
OHH
oh that makes sense
you might be able to add the property tho
i think card.ability_UIBox_table.states.click = true might work
What am I doing wrong?
lemme try that rq
you might need to do it in a hook tho, loc_vars might be too early
pool doesn't exist
How do you do it right then?
would putting it into the update function maybe work?
yeah sounds right
idk never used pools
what do you want to do?
When the Joker appears, the chance of rarity increases
i think it should be G.GAME.fut_heroic_mod =
And that's it, just like that?
you also need the modifier you want after the =
I need default_weight = 1
huh, it's definitely sped up. I still think 60 frames at 20fps is a good idea, just gotta put the right value to add to G.TIMERS.REAL and G.TIMERS.REAL_SHADER. I just realized what I did wrong
I think it's the compositing I did wrong
I did one frame every 5/100 of a second instead of 1/5
the patch here updates shaders in real time without being too fast, if that's what you're looking to do
but I did properly advance the timers by 1/20th of a second every frame
the shader already gets sent the 'real' time in other places? Shaders are programmed around the time parameter being static
i remember messing with those for jokerdisplay
this doesn't work still
just updating the timers works to animate shaders in my experience. I just gotta update them right, lol
right, and the patch i linked makes it so that ALL shaders update time in real time instead of being static
which seems like it'd cause unexpected behavior ngl
I'm curious if it looks weird
i mean my mod has like 23 shaders and that use time and they all work perfectly
(these are the shaders which use time the most)
yeah this doesn't work either
yes, but it was definittely doable without a patch like that, or if you did do a patch you shoulda done it like betmma
It's not working
where itonle applies to their shader
if i wanted to do it like betmma then i would've done it like betmma
i want ALL shaders to update in real time, not just mine
because otherwise sending the time is pretty much just useless
is it crashing or does it just not work
how does that work
so your mod arbitrarily changes how shaders that aren't yours animate? I don't love that
It just doesn't work.
how are shaders supposed to animate in the first place if they don't animate at all đ
oh then idk
anyway, here's the tentacle shader at the proper speed
I want my Joker to increase the chance of other Jokers falling out, how can I do that?
because with the base implementation they don't update unless they get redrawn, otherwise they're just completely static
because normally you can't hover over a tooltip
they.... do though? as I said there are other shader:send statements that give them the time, in some form
forcing tooltips via a lovely patch
I was right, the frames were correct, I only needed to play them back right
they do not get sent the actual time
they are static
I wonder if there's something invisible over the tooltip that stops you from clicking on it
hi, i want to do a function like is_face(), this make sense? ;;
function Card:is_stone(from_boss)
if self.debuff and not from_boss then return end
local id = self:get_id()
if SMODS.has_enhancement(context.other_card, "m_stone") then
return true
end
end```
wait actually that might be the case
what's your goal?
how do i check if a card is unenhanced? is it just SMODS.has_enhancement(context.other_card)
not next(SMODS.get_enhancements(card))
No, not next(SMODS.get_enhancements(context.other_card)) I think.
nvm i guess
Something reacting with something other than đ€
quantum enhancement stuff
still don't know what a quantum enhancement is lol but i see why that check works
sorry I forgot that only vortex gets sent the time usually
I have been looking at that code for days
you're good
I want to check is a stone card is destroyed
if removed_card:is_stone() then stone_cards = stone_cards + 1 end
end```
it's a lag generation machine
and why don't you just check with has_enhancement directly?
I want my Joker to increase the chance of other Jokers falling out, how can I do that?
that entire patch is meant to make it so that all shaders get sent the actual time, therefore making it so that all shaders actually get animated instead of just being static
is more to learn how to create functions with lua
i mean the function definition was correct but the logic inside doesn't make sense, you also never want to make a function for something that already has it unless you really don't like the syntax
consider making a function when your code is like >3 lines and repeats in various places
ohh okay
so the function look like this?
for _, removed_card in ipairs(context.removed) do
if SMODS.has_enhancement(context.other_card, "m_stone") then stone_cards = stone_cards + 1 end
end
yeah
I have a problem with the logic of the calculate, when a stone card is destroyed gain chips
local stone_cards = 0
for _, removed_card in ipairs(context.removed) do
if SMODS.has_enhancement(context.other_card, "m_stone") then stone_cards = stone_cards + 1 end
end
if stone_cards > 0 then
card.ability.extra.chips = card.ability.extra.chips + stone_cards * card.ability.extra.chips_gain
return { message = localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } } }
end
end```
does anyone know how to accomplish animated gif encoding in a mod?
like taking png data frames from love and encoding a gif
I've got a thingy that converts mp4s to spritesheets that you could use along with a game update hook
could probably make it also work with gifs
i'm doing this well well out of game, lol. just making a gif from images arended on an ecternal canvas by the game
looks fine to me, what's the issue?
this is the opposite of what I want
out of game but with the game engine
oh i misunderstood đ
if that makes any sense
so, uhm, turns out, yet another problem exists with iridescent joker, lmao đ
so, the thing is, uhm, it didn't remove the effect on remove, before, so I uh, I tried to add a remove from deck effect, and with it, I also tried to turn something that used to be a local into a config var and now it's having all sorts of problems, I don't even know anymore đ
like technically I'm in a run, but all the output is off screen to files
say that te game crashed
ohh yeah sorry, it should be removed_card instead of context.other_card
i have officially given up on trying to add a button to go to the original shader and have instead resorted to doing this
ohhh, so i can put all the context card in things like that?
ty
is there a way to get a joker to do something every time a card is drawn from the deck?
i don't think that's what they were saying đ
yeah but it's funny
maybe make a hook on draw_card and make a new context?
lemme try and make one rq and I'll send a picture
i think you can use context.stay_flipped or context.hand_drawn?
like this
that would make sense, i don't know how to use hooks though. is there documentation in the smods wiki for them?
i beg of people to utilize snipping tool
context:?
inlay hints, sorry
me when i don't have Wi-Fi to be able to use discord on my laptop
what's the effect? you can probably use one of the blind contexts
this adds a new context that you can use to check if a card is being drawn
idk i don't think i can
context.hand_drawn can do that
is there a way i can get the amount of cards drawn by using context.hand_drawn, then?
they're trying to do it for every individual card drawn, not just checking for the entire hand
that gets called every time draw_from_deck_to_hand is
to return a message is only this?
return { message = localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } } }
i make my own dictionary to work but the message doesn't appear
dictionary = {
k_lucky = "Lucky",
a_chips="+#1# Chips",
}
context.hand_drawn is a list of cards during a blind, context.other_drawn is a list of cards when not in a blind
make a custom context for when any card is drawn, and make a local variable that increases by one every time it happens
then, have the mult update by 1 if that local variable is divisible by 4
this doesn't check if it is from deck
doesn't need to
??
they aren't trying to check for that though
i want it to work when ANY card is drawn, including from booster packs
that is a card drawn from the deck
i can try and make something like that if you want me to send an example
the booster pack doesnt use draw_card i dont think either anyway
oh so you are trying to check for that
hey, so when I'm returning whether or not the joker is compatible, I'm using:
return "{C:attention}compatible{}"
else
return "{C:inactive}incompatible{}"
end
end```
but this just ends up looking like the image I posted. do you know how I could make the color display proplerly? would I have to split the badge into two to do that properly?
oh do packs not use draw_card? hm
text styling doesn't work outside of loc_txt/loc file normally
damn, no way to do that then?
No, you can return custom text nodes to put colored text in badges like that
ok, let's try again
what do you consider to be drawn from deck? keep in mind your definition might be confusing to your players
any time a card from your deck appears on the screen
so that's during blinds, and during applicable booster packs (arcana, spectral)
oh, ok
then use context.hand_drawn
this is literally what the context is for
but that checks if the hand is drawn, NOT if an INDIVIDUAL CARD gets drawn
what's the difference if you have all the cards
for that effect there's no difference
if i were to use the hand_drawn context it would not return true 8 time if i were to start a blind with a hand size of 8
thoughts
yeah, there's other card effects in the mod where i'd want to evaluate each drawn card seperately
it would return true once with a list of 8 cards
too op
You could nest returns if you want individual pop-ups
in a strictly game design sense, it incentivizes uninteresting play by making the most optimal play the least fun one
but in a meme sense that's very funny
be funny if it was the other way on
I thought Cryptid modders loved taking a lot of time to beat a Blind
+100 chips, -1 chip for every seconds spent in this blind
I personally don't mind the idea of that, but I would probably never pick it up
unless it's literally ante 1
its op if you dont like having fun
the downside is that it wastes real life time if you want it to be good
I wonder if it would count those obscenely long calculation times people can have
Then its just a free shit ton of chips
I am a machine that turns typing into functional things 
(I just made another VanillaRemade PR lol)
Can you type me up a bazillion dollars
integer overflow, you now have -$50807134500809

ill have to try that
you can no longer send stickers and gifs (unless you send them straight from your files) here
hi dilly
hi why this message doesn't show up? all the joker works fine but the retunr message no
if stone_cards > 0 then
card.ability.extra.chips = card.ability.extra.chips + stone_cards * card.ability.extra.chip_mod
return { message = localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chip_mod } } }
end
Damn did I miss something
Mid
I'm only in this channel
same
This is where the cool people are
cool is a strong word
Nah
N is dope, bepis is dope, winter is dope, ice is dope, victin is dope, something is dope
hmm that looks fine to me but the formatting is messing me up
do you have to add card = card to the return? I'm not sure otherwise

/j
I fw u 2
We just haven't talked as much yet...
very honored to be listed here :p
My real life went to hell for awhile so ive been less active
But I wanna return large and in charge
Once my art is finished I'm finally releasing the first part of dilatro
I've been less elusive, but time zones are a thing so maybe we don't interact as much
what's the proper code to destroy a joker?
I'm convinced art is the hardest part of modding
Its cause of the chicken jockeys
Its been very easy for me because I just bribe my friends to do art since I am not capable
usually start_dissolve I think but I'm not at my computer so I don't have code in front of me
card:start_dissolve()
oh just that?
Yes.
can multiple enhancements be passed to enhancement_gate in a joker?
well probably not in that order cause the card will be gone
it already add the chips but the only not show is the message
or should i just use in_pool()?
No, because it can't take a table, I don't think.
Yes.
alright, thanks
try adding message_card to the return?
https://github.com/Steamodded/smods/wiki/Calculate-Functions#step-3-returning-effects
I would very heavily recommend using SMODS.calculate_effect instead of card_eval_status_text
alright
did you print out the localize function to make sure that it gives you a string and doesn't return nil?
I think you're right so idk
yeah, it doesn't show nothing
i need to add another thing ?
the joker works but doesn't show the message
chat help how in the world do I make this look better and actually like an origami heart
tf is a face stone card
look at how people fold origami hearts
the "face" is wrong but yeah, is only stone cards
also make it less neat
Anyone know why this might not be resetting when a card of suit "G.GAME.current_round.willowmod_jokeinthebox" is played?
calculate = function(self, card, context)
if context.before and context.main_eval and not context.blueprint then
local reset = false
for k, v in ipairs(context.scoring_hand) do
if v:is_suit(G.GAME.current_round.willowmod_jokeinthebox) then
reset = true
break
end
end
if reset == true then
card.ability.extra.x_mult = 1
else
card.ability.extra.x_mult = card.ability.extra.x_mult + card.ability.extra.Xmult_gain
end
end
if context.joker_main then
return {
xmult = card.ability.extra.x_mult
}
end
end
Welp, realized after typing it out.
why are you using such a complicated way of accessing the suit?
It changes every round, and this how I found it done.
so the suit itself at that location is variable?
yes
interesting
I essentially copied all the suit changing code from VanillaRemade.
how would i remove perishible/eternal/rental from a joker?
card.ability.eternal/perishable/rental = nil
I believe that's the way ancient joker handles having the suit change every round
and there is no simpler way to do it in SMODS
the simpler way is to do it individually by card
true
but it's a different effect then
and how would i check if a joker in the slots has this?
like
for the can_use function
I decided to reference Red Card for it and I think this looks much better yeah
is it random or do you choose a joker to apply it to
its rnadom
you'd have to iterate over G.jokers.cards
if you print G.GAME.current_round.willowmod_jokeinthebox before :is_suit what does it say
check each one for any of those stickers
for k, v in pairs(G.jokers.cards) do
if v.ability.eternal or v.ability.perishable or v.ability.rental then
return true
end
end
return false
```?
yuh!!
I already figured it out, I just needed to add .suit to the end of G.GAME.current_round.willowmod_jokeinthebox.
is that actual lua syntax with the slashes?
is it
as long as those are numbers you're dividing by :3
use = function(self, card, area)
local jokersyuh = {}
for k, v in pairs(G.jokers.cards) do
if v.ability.eternal or v.ability.perishable or v.ability.rental then
table.insert(jokersyuh, v)
end
local randomjoker = pseudorandom_element(jokersyuh, pseudoseed('YUH'))
randomjoker.ability.eternal = nil
randomjoker.ability.perishable = nil
randomjoker.ability.rental = nil
end,
would this work?
â
as that would be a waste of a consumable
can't you just store the suit object on the card's center?
a ref to it
or on the card itself rather
I don't think there's anything that stops you from doing that
the ability table perhaps?
if you mean the thing that ancient joker does
idk if this is similar enough to apply
yeah the problem is that it needs to be the same for all cards
you never want to save things that change per game in the center
but personally i just make all the effects individual so i dont need to do any of that
I meant the joker's ability table. like G.jokers.cards[1].ability.activesuit = "suit object"
yeah but that's not the same for a second copy of the card
then yes do it on the center?
I mean yeah you have to remember to change it back
but eh
you could do it on the center but I wouldn't recommend it because you need to reset it each game
there's a cool smods function for these kinds of effects anyway
how do you lovely patch another mod
technically (if I understand lua) you could put the suit in a table and store that table on G.GAME and also in the ability table of each joker and then because it's a table they would all be accessing the same object
can't it be an extra variable on the jokerthat you define in a way to ensure that it's the same per instance yet still random?
or is this back to the same complexity
'=[SMODS modID "file"]'
target = '''=[SMODS modid "locationtofilefrommodrootdirectory"]'''
ty
yes, everything is a table and you can store anything anywhere
from what i know
lua even lets you access the locals of other functions if you want
iy can be wild if you do it wrong
:P
it's in the debug library ofc, but balatro does include it
the point I think is that it's best practice to store global variables that change for each run in G.GAME
anywhere else and you need to remember to reset it yourself and that's a bigger hassle
yeah, I mean it's simple too
you don't have to do the current_round and give it a long name though
you can change it every round anyway
I just meant that I think tables in lua are shallow copies so the only way to edit a value in one place and have it update in other places is to use a table rather than just store the value directly in ability
but also this is a bad way of doing it
they are shallow copies, but suits are tables too
so you'd change the suit object
which is a table
directly
should i make a balatro pixel art font to make making consumables easier
oh wack
or if it isn't a direct reference to the suit object then it'd be wheever_the_suit_centers_are[suit]
instad of just suit
is there an easy way of testing if something is in the current pool? i'd like to make sure my in_pool function works without having to cycle through the entire shop or anything lol
long names are good
print(inpool())
or in the inpool funcrtion
have it print the variable
ban all other cards with the banner mod :3
How would I check if something is being added to the pool correctly other than just by rerolling a million times?
fair enough lol
ban all other cards with the banner mod :3
I've learnt a lot from fucking around with shader and draw stuff, it's dedintiely jumping right in
even if I was just copying vanillia and smods code and reimplementing it for the scope and purpose I was dealing with mostly
just adding more and more from SMODS.CardDraw and the sprite draw routines in the engine until it did the thing
lol
i never realized how convenient this is wow
i love banner
okay, time to, well, start coding
is there a way to directly reveal hidden poker hands
how would you guys recommend i reword this
i would replace "gains" with "and gains"
and the left card and gains
maybe a comma then?
or do
"destroy adjacent cards and gains"
thats most consistent with how other people word things ike this
for k, v in pairs(G.GAME.hands) do
if not v.visible then
v.visible = true
end
end
```?
does anyone know how I could check for vanilla jokers being blueprint compatible?
eval for k, v in pairs(G.GAME.hands) do
if not v.visible then
v.visible = true
end
end
works thanks
merge the left card into the right card
i mean technically in Inscryption they also combine the values of the "same card" so i suppose that isnt really what youre going for here
aye yo inscryption reference?
based
See merging wouldnt be very intuitive
Like
like if you gave the Mycologists a 2-2 rat and another 2-2 rat it becomes a 4-4 rat with whatever extra sigils they had
Does it mean just the chips? Can you stack enhancements/seals?
Enhancements yes.
Maybe I could just put it in an infobox
i mean... if the wording is "merge" it implies that everything's combining
if played hand is a Pair, merge the attributes of the left card with the right?
That's not how it's coded tho
Hmmm
How it's coded is exactly how it's worded
did you code it before deciding what the effect would be?
i think "If played hand is a Pair, destroy adjacent cards and gain their chips, enhancement, and edition" would be the most intuitive and the most consistent with other mods
What about seals?
Doesn't work with that
I didn't actually code it lmao
I'm just touching up descriptions in the build I'm working with
And I wanted to figure out the most efficient and non-confusing way to word it
the joker doesn't gain those tho
the card does
This description implies the joker gains it
so does your original description though
OHHHH I SEE HOW THATS CONFUSING
OHHHH
What it's supposed to do is merge the stats of the right card into the left card
bro why are you âing me I don't think it's very confusing đ
man i didn't make it okay
snow didn't implement seals
I'm just gonna put a comma after "right card"
So it doesn't read like it's destroying both cards
ohhhhh
maybe "destroy card to the right, the card to the left gains"
how do I detect a right click? I want to open a custom window when a joker is right-clicked
?
alr finally putting the code in and it's saying this is wrong
way clearer
ah, i had only one = lol
Wheres the wiki page with taking ownership of a vanilla thing?
and now it crashes when i select a joker?
still pointing to line 36
saying the extra is nil
do i need to put my loc_vars after the config (getting the screenshots of the code rn)
im trying to get the most played poker hand, this should set local hand to the poker hands name but it just sets it to nil
It's k not K
ahhh
Also you should be setting played = v.played
Elsewise it'll always get the last hand on the list as long as it's been played more than 0 times.
thank you, i cant believe i overlooked that
i removed the parenthesis from the last return since it's unnecessary but it's still saying that the extra there is an issue
seems this calculates where its adding more than its supposed too
did .2 instead for one card
I honestly can't see what's wrong, I'm about to drive home so I can help you more in like an hour
alr
context.scoring_hand is truthy almost always?
wdym?
You're using scoring_hand as your context check but that's a table with the scoring hand, which exists for most contexts
Can you post the crash log
is there sum better I can use to check hand once main_scoring?
context.before?
what are kings listed as in terms of rank.
13
thanks
in the meantime how does cryptid handle the whole "more than 5 card selection limit" deal
G.hand.config.highlighted_limit = number
so if i had a sticker that increased the card selection limit when card held in hand would it be something like
G.hand.config.highlighted_limit = G.hand.config.highlighted_limit + [variable for number of the specific sticker on cards held in hand]
end```
or something like that
I don't think you would return it.
ah
this is probably still the case, right? making all the yo-kai tribes seperate object types is basically what crypid does for food jokers
does the rest seem about right
I think so.
where would i find the code that handles that
would it be smth similar for expanding the hand size itself
G.hand:change_size(variable for number of the specific sticker on cards held in hand)
they recently fixed it so you can just put all the keys in cards instead of doing this inject thing but here https://github.com/SpectralPack/Cryptid/blob/6e3574a17ef4dd205efdc2ea03a0df08731eac7a/lib/content.lua#L319
so its just
G.hand:change_size([variable])
end```
?
I think so.
so i would just add the jokers i want to modify in the "cards" section
right
yeah
idk what happens if you add something from a mod that's not loaded tho
alright how do I get the stake completion for a deck
get_joker_win_sticker() didn't work on a deck
figured i may as well try it anyway
how do i debuff a card with debugplus?
eval SMODS.debuff_card(card, true)?
Yes, that's what you type into debugplus.
ohhhhhhhhhh
how do I detect the right mouse button click in code?
Hook Controller:R_cursor_press?
what does it mean to hook, here?
where are the hex codes for rarity badges stored
globals.lua
i might start a new run to see if that fixes the issue
it's always good to start a new run before testing something
this should flip all played cards, turn them into glass, and flip them back, but they dont get enhanced to glass until after the hand is resolved. they still flip 2 times, but they're still glass afterwards
hi another time, i want to make every time play only 1 card add a hand size, but pop ups a error un this line
card.ability.h_size = card.ability.h_size + card.ability.extra_h
what if you delete the nil, true in set_ability?
also don't use context is events, save them to another variable first
yeah.... that was the issue lol
what's the error
extra_h is probably not getting saved
alright now that thats solved, time to add more code for other stuff
but like, how do i format it
okay, so, now they flip twice, look like glass, but they dont trigger the x2 mult
can i see the config? also try saving stuff in an extra table
yeah if you do it in an event it happens after scoring
idk what the correct timing would be rn
should be easy then
here is it
ok try restarting a run and using card.ability.extra.extra_h
where i use it?
yes
Am I missing something with the load function cause I swear every time I try to reference a variable inside it, that variable just isn't loaded yet. Like it can't see into 'extra' for jokers (joker.ability.extra), and #G.hand.cards returns 0
now dont crash but didnt work
h_size should also use extra.h_size
and the return should say extra instead of extra_h
yup, it works but the messaege didn't show
how does one check to see if a joker is currently in your joker slots
like check to see if the player currently had another specific joker
now works, i change the sytaxis
can i hook smods functions?
You should be able to yeah
there is probably a better way to do this but i dont know what,i want to change the odds and xmult of glass cards depending on whether i have a specific joker, but this isnt working
Instead of taking ownership, you could probably do this with an add_to_deck function in the joker itself
all the joker keys should be the same as their actual ingame names, right?
There are some differences
besides showman which seems to be "ring_master"
It's more than that
what does that do?
is there a list of them out there?
Runs code when the joker is added to your deck
would be nice to know
game.lua if you know how to look at the source
yea that would be useful, but i still dont know how else to modify the glass cards
What I'd do is change the extra value in the prototype for m_glass, and afterwards loop through your deck to do the same with glass cards you already have
Or instead of changing the prototype, you could hook Card:set_ability and change it whenever a glass card is made
i'll probably go with that
Here's how I did something similar with Stone Cards. It'd obviously look a little different with Glass Cards but it's a decent reference point
thank you!
np!
would it be v.extra.odds?
my work on Star Card art for Entropy! all of them besides Multiverse, Star.Lua, Nemesis, Pulsar/Quasar and the five âsuit starsâ (all drawn by ruby iirc) is my art!
I think it'd be card.ability.extra
ahh okay
Coming from a total space nerd, these kick ass
coming from another total space nerd, thank you :3
i was really proud of Dyson Swarm, Betelgeuse, TRAPPIST-1 & Kepler-90âs art
I believe in Trappist-1 system supremacy
(Micro's full name is Microscoppi, Geist's is Poltergeist, and Proxima's is Proxima Centauri)
hell yeah
(All art done by Maxis)
for anyone curious, Entropy is a Cryptid addon mod lol
hence why theres so many
Aw damn, not gonna play that :/
ah fair
Not a big Cryptid guy unfortunately

